/* =========================
     1. Large Devices (>=1440px)
     ========================= */
@media (min-width: 1440px) {
     .container {
          max-width: 1320px;
     }
}

/* =========================
     2. Medium Devices (1200px - 1439px)
     ========================= */
@media (max-width: 1439px) and (min-width: 1200px) {
     .category-image-wrapper {
          height: 160px;
     }
}

/* =========================
     3. Laptops/Tablets (992px - 1199px)
     ========================= */
@media (max-width: 1199px) and (min-width: 992px) {
     .product-details-container {
          flex-direction: column;
          gap: 30px;
     }
     .category-image-wrapper {
          height: 140px;
     }
     .section-title h3 {
          font-size: 20px;
     }
}

/* =========================
     4. Tablets (768px - 991px)
     ========================= */
@media (max-width: 991px) and (min-width: 768px) {
     .nav {
          flex-direction: column;
          gap: 1rem;
     }
     .search-box input {
          width: 160px;
     }
     .hero-content h2 {
          font-size: 1.7rem;
     }
     .product-details-container {
          flex-direction: column;
          gap: 20px;
     }
     .action-buttons {
          flex-direction: column;
          gap: 10px;
     }
     .product-details-section .add-to-cart-btn,
     .product-details-section .buy-now-btn {
          width: 100%;
          justify-content: center;
     }
     .cart-sidebar {
          width: 100%;
          right: -100%;
     }
     .category-image-wrapper {
          height: 130px;
     }
     .section-title::before,
     .section-title::after {
          width: 35%;
     }
     .section-title h3 {
          font-size: 18px;
     }
     .row-cols-8 {
          --bs-columns: 4;
     }
}

/* =========================
     5. Extra Small Devices (480px - 767px)
     ========================= */
@media (max-width: 767px) and (min-width: 480px) {
     

     .billing-container, .product-container {
          width: 100% !important;
      }
     .nav {
          flex-direction: column;
          gap: 0.5rem;
     }
     .search-box input {
          width: 120px;
     }
     .hero-content h2 {
          font-size: 1.2rem;
     }
     .hero-content p {
          font-size: 0.95rem;
     }
     .section-title {
          font-size: 1.3rem;
     }
     .category-header h3 {
          font-size: 1rem;
     }
     .tabs-header {
          flex-wrap: wrap;
     }
     .action-buttons {
          flex-direction: column;
          gap: 8px;
     }
     .product-details-section .add-to-cart-btn,
     .product-details-section .buy-now-btn {
          width: 100%;
          font-size: 1rem;
     }
}

/* =========================
     6. Mobile Navigation (<=767px)
     ========================= */
@media (max-width: 767px) {
     /* Prevent horizontal overflow on mobile */
     .header,
     .header .container,
     .footer,
     .footer .container,
     .site-content {
          max-width: 100%;
          overflow-x: hidden;
     }
     .header .row,
     .header .nav {
          margin-left: 0;
          margin-right: 0;
          max-width: 100%;
     }
     .header [class*="col-"] {
          padding-left: 8px;
          padding-right: 8px;
     }
     .search-box {
          min-width: 0;
          flex: 1 1 auto;
     }
     .search-box input {
          min-width: 0;
     }
     .nav-icons {
          flex-shrink: 0;
          gap: 12px;
     }
     .logo h1 a,
     .logo-img {
          max-width: 100%;
          overflow: hidden;
     }
     .footer-content {
          overflow-x: hidden;
          max-width: 100%;
     }
     .footer-section,
     .footer-tagline,
     .footer-links a {
          max-width: 100%;
          word-wrap: break-word;
          overflow-wrap: break-word;
     }
     .mobile-footer-bar {
          width: 100%;
          max-width: 100vw;
          left: 0;
          right: 0;
          box-sizing: border-box;
          padding-left: 4px;
          padding-right: 4px;
     }
     .mobile-footer-item {
          min-width: 0;
          flex: 1 1 0;
          font-size: 10px;
     }

     .billing-container, .product-container {
          width: 100% !important;
      }
     
     /* Navigation */
     .submenu-toggle {
          width: 100%;
          font-size: 18px;
          color: #333;
          padding: 7px 0;
          border-bottom: 1px solid #eee;
     }
     .nav-menu li.sub.has-submenu {
          position: relative;
     }
     .has-submenu.open > .submenu {
          display: block !important;
          position: relative !important;
          left: 0 !important;
          top: 0 !important;
     }
     sub.submenu {
          background: transparent;
     }
     .submenu-toggle .arrow,
     .sub.has-submenu .submenu-toggle {
          font-size: 14px;
          color: #fff !important;
          width: 30px !important;
          height: 30px !important;
          background: #fc8303;
          text-align: center !important;
          display: inline-block !important;
          border-radius: 2px;
          line-height: 30px;
          padding: 0 !important;
     }
     .sub.has-submenu .submenu-toggle {
          position: absolute;
          right: 6px;
          top: 22px;
          font-size: 17px;
     }
     li.sub.has-submenu ul li a {
          border-bottom: 1px solid #ddd;
          background: #fff;
     }
     li.sub.has-submenu a {
          padding: 10px;
          font-size: 16px;
          border-bottom: 1px solid #dddddd91;
     }
     .navbar-nav a {
          border-bottom: 1px solid #eee;
     }
     .nav-menu a {
          padding: 7px 0;
          width: 100%;
          display: block;
          font-size: 18px;
          font-weight: 500;
          color: #333;
     }
     .nav-menu a:hover,
     .nav-menu a:focus {
          color: #e74c3c;
     }
     .submenu li a {
          padding: 7px 15px;
          font-size: 18px;
          font-weight: 500;
     }
     ul.submenu {
          width: 100%;
          background: #eeeeeec4;
          border-radius: 0;
          position: relative;
          top: 0;
     }
     ul.submenu li {
          border-bottom: 3px solid #fff;
     }
     .nav-menu ul li {
          padding: 0;
          border-right: 0;
          border-bottom: 0;
     }
     
     .nav-hotline {
          display: none;
     }
     .search-box input {
          width: 100%;
     }
     .toggleMenu {
          background: none;
          border: none;
          font-size: 21px;
          cursor: pointer;
          position: relative;
          z-index: 2;
     }
     .nav-icons {
          justify-content: flex-end;
          gap: 25px;
     }
     .cart-icon,
     .user-btn {
          font-size: 18px !important;
     }
     .cart-count {
          top: -9px;
          right: -12px;
          font-size: 12px;
          font-weight: 500;
     }
     .nav-menu {
          position: fixed;
          top: 0;
          left: -100%;
          width: 100vw;
          height: 100vh;
          background: #fff;
          display: flex;
          flex-direction: column;
          padding-top: 50px;
          z-index: 1000;
          transition: left 0.3s ease;
          padding: 10px;
     }
     .nav-menu.show {
          left: 0;
     }
     .closeMenu {
          font-size: 30px;
          color: #000;
          background: none;
          border: none;
          cursor: pointer;
     }
     .nav-menu-wrapper {
          flex-direction: column;
          width: 100%;
     }
     
     .nav-menu ul {
          display: flex;
          list-style: none;
          flex-direction: column;
          margin-top: 0;
          gap: 0;
          width: 100%;
     }
     
     .navbar-nav {
          width: 100%;
     }
     .mobile-logo-flex {
          display: flex;
          align-items: center;
          justify-content: space-between;
          border-bottom: 1px solid #eee;
     }
     .navbar-nav {
          flex-direction: column !important;
     }
     .navbarToggler {
          background: transparent;
          border: 0;
          outline: none;
          box-shadow: none;
          font-size: 22px;
          cursor: pointer;
     }
     .header {
          position: relative;
     }
     .header.header-fixed {
          position: fixed;
          top: 0;
          left: 0;
          right: 0;
          z-index: 1001;
          box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
     }
     .search-box {
          width: 100%;
          display: flex;
          flex-direction: row;
          align-items: flex-end;
     }
     .fa-search {
          font-size: 18px;
          flex-direction: row;
          justify-content: flex-end;
          align-items: flex-end;
          right: 15px;
     }
     .site-content,
    .site-content, 
    .hero {
          margin-top: 0;
          height: auto;
          width: 100%;
          display: block;
          overflow: hidden;
     }
     .hero-content img {
          height: 230px !important;
          object-fit: cover;
     }
     .category-header h3 {
          line-height: .75rem;
          font-size: 1.125rem;
          font-weight: 500;
     }
     .category-header {
          margin-bottom: 10px;
     }
     .product-image {
          height: 188.75px;
          width: 188.75px;
          border-radius: 5px;
     }
     .product-details-section .product-info {
          padding: 0 !important;
          justify-content: flex-start;
     }
     .products-section {
          padding: 5px 0;
     }

     .price_wrapper {
          flex-wrap: wrap;
          font-weight: 500;
          gap: 10;
          font-size: .75rem;
     }
     .add-to-cart-btn {
          font-size: 15px;
          padding: 5px 3px;
     }
     .product-card {
          height: 100%;
          width: 100%;
          margin-bottom: 13px;
     }
     .product-row {
          margin: -8px;
          padding: 0;
          gap: 0;
          display: flex;
          flex-direction: row;
          align-items: center;
          justify-content: flex-start;
     }
   
     .newsletter-section {
          padding: 2rem 0;
     }
     .newsletter-title {
          font-size: 30px;
     }
     .footer-bottom p {
          margin: 0;
     }
     .footer-content {
          display: flex;
          flex-direction: column;
          margin-bottom: 0;
          gap: 20px;
     }
     .breadcrumb {
          margin: 0;
          padding: 2% 0;
          width: 100vw;
          max-width: 100vw;
          left: 0;
          right: 0;
          border-radius: 0;
     }
     .product-details-container {
          gap: 10px;
          padding: 15px;
     }
     .main-image {
          height: 350px;
          object-fit: cover;
          object-position: center;
     }
     .thumbnail {
          width: 80px !important;
          height: 70px !important;
          flex: 0 0 calc((100% - 80px)/3);
     }
     .slider-btn {
          width: 40px !important;
          height: 30px !important;
          display: block !important;
          font-size: 17px !important;
     }
     .zoom-result {
          display: none !important;
     }
     .product-details-section .product-title {
          font-size: 22px;
          margin: 0 0 15px;
          min-height: auto;
     }
     .product-details-section .product-price {
          font-size: 20px;
          margin: 0 0 15px;
     }
     .product-details-section .add-to-cart-btn, .product-details-section .buy-now-btn {
          padding: 8px;
          width: 100%;
          height: 45px;
          margin-top: 9px;
          background: #000;
          gap: 5px;
     }
     .product-tabs {
          margin-top: 0px;
          padding: 15px;
     }
     .tab-btn {
          font-size: 14px;
     }
     .related-products {
          margin: 30px 0;
     }
     .related-products .product-title {
          min-height: auto;
     }
     #checkout {     
          padding: 0px 0;
          background: rgb(229 231 235);
     }
.checkout-flex {
     margin: 5px 0 0;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    font-size: 13px;
}
.form-group input {
    width: 100%;
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 11px !important;
}
.checkout-form-inner {
    display: flex !important;
    flex-direction: column;
    gap: 0px;
    margin: 0px 0px;
}
.form-control {
    display: block;
    width: 100%;
    padding: .375rem .75rem;
    font-size: 12px;
    font-weight: 400;
    line-height: 1.5;
    color: #212529;
    background-color: #fff;
    background-clip: padding-box;
    border: 1px solid #ced4da;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    border-radius: .25rem;
    transition: border-color .15s ease-in-out,box-shadow .15s ease-in-out;
}
.page-tabs {
    margin: -10px 0px;
    display: flex;
    gap: 30px;
    flex-direction: row;
    justify-content: space-around;
    font-weight: bold;
    border-bottom: 1px solid #ddd;
    font-size: 13px;
}

.cart-total {
    font-size: 15px;
}

.breadcrumb {
    margin: 0;
    padding: 1% 0;
  
}

.instruction-text{
     padding-bottom:10px !important;
     font-size: 14px !important;
}

.instruction-text::after {
    content: "";
    position: absolute;
    bottom: -5px;
    left: -10px !important;
    right: -10px !important;
    border-bottom: 3px dashed #555 !important;
}

     .checkout-summary,
     .checkout-form {
          padding: 15px 2px;
          min-height: auto;
     }
     .checkout-summary {
          gap: 15px;
     }

     .checkout-item-image img{
          width:50px;height:65px;object-fit:cover;
     }

     .checkout-sub-title {
          font-size: 19px; 
          margin-bottom: 5px;
          margin-left:0px;
     }
     .checkout-sub-title-2 {
          font-size: 19px; 
          margin-bottom: 5px; 
          margin-left:0px;
     }

     .thumbnail-container {
          gap: 6px;
     }
     #siteNavBar {
          position: fixed;
          height: 100vh;
          width: 100vw;
          background: #fff;
          left: 0;
          right: 0;
          top: 0;
          bottom: 0;
          padding: 20px;
          z-index: 999;
     }
     .top-sales-category-section {
          width: 93px;
          height: 93px;
          margin: 2px;
          padding: 5px;
     }
     .zoom-container{
          border: none !important;
     }
     .product-details-right-container{
          border: none !important;
     }
     .product-detail-title{
          font-size: 1.125rem;
          line-height: 1.75rem;
     }
     .meta-value {
          color: var(--secondary-color);
          margin-left: 5px;
     }
     .meta-label {
          font-weight: bold;
          min-width: 42px;
          color: var(--primary-color);
          font-weight: 700;
          font-size: 1rem;

     }
     .social-icon {
          display: flex;
          align-items: center;
          justify-content: center;
          background: #ccc;
          color: #000;
          width: 2rem;
          height: 2rem;
          border-radius: 50%;
          text-decoration: none;
          transition: background 0.2s, color 0.2s, box-shadow 0.2s;
          font-size: 1.2rem;
     }
     .product-details-section .product-price {
          font-size: 20px;
          margin-top: 1rem;
     }
     .original-price {
          font-size: .875rem;
          line-height: 1.25rem;;
     }
     .product-details-sale-price{  
          font-size: 1.5rem;
          line-height: 2rem;
  
     }
     .quantity-control {
          display: flex;
          align-items: center;
          margin-bottom: 0rem;
     }
     .attribute-group {
          margin-bottom: 8px;
          margin-left: -5px;
     }
     .product-meta {
          margin-bottom: 0rem;
     }
     .quantity-btn {
          border-radius: 0px;
          background: #fff;
          color: #ddd;
     }
     .quantity-input {
          width: 35px;
          height: 30px;
          border-radius: 0px;
          font-size: 1rem;
          color: #333;
     }
     .action-buttons {
          flex-direction: row;
          gap: 25px;
          width: 100%;
          border-top: 1px solid #ddd;
          margin-top: 1rem;
     }
     .buy-now-btn{
          width: 100%;
          padding: 8px;
          background: var(--primary-color);
          color: white;
          border: none;
          border-radius: 0;
          cursor: pointer;
          font-size: 1rem;
          transition: background 0.3s;
          font-weight: 500;
          margin-bottom: 0px !important;
     }
     .contact-buttons{
          display: flex;
          flex-direction: row;
          align-items: center;
          justify-content: center !important;
          gap: 10px;
          flex-wrap: wrap;
          max-width: 100%;
     }
     .contact-buttons i{
          font-size: .999rem;
     }
     .contact-buttons a {
          border: none;
          border-radius: 0PX; 
          gap: 10px;
          flex: 1 1 45%;
          min-width: 0;
          max-width: 48%;
          height: 45PX;
          justify-content: center;
          align-items: center;
          text-decoration: none;
          font-size: .875rem;
          line-height: 1.25rem;
     }
     .related-products{
          text-align: center;
     }
     .related-products h2{
          letter-spacing: .1em;
          text-transform: uppercase;
          color: #000;
     }
     .related-product-col{
          padding: 0;
          margin: 0;
          display: flex;
          justify-content: center; 
          align-items: center;
          flex-direction: column;  
     }
     .related-product-add-to-btn{
          height: 31px;
     }
     .instruction-text{
          font-size: 10px;
          line-height: 1.25rem;
     }
}

/* =========================
     7. Tiny Devices (<=480px)
     ========================= */
@media (max-width: 480px) {
.thumbnail {
     flex: 0 0 calc((100% - 80px)/4);
}
.main-image {
     max-width: 100%;
}
.thumbnail-container {
     gap: 4px;
}
.nav {
     flex-direction: row;
     gap: 0.3rem;
}
.search-box input {
     font-size: 0.85rem;
}
.hero-content h2 {
     font-size: 1rem;
}
.hero-content p {
     font-size: 0.8rem;
}
.section-title {
     font-size: 1rem;
     font-weight: 500;
}
.tabs-header {
     flex-wrap: wrap;
}
.tab-btn {
     padding: 0.3rem 0.5rem;
}
.row-cols-8 {
     --bs-columns: 4;
     flex-wrap: wrap;
}
}

/* =========================
     8. Small Devices (<=576px)
     ========================= */
@media (max-width: 576px) {
.category-image-wrapper {
     height: 100px;
}
.section-title::before,
.section-title::after {
     width: 30%;
}
.section-title h3 {
     font-size: 16px;
     padding: 0 10px;
}
.section-title {
     margin: 10px 0;
}
/* Responsive columns for top categories */
@media (max-width: 991px) {
     .row-cols-lg-8 {
          --bs-columns: 4;
     }
}

@media (max-width: 767px) {
     .row-cols-lg-8 {
          --bs-columns: 3;
     }
}

@media (max-width: 575px) {
     .row-cols-lg-8 {
          --bs-columns: 2;
     }
}
.instruction-text{
     font-size: 1rem !important;
     line-height: 1rem !important;
     margin-top: 20px;
}
}

/* =========================
     9. Extra Small Devices (<=400px)
     ========================= */
@media (max-width: 400px) {
.category-image-wrapper {
     height: 90px;
     margin: 2px;
     padding: 2px;
}
.featured-category-image {
     width: 100%;
     height: 100%;
}
.section-title::before,
.section-title::after {
     width: 25%;
}
.section-title h3 {
     font-size: 20px;
}
.row-cols-8 {
     --bs-columns: 4;
}
.checkout-sub-title {
    font-size: 14px;
    margin: 0;
    padding: 0;
}
}

/* =========================
     10. Navbar Hover (>=768px)
     ========================= */
@media (min-width: 768px) {
.navbar-nav .has-submenu:hover > .submenu {
     display: block !important;
}
.navbar-nav .has-submenu:hover > .submenu-toggle .arrow i {
     transform: rotate(180deg);
}

/* Top Categories Responsive */
@media (max-width: 991px) {
     .category-image-wrapper {
          height: 150px;
     }
     
     .category-name-overlay {
          top: 8px;
          padding: 4px 10px;
     }
     
     .category-name-overlay span {
          font-size: 11px;
     }
}

@media (max-width: 767px) {
     .category-image-wrapper {
          height: 120px;
     }
     
     .category-name-overlay {
          top: 6px;
          padding: 3px 8px;
     }
     
     .category-name-overlay span {
          font-size: 10px;
     }
}
}


/* Template 4 homepage responsive spacing */
@media (max-width: 767px) {
    .template4-home-hero-shell {
        width: 100%;
        margin: 0;
        padding: 0;
        line-height: 0;
    }

    .template4-home-hero {
        width: 100%;
        aspect-ratio: 1296 / 450;
        min-height: 0;
        margin: 0;
        padding: 0;
        border-radius: 0;
    }

    .template4-home-hero .banner-swiper,
    .template4-home-hero .swiper-wrapper,
    .template4-home-hero .swiper-slide,
    .template4-home-hero .banner-image {
        width: 100%;
        height: 100%;
    }

    .template4-home-hero .banner-image {
        display: block;
        margin: 0;
        padding: 0;
        object-fit: cover;
        object-position: center;
        border-radius: 0;
        vertical-align: top;
    }

    .template4-home-hero .swiper-pagination {
        bottom: 6px;
    }

    .template4-home-top-categories {
        padding-top: 0;
    }

    .template4-home-section-title {
        margin-bottom: 10px;
    }

    .template4-home-category-grid {
        margin-bottom: 12px;
    }

    .template4-home-products {
        padding-top: 0;
        margin-bottom: 12px;
    }

    .template4-home-products .container {
        padding-left: 12px;
        padding-right: 12px;
    }

    .template4-home-products .products-grid {
        gap: 10px;
    }

    .template4-home-products .category-section {
        padding: 8px 0 12px;
    }

    .template4-home-products .category-container {
        padding-top: 8px;
    }
}


/* ==========================================================
   TEMPLATE 4 — MOBILE ACCOUNT MENU
   Keeps the profile/account control compact and prevents
   generic login styles from breaking the mobile header.
   ========================================================== */
@media (max-width: 767px) {

    /* Header right-side controls must stay inside viewport */
    .header .nav-icons {
        display: flex;
        align-items: center;
        justify-content: flex-end;
        gap: 10px;
        min-width: 0;
        width: 100%;
    }

    /* Account wrapper is only as wide as the icon */
    .header .user-menu {
        position: relative !important;
        flex: 0 0 auto;
        width: auto !important;
        min-width: 0 !important;
    }

    /* Mobile header shows icon only */
    .header .user-text {
        display: none !important;
    }

    .header .user-btn {
        width: 38px !important;
        height: 38px !important;
        min-width: 38px !important;
        padding: 0 !important;
        margin: 0 !important;

        display: inline-flex !important;
        align-items: center;
        justify-content: center;

        background: transparent !important;
        border: 0 !important;
        border-radius: 50% !important;
        box-shadow: none !important;
        overflow: visible;
    }

    .header .user-btn > i {
        width: 38px !important;
        height: 38px !important;
        min-width: 38px !important;

        display: inline-flex !important;
        align-items: center;
        justify-content: center;

        margin: 0 !important;
        padding: 0 !important;

        font-size: 20px !important;
        line-height: 1 !important;

        border: 1px solid #dedede !important;
        border-radius: 50% !important;
        background: #fff !important;
        color: #333 !important;
    }

    /*
     * Critical:
     * dropdown stays attached to account icon instead of
     * becoming a full-width header/search element.
     */
    .header .user-submenu {
        position: absolute !important;

        top: calc(100% + 10px) !important;
        right: 0 !important;
        left: auto !important;

        width: min(280px, calc(100vw - 24px)) !important;
        min-width: 220px !important;
        max-width: calc(100vw - 24px) !important;

        margin: 0 !important;
        padding: 10px !important;

        background: #fff !important;
        border: 1px solid #e8e8e8 !important;
        border-radius: 12px !important;

        box-shadow:
            0 12px 32px rgba(0, 0, 0, 0.12) !important;

        text-align: left !important;
        overflow: hidden !important;

        z-index: 9999 !important;
    }

    /*
     * Neutralize any global .login / button-like styling.
     * These rules are scoped strictly to Template 4 account menu.
     */
    .header .user-submenu .login-link,
    .header .user-submenu .register-link,
    .header .user-submenu .join-link,
    .header .user-submenu .logout-link,
    .header .user-submenu > a {
        display: flex !important;
        align-items: center !important;

        width: 100% !important;
        min-height: 40px !important;

        margin: 0 0 6px 0 !important;
        padding: 9px 12px !important;

        border: 0 !important;
        border-radius: 8px !important;

        background: transparent !important;
        color: #222 !important;

        font-size: 13px !important;
        font-weight: 500 !important;
        line-height: 1.35 !important;

        text-align: left !important;
        text-decoration: none !important;

        box-sizing: border-box !important;
    }

    .header .user-submenu .login-link:hover,
    .header .user-submenu .register-link:hover,
    .header .user-submenu .join-link:hover,
    .header .user-submenu .logout-link:hover,
    .header .user-submenu > a:hover {
        background: #f6f6f6 !important;
        color: #111 !important;
    }

    .header .user-submenu .form-container {
        width: 100% !important;
        margin-top: 8px !important;
        padding-top: 10px !important;

        border-top: 1px solid #eeeeee !important;
    }

    .header .user-submenu .order-tracking-form {
        width: 100% !important;
        margin: 0 !important;
    }

    .header .user-submenu .order-number-track {
        width: 100% !important;
        height: 40px !important;

        padding: 8px 10px !important;

        border: 1px solid #dedede !important;
        border-radius: 8px !important;

        font-size: 12px !important;
        box-sizing: border-box !important;
    }

    .header .user-submenu .order-number-track-button {
        width: 100% !important;
        min-height: 40px !important;

        margin-top: 7px !important;

        border: 0 !important;
        border-radius: 8px !important;

        font-size: 13px !important;
        font-weight: 600 !important;
    }

    /* Prevent account dropdown from changing search-row geometry */
    .header .col-12.d-lg-none {
        position: relative;
        z-index: 1;
    }

    .header .user-menu {
        z-index: 20;
    }
}


/* Extra narrow devices */
@media (max-width: 390px) {

    .header [class*="col-"] {
        padding-left: 6px;
        padding-right: 6px;
    }

    .header .nav-icons {
        gap: 8px;
    }

    .header .user-btn,
    .header .user-btn > i {
        width: 36px !important;
        height: 36px !important;
        min-width: 36px !important;
    }

    .header .user-submenu {
        width: min(268px, calc(100vw - 16px)) !important;
        max-width: calc(100vw - 16px) !important;
    }
}


/* ==========================================================
   TEMPLATE 4 — MOBILE ACCOUNT OVERLAY STACK
   Account dropdown must escape the header and render above
   search, banners, sliders and storefront content.
   ========================================================== */
@media (max-width: 767px) {

    /*
     * Horizontal overflow belongs to the page, not the header.
     * The account submenu must be allowed to extend vertically
     * outside the header.
     */
    html,
    body {
        overflow-x: clip;
    }

    .header {
        position: relative !important;
        z-index: 10000 !important;
        overflow: visible !important;
    }

    .header .container,
    .header .row,
    .header [class*="col-"],
    .header .nav-icons,
    .header .user-menu {
        overflow: visible !important;
    }

    /*
     * Keep the account dropdown in the top storefront layer.
     */
    .header .user-menu {
        position: relative !important;
        z-index: 10002 !important;
    }

    .header .user-submenu {
        z-index: 10003 !important;
    }

    /*
     * Storefront/banner remains below the header dropdown.
     */
    .site-content {
        position: relative;
        z-index: 1;
    }
}


/* ==========================================================
   TEMPLATE 4 — MOBILE SEARCH SUGGESTION OVERLAY
   Mobile search exists below Bootstrap lg breakpoint (<992px).
   Suggestions must escape header rows and float above menus,
   banners and storefront content.
   ========================================================== */
@media (max-width: 991.98px) {

    /*
     * Search dropdown is absolutely positioned, therefore every
     * relevant ancestor must allow vertical overflow.
     */
    .header,
    .header .container,
    .header .row,
    .header [class*="col-"],
    .header .search-box {
        overflow: visible !important;
    }

    /*
     * Keep the mobile search row above navigation and content.
     */
    .header {
        position: relative !important;
        z-index: 20000 !important;
    }

    .header .col-12.d-lg-none {
        position: relative !important;
        z-index: 20010 !important;
        margin-top: 12px;
    }

    .header .search-box {
        position: relative !important;
        z-index: 20020 !important;
        isolation: isolate;
    }

    /*
     * Actual mobile AJAX result container.
     */
    #searchSuggestionsMobile {
        position: absolute !important;

        top: calc(100% + 4px) !important;
        left: 0 !important;
        right: 0 !important;

        width: 100% !important;
        max-width: 100% !important;

        margin: 0 !important;

        background: #ffffff !important;
        border: 1px solid #e7e7e7 !important;
        border-radius: 10px !important;

        box-shadow:
            0 12px 30px rgba(0, 0, 0, 0.16) !important;

        max-height: min(360px, 55vh) !important;
        overflow-x: hidden !important;
        overflow-y: auto !important;

        text-align: left !important;

        z-index: 20030 !important;
    }

    /*
     * Results generated by fetchSuggestions().
     */
    #searchSuggestionsMobile > div {
        position: relative;
        z-index: 1;

        min-height: 48px;

        background: #ffffff;
        border-bottom: 1px solid #f0f0f0;

        box-sizing: border-box;
    }

    #searchSuggestionsMobile > div:last-child {
        border-bottom: 0;
    }

    /*
     * Navigation and storefront stay below live-search results.
     */
    .nav-menu {
        z-index: 1000 !important;
    }

    .site-content {
        position: relative;
        z-index: 1 !important;
    }
}


/* ==========================================================
   TEMPLATE 4 — CHECKOUT QUANTITY CONTROL
   Compact, visible and touch-friendly +/- selector.
   ========================================================== */

.checkout-cart-item-quantity-controls {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;

    min-height: 38px;
    width: fit-content;

    padding: 3px;

    background: #f7f7f8;
    border: 1px solid #e3e3e6;
    border-radius: 10px;

    overflow: hidden;
}

.checkout-cart-item-qty-btn {
    appearance: none;
    -webkit-appearance: none;

    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;

    width: 34px !important;
    height: 32px !important;
    min-width: 34px !important;

    margin: 0 !important;
    padding: 0 !important;

    background: #ffffff !important;
    color: #111111 !important;

    border: 0 !important;
    border-radius: 7px !important;

    font-size: 20px !important;
    font-weight: 600 !important;
    line-height: 1 !important;

    cursor: pointer !important;

    box-shadow:
        0 1px 2px rgba(0, 0, 0, 0.06);

    transition:
        background-color 0.18s ease,
        transform 0.12s ease,
        opacity 0.18s ease;
}

.checkout-cart-item-qty-btn:hover:not(:disabled) {
    background: #eeeeef !important;
}

.checkout-cart-item-qty-btn:active:not(:disabled) {
    transform: scale(0.94);
}

.checkout-cart-item-qty-btn:disabled {
    opacity: 0.35 !important;
    cursor: not-allowed !important;
    box-shadow: none !important;
}

.checkout-cart-item-qty-btn > span {
    display: block;
    line-height: 1;
    transform: translateY(-1px);
}

.checkout-cart-item-qty-value {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;

    min-width: 38px;
    height: 32px;

    padding: 0 6px;

    color: #111111;
    background: transparent;

    font-size: 15px;
    font-weight: 700;
    line-height: 1;

    text-align: center;
}

.checkout-cart-item-actions {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 12px !important;

    width: 100%;
    margin-top: 10px;
}

.checkout-cart-item-price-actions {
    display: flex !important;
    align-items: center !important;
    justify-content: flex-end !important;
    gap: 10px !important;
}

.checkout-cart-item-remove-btn {
    flex: 0 0 auto;
}


/* Mobile checkout quantity controls */
@media (max-width: 767px) {

    .checkout-cart-item-actions {
        gap: 8px !important;
    }

    .checkout-cart-item-quantity-controls {
        min-height: 36px;
        padding: 2px;
        border-radius: 9px;
    }

    .checkout-cart-item-qty-btn {
        width: 32px !important;
        height: 32px !important;
        min-width: 32px !important;

        font-size: 19px !important;
    }

    .checkout-cart-item-qty-value {
        min-width: 34px;
        height: 32px;

        padding: 0 4px;

        font-size: 14px;
    }

    .checkout-cart-item-price-actions {
        gap: 7px !important;
    }
}


/* ==========================================================
   TEMPLATE 4 — CART TRAY QUANTITY CONTROL
   Compact +/- control for sidebar cart.
   ========================================================== */

.sidebar-cart-quantity-controls {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;

    min-height: 34px;
    width: fit-content;

    padding: 2px;

    background: #f6f6f7;
    border: 1px solid #e4e4e7;
    border-radius: 9px;

    box-sizing: border-box;
}

.sidebar-cart-qty-btn {
    appearance: none;
    -webkit-appearance: none;

    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;

    width: 30px !important;
    height: 30px !important;
    min-width: 30px !important;

    margin: 0 !important;
    padding: 0 !important;

    border: 0 !important;
    border-radius: 7px !important;

    background: #ffffff !important;
    color: #111111 !important;

    font-size: 18px !important;
    font-weight: 700 !important;
    line-height: 1 !important;

    cursor: pointer !important;

    box-shadow:
        0 1px 2px rgba(0, 0, 0, 0.06);

    transition:
        background-color 0.15s ease,
        transform 0.12s ease,
        opacity 0.15s ease;
}

.sidebar-cart-qty-btn:hover:not(:disabled) {
    background: #ededee !important;
}

.sidebar-cart-qty-btn:active:not(:disabled) {
    transform: scale(0.94);
}

.sidebar-cart-qty-btn:disabled {
    opacity: 0.35 !important;
    cursor: not-allowed !important;
    box-shadow: none !important;
}

.sidebar-cart-qty-btn > span {
    display: block;
    line-height: 1;
}

.sidebar-cart-qty-value {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;

    min-width: 32px;
    height: 30px;

    padding: 0 4px;

    font-size: 14px;
    font-weight: 700;
    line-height: 1;

    color: #111;
}

.cart-item-price-wrapper {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 10px !important;

    width: 100%;
}

.cart-item-price-new {
    flex: 0 0 auto;
}


@media (max-width: 767px) {

    .sidebar-cart-qty-btn {
        width: 32px !important;
        height: 32px !important;
        min-width: 32px !important;
    }

    .sidebar-cart-qty-value {
        min-width: 34px;
        height: 32px;
    }
}
