/* Shared responsive rules for all public (non-admin) views. */

html,
body {
  max-width: 100%;
  overflow-x: hidden;
}

img,
video {
  max-width: 100%;
}

@media (max-width: 900px) {
  .topbar-inner {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
  }

  .search-box {
    grid-column: 1 / -1;
    grid-row: 2;
    width: 100%;
  }

  .nav-wrap {
    top: 128px;
  }

  .hero-content,
  .contact-box {
    grid-template-columns: 1fr;
  }

  .hero-video-box {
    max-width: 100%;
  }

  .info-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 620px) {
  .container {
    width: min(100% - 20px, 1220px);
  }

  .topbar-inner {
    min-height: auto;
    padding: 8px 0 10px;
  }

  .brand-icon {
    width: 36px;
    height: 36px;
  }

  .brand h1 {
    font-size: 18px;
  }

  .brand p,
  .lang {
    display: none;
  }

  .search-box {
    height: 42px;
    grid-template-columns: 40px minmax(0, 1fr) 76px;
  }

  .search-box input {
    min-width: 0;
    padding: 0 9px;
    font-size: 12px;
  }

  .search-box button {
    font-size: 11px;
  }


  .nav {
    gap: 6px;
  }

  .nav a {
    padding: 8px 11px;
    font-size: 11px;
  }

  .hero {
    min-height: auto;
    margin-top: 16px;
    padding: 18px 14px;
  }

  .hero h2 {
    font-size: 25px;
  }

  .hero p {
    font-size: 13px;
  }

  .arrow {
    display: none;
  }

  .section {
    margin-top: 24px;
    margin-bottom: 24px;
  }

  .section-head {
    align-items: flex-start;
    gap: 6px;
    margin-bottom: 14px;
  }

  .section-head h2,
  .section-head h3,
  .section-title {
    font-size: 17px;
    line-height: 1.3;
  }

  .section-head > p {
    font-size: 11px;
  }

  /* Required mobile layout: exactly three categories per row. */
  .custom-category-tabs {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 7px;
  }

  .custom-cat-card {
    min-width: 0;
    min-height: 108px;
    padding: 10px 5px;
    border-radius: 10px;
  }

  .custom-cat-card span {
    width: 34px;
    height: 34px;
    margin-bottom: 7px;
    border-radius: 10px;
    font-size: 18px;
  }

  .custom-cat-card h4 {
    overflow-wrap: anywhere;
    font-size: 10px;
    margin-bottom: 4px;
  }

  .custom-cat-card small {
    font-size: 8px;
  }

  /* Required mobile layout: exactly three products per row. */
  .product-grid,
  .custom-product-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 7px;
  }

  .product-card,
  .custom-product-card {
    min-width: 0;
    padding: 7px;
    border-radius: 8px;
  }

  .product-card:hover,
  .custom-product-card:hover,
  .custom-cat-card:hover {
    transform: none;
  }

  .product-card img,
  .custom-product-card img {
    height: 92px;
    margin-bottom: 6px;
    object-fit: cover;
  }

  .product-card h3,
  .custom-product-card h4 {
    min-height: 0;
    overflow-wrap: anywhere;
    font-size: 10px;
    line-height: 1.3;
  }

  .badge-new {
    top: 5px;
    left: 5px;
    padding: 2px 5px;
    font-size: 8px;
  }

  .product-price,
  .custom-product-card p {
    overflow-wrap: anywhere;
    font-size: 11px;
    line-height: 1.3;
  }

  .stalls-count {
    padding: 2px 4px;
    margin-bottom: 5px;
    font-size: 8px;
  }

  .btn-action,
  .custom-product-card button {
    min-height: 30px;
    padding: 6px 3px;
    font-size: 9px;
  }

  .filter-row {
    align-items: stretch;
  }

  .filter-pill,
  .sort-select {
    max-width: 100%;
    font-size: 10px;
  }

  .info-grid,
  .contact-box {
    grid-template-columns: 1fr;
  }

  #rexoProductDetails {
    padding: 10px;
  }

  .pdp-gallery-card,
  .pdp-info-card,
  .pdp-spec-card {
    padding: 14px;
  }

  .pdp-main-image {
    height: 250px;
  }

  .pdp-seller-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 7px;
  }

  .pdp-seller-actions strong {
    grid-column: 1 / -1;
  }

  footer {
    padding: 38px 18px;
  }

  .footer-container {
    gap: 28px;
  }

  .footer-policy a {
    display: inline-block;
    margin: 5px 7px;
  }
}

@media (max-width: 360px) {
  .product-grid,
  .custom-product-grid,
  .custom-category-tabs {
    gap: 5px;
  }

  .product-card,
  .custom-product-card {
    padding: 5px;
  }

  .product-card img,
  .custom-product-card img {
    height: 78px;
  }
}


/* =====================================
   Fixed Header and Search Bar
===================================== */

.topbar {
    position: fixed !important;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    z-index: 9999;
}

.nav-wrap {
    position: fixed !important;
    top: 72px;
    left: 0;
    right: 0;
    width: 100%;
    z-index: 9990;
}

/* Fixed header-এর নিচে page content রাখবে */
body {
    padding-top: 124px;
}

/* Search suggestion header-এর উপর থাকবে */
.search-suggestions {
    z-index: 10000;
}


/* =====================================
   Tablet and Mobile
===================================== */

@media (max-width: 900px) {
    .topbar {
        position: fixed !important;
        top: 0;
    }

    /* Mobile-এ header দুই লাইনের হওয়ায় nav নিচে থাকবে */
    .nav-wrap {
        position: fixed !important;
        top: 128px !important;
    }

    body {
        padding-top: 180px;
    }
}


/* =====================================
   Small Mobile
===================================== */

@media (max-width: 620px) {
    .topbar {
        position: fixed !important;
        top: 0;
    }

    .nav-wrap {
        position: fixed !important;
        top: 104px !important;
    }

    body {
        padding-top: 158px;
    }

    .search-box {
        position: relative;
        z-index: 10001;
    }
}


/* =====================================
   Mobile Header — One Line
   Logo | Search | Cart
===================================== */

@media (max-width: 620px) {
    .topbar-inner {
        min-height: 62px;
        display: grid !important;
        grid-template-columns: 110px minmax(0, 1fr) 42px;
        align-items: center;
        gap: 7px;
        padding: 8px 0;
    }

    /* Logo */
    .brand {
        min-width: 0;
        gap: 6px;
    }

    .brand-icon {
        width: 34px;
        height: 34px;
        flex-shrink: 0;
        border-radius: 11px;
        font-size: 17px;
    }

    .brand h1 {
        font-size: 15px;
        white-space: nowrap;
    }

    .brand p {
        display: none;
    }

    /* Search */
    .search-box {
        grid-column: auto !important;
        grid-row: auto !important;
        width: 100%;
        min-width: 0;
        height: 38px;
        grid-template-columns: minmax(0, 1fr) 58px;
        border-radius: 999px;
    }

    /* জায়গা কমানোর জন্য search icon বাদ যাবে */
    .search-icon {
        display: none;
    }

    .search-box input {
        width: 100%;
        min-width: 0;
        padding: 0 9px;
        font-size: 10px;
        text-overflow: ellipsis;
    }

    .search-box button {
        width: 58px;
        padding: 0;
        font-size: 9px;
    }

    /* Cart */
    .header-actions {
        width: 42px;
        min-width: 42px;
        gap: 0;
        justify-content: flex-end;
    }

    .lang {
        display: none;
    }

    .icon-btn {
        width: 38px;
        min-width: 38px;
        height: 38px;
        padding: 0;
    }

    /* Fixed navigation-এর নতুন position */
    .nav-wrap {
        top: 62px !important;
    }

    body {
        padding-top: 114px;
    }
}



/* =====================================
   Beautiful Compact Mobile Hero
===================================== */

@media (max-width: 620px) {
    .hero {
        position: relative;
        min-height: auto !important;
        margin-top: 14px;
        padding: 26px 16px 18px !important;
        border-radius: 20px;
        overflow: hidden;
    }

    .hero-content {
        display: grid !important;
        grid-template-columns: 1fr !important;
        gap: 20px;
        align-items: center;
    }

    /* Hero text */
    .hero-content > div:first-child {
        position: relative;
        z-index: 3;
        width: 100%;
        padding: 0;
    }

    .hero .tag {
        display: inline-flex;
        width: fit-content;
        margin-bottom: 12px;
        padding: 6px 11px;
        border-radius: 999px;
        font-size: 9px;
        line-height: 1;
        letter-spacing: 0.5px;
    }

    .hero h2 {
        max-width: 310px;
        margin: 0 0 12px;
        color: #ffffff;
        font-size: 25px !important;
        line-height: 1.08;
        letter-spacing: -0.7px;
    }

    .hero p {
        max-width: 320px;
        margin: 0;
        color: rgba(255, 255, 255, 0.9);
        font-size: 12px !important;
        line-height: 1.65;
    }

    /* Video/image card */
    .hero-card {
        position: relative;
        z-index: 3;
        width: 100% !important;
        max-width: 100% !important;
        height: auto !important;
        min-height: 0 !important;
        margin: 0 !important;
        padding: 10px !important;
        border-radius: 16px !important;
        background: rgba(255, 255, 255, 0.92);
        box-shadow: 0 14px 30px rgba(0, 0, 0, 0.25);
    }

    .hero-video-box {
        width: 100% !important;
        max-width: 100% !important;
        height: 180px !important;
        min-height: 0 !important;
        aspect-ratio: auto !important;
        margin: 0 !important;
        border-radius: 12px !important;
        box-shadow: none !important;
    }

    .hero-video {
        display: block;
        width: 100% !important;
        height: 100% !important;
        object-fit: cover;
        border-radius: 12px;
    }

    /* Slider controls */
    .hero .arrow {
        display: none !important;
    }

    .hero-dots {
        position: relative;
        z-index: 4;
        margin-top: 14px;
    }
}


/* Extra-small mobile */
@media (max-width: 380px) {
    .hero {
        padding: 22px 13px 15px !important;
    }

    .hero h2 {
        font-size: 22px !important;
    }

    .hero p {
        font-size: 11px !important;
    }

    .hero-video-box {
        height: 155px !important;
    }
}

/* =====================================
   Extra Compact Mobile Hero
   Text Left | Video Right
===================================== */

@media (max-width: 620px) {
    .hero {
        min-height: 230px !important;
        margin-top: 12px;
        padding: 18px 12px !important;
        border-radius: 18px;
    }

    .hero-content {
        display: grid !important;
        grid-template-columns:
            minmax(0, 1.25fr)
            minmax(115px, 0.75fr) !important;
        gap: 10px !important;
        align-items: center !important;
    }

    /* বাম পাশের লেখা */
    .hero-content > div:first-child {
        width: 100%;
        min-width: 0;
        padding: 0 !important;
    }

    .hero .tag {
        margin-bottom: 8px;
        padding: 5px 8px;
        font-size: 7px !important;
        white-space: nowrap;
    }

    .hero h2 {
        max-width: 100%;
        margin-bottom: 8px;
        font-size: 17px !important;
        line-height: 1.05 !important;
        letter-spacing: -0.4px;
    }

    .hero p {
        max-width: 100%;
        font-size: 8px !important;
        line-height: 1.55 !important;
    }

    /* ডান পাশের video */
    .hero-card {
        width: 100% !important;
        min-width: 0 !important;
        max-width: 160px !important;
        height: auto !important;
        min-height: 0 !important;
        margin: 0 0 0 auto !important;
        padding: 6px !important;
        border-radius: 13px !important;
    }

    .hero-video-box {
        width: 100% !important;
        height: 125px !important;
        min-height: 0 !important;
        aspect-ratio: auto !important;
        border-radius: 9px !important;
    }

    .hero-video {
        width: 100% !important;
        height: 100% !important;
        object-fit: cover !important;
        border-radius: 9px !important;
    }

    .hero-dots {
        position: absolute;
        bottom: 7px;
        left: 50%;
        margin: 0;
        transform: translateX(-50%);
    }
}


/* খুব ছোট Mobile */
@media (max-width: 380px) {
    .hero {
        min-height: 215px !important;
        padding: 15px 10px !important;
    }

    .hero-content {
        grid-template-columns:
            minmax(0, 1.3fr)
            minmax(105px, 0.7fr) !important;
        gap: 7px !important;
    }

    .hero h2 {
        font-size: 15px !important;
    }

    .hero p {
        font-size: 7.5px !important;
        line-height: 1.5 !important;
    }

    .hero-video-box {
        height: 110px !important;
    }
}