/* Site-wide mobile / responsive helpers */

html,
body {
  overflow-x: auto;
  max-width: 100%;
}

.page-wrapper,
.container,
.container-fluid {
  max-width: 100%;
}

img {
  max-width: 100%;
  height: auto;
}

/* Prevent decorative / table images from blowing up layout */
.pricing-one__shape img {
  max-width: 200px;
  width: auto;
  height: auto;
  pointer-events: none;
}

.admin-page-section .pricing-one__shape {
  display: none;
}

.admin-table-thumb {
  width: 72px;
  height: 72px;
  max-width: 72px;
  max-height: 72px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid #ddd;
  display: block;
}

.cart-page__table img.admin-table-thumb,
.admin-main .cart-page__table img {
  width: 72px;
  height: 72px;
  max-width: 72px;
  max-height: 72px;
  object-fit: cover;
}

.cart-page__table .admin-desc-cell {
  max-width: 220px;
  white-space: normal;
  word-break: break-word;
  font-size: 12px;
}

/* Admin: disable custom cursor overlay issues, ensure preloader hides */
.admin-body .custom-cursor__cursor,
.admin-body .custom-cursor__cursor-two {
  display: none !important;
}

.admin-body .preloader {
  display: none !important;
}

.admin-body .page-wrapper,
.admin-body .admin-layout,
.admin-body .admin-sidebar,
.admin-body .admin-main {
  position: relative;
  z-index: 2;
}

/* Horizontal scroll for wide data tables */
.table-scroll {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin-bottom: 1rem;
}

.table-scroll > table {
  width: max-content;
  min-width: 100%;
  margin-bottom: 0;
}

.admin-main .cart-page__table {
  min-width: 960px;
}

.admin-main .cart-page__table.admin-orders-table {
  min-width: 1100px;
}

/* Admin layout */
.admin-layout {
  display: flex;
  flex-wrap: nowrap;
  gap: 16px;
  width: 100%;
  min-height: 50vh;
  align-items: flex-start;
}

.admin-sidebar {
  flex: 0 0 200px;
  background: linear-gradient(180deg, #1e1d1d 0%, #2c2c2c 100%);
  padding: 16px 10px;
  border-radius: 10px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
  position: sticky;
  top: 100px;
  z-index: 20;
  align-self: flex-start;
}

.admin-sidebar__title {
  text-align: center;
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: #f0c040;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.15);
}

.admin-sidebar nav {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.admin-sidebar nav a {
  display: block;
  text-align: center;
  padding: 10px 8px;
  text-decoration: none;
  color: #e8e8e8;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  border: 1px solid transparent;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}

.admin-sidebar nav a:hover {
  background: rgba(164, 33, 37, 0.85);
  color: #fff;
  border-color: rgba(164, 33, 37, 0.85);
}

.admin-sidebar nav a.active {
  background: #A42125;
  color: #fff;
  border-color: #A42125;
  box-shadow: 0 2px 8px rgba(164, 33, 37, 0.4);
}

.admin-main {
  flex: 1 1 auto;
  min-width: 0;
  padding: 0 8px 16px;
  position: relative;
  z-index: 2;
}

.admin-main__toolbar {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 10px;
}

.admin-main__toolbar a {
  color: #A42125;
  font-weight: 600;
  text-decoration: none;
  padding: 6px 12px;
  border: 1px solid #A42125;
  border-radius: 6px;
}

.admin-main__toolbar a:hover {
  background: #A42125;
  color: #fff;
}

.admin-main h4 {
  margin: 0 0 12px;
  padding-left: 4px;
  font-size: 1.25rem;
}

.admin-main form {
  max-width: 100%;
}

.admin-login fieldset {
  width: 100% !important;
  max-width: 420px;
  margin: 0 auto !important;
}

/* My Orders two-column layout */
.myorders-layout {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
}

.myorders-layout__results {
  flex: 1 1 280px;
  min-width: 0;
}

.myorders-layout__search {
  flex: 0 1 280px;
  min-width: 220px;
}

.myorders-layout__search input[type="text"],
.myorders-layout__search input[type="date"],
.myorders-layout__search input[type="submit"] {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

/* Shop page */
.tim_container {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 16px;
  width: 100%;
  box-sizing: border-box;
}

.tim_container .left-div {
  flex: 1 1 280px;
  min-width: 0;
}

.tim_container .right-div {
  flex: 0 1 320px;
  min-width: 280px;
  max-width: 100%;
}

.tim_container .right-div .table-scroll,
.tim_container .right-div #cart {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.product-container {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
}

/* Checkout */
.checkout-page__order-table {
  display: block;
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* Admin filter toolbar */
.admin-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
}

.admin-filters input,
.admin-filters select,
.admin-filters button {
  width: auto;
  max-width: 100%;
}

/* Accordion / content overflow */
.accordion,
.pricing-one,
.section-space-two {
  max-width: 100%;
}

fieldset {
  max-width: 100%;
  box-sizing: border-box;
}

@media (max-width: 991px) {
  .main-header__call {
    display: none;
  }

  .main-header__right__left .main-menu {
    display: none;
  }
}

@media (max-width: 768px) {
  .table-scroll {
    box-shadow: inset -10px 0 10px -10px rgba(0, 0, 0, 0.12);
  }

  .admin-layout {
    flex-direction: column;
  }

  .admin-sidebar {
    flex: 1 1 auto;
    width: 100%;
    position: static;
  }

  .admin-sidebar nav {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
  }

  .admin-sidebar nav a {
    flex: 1 1 auto;
    min-width: 90px;
    font-size: 14px;
  }

  .admin-main {
    width: 100%;
    padding: 0 4px 16px;
  }

  .myorders-layout {
    flex-direction: column;
  }

  .myorders-layout__search {
    width: 100%;
    flex: 1 1 auto;
  }

  .tim_container {
    flex-direction: column;
  }

  .tim_container .right-div {
    width: 100%;
    flex: 1 1 auto;
  }

  .tim_product {
    flex: 1 1 calc(50% - 12px);
    min-width: 140px;
    max-width: 100%;
  }

  .tab-buttons {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
  }

  .tab-buttons li {
    flex: 0 1 auto;
  }

  .sec-title__title {
    font-size: 1.5rem;
  }

  .container {
    padding-left: 12px;
    padding-right: 12px;
  }

  .admin-filters {
    justify-content: flex-start;
  }

  .admin-filters input[type="date"],
  .admin-filters select {
    flex: 1 1 120px;
  }

  fieldset[style*="width:50%"] {
    width: 100% !important;
    margin: 0 !important;
  }
}

@media (max-width: 480px) {
  .tim_product {
    flex: 1 1 100%;
  }

  .main-header__logo img {
    width: 72px !important;
  }

  .hero-slider-two__title {
    font-size: 1.4rem;
  }
}
