/* =========================================================
   BFT — Responsive Rules
   ========================================================= */

@media (max-width: 1100px) {
    :root {
        --gutter: 20px;
    }

    .main-nav {
        gap: 18px;
    }

    .product-grid,
    .category-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .footer-grid {
        grid-template-columns: 1.4fr repeat(2, 1fr);
    }
}

@media (max-width: 820px) {
    /* When the mobile menu opens after the user has scrolled down,
       pin the header to the viewport so the menu never appears detached
       from its trigger. */
    .site-header.mobile-menu-open {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        width: 100%;
        z-index: 1100;
    }

    .site-header.mobile-menu-open .main-nav {
        top: 68px;
    }

    .section {
        padding-block: 72px;
    }

    .header-inner {
        min-height: 68px;
    }

    .main-nav {
        position: fixed;
        inset: 68px 0 0;
        z-index: 999;
        display: flex;
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        padding: 20px var(--gutter) 32px;
        background: var(--color-surface);
        border-top: 1px solid var(--color-border);
        transform: translateX(100%);
        transition: transform var(--transition-base);
    }

    .main-nav.is-open {
        transform: translateX(0);
    }

    .main-nav a {
        padding: 16px 4px;
        border-bottom: 1px solid var(--color-border);
        font-size: 1rem;
    }

    .main-nav a::after {
        display: none;
    }

    .mobile-menu-btn {
        display: inline-flex;
    }

    .header-actions .desktop-only {
        display: none;
    }

    .product-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 16px;
    }

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

    .category-card {
        min-height: 300px;
    }

    .section-heading {
        align-items: start;
        flex-direction: column;
        margin-bottom: 28px;
    }

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

    .footer-brand {
        grid-column: 1 / -1;
    }
}

@media (max-width: 520px) {
    :root {
        --gutter: 16px;
    }

    body {
        font-size: 15px;
    }

    .section {
        padding-block: 56px;
    }

    .announcement-bar,
    .announcement-bar-track,
    .announcement-message {
        min-height: 34px;
    }

    .announcement-message {
        padding: 7px 12px;
        font-size: 0.7rem;
        line-height: 20px;
    }

    .brand {
        font-size: 1.4rem;
    }

    .header-actions {
        gap: 2px;
    }

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

    .product-grid,
    .category-grid {
        grid-template-columns: 1fr 1fr;
        gap: 12px;
    }

    .product-card {
        border-radius: var(--radius-md);
    }

    .product-card__body {
        padding: 13px;
    }

    .product-card__name {
        font-size: 0.9rem;
    }

    .product-card__descriptor {
        font-size: 0.74rem;
    }

    .product-card__bottom {
        align-items: flex-start;
        flex-direction: column;
    }

    .product-card__bottom .btn {
        width: 100%;
    }

    .category-card {
        min-height: 240px;
        border-radius: var(--radius-md);
    }

    .category-card__content {
        padding: 16px;
    }

    .category-card__content h3 {
        font-size: 1.25rem;
    }

    .category-card__content p {
        font-size: 0.75rem;
    }

    .footer-grid {
        grid-template-columns: 1fr 1fr;
        gap: 30px 20px;
    }

    .footer-brand {
        grid-column: 1 / -1;
    }
}

/* Homepage slider mobile adjustments */
@media (max-width: 820px) {
    .hero-slide__inner,
    .hero-slide__inner--reverse {
        min-height: auto;
        grid-template-columns: 1fr;
        gap: 34px;
        padding-top: 42px;
        padding-bottom: 86px;
    }

    .hero-slide__copy {
        padding: 0;
    }

    .hero-slide__copy h1,
    .hero-slide__copy h2 {
        font-size: clamp(2.8rem, 11vw, 4.5rem);
    }

    .hero-slide__visual {
        max-width: 720px;
        width: 100%;
        margin-inline: auto;
    }

    .hero-slider__controls {
        right: 20px;
        bottom: 24px;
    }
}

@media (max-width: 520px) {
    .hero-slide__inner,
    .hero-slide__inner--reverse {
        padding-top: 30px;
        padding-bottom: 82px;
    }

    .hero-slide__image {
        aspect-ratio: 1 / .92;
        border-radius: 6px 22px 6px 22px;
        box-shadow: 10px 15px 0 rgba(166,106,69,.10);
    }

    .hero-slide__stamp,
    .hero-slide__handnote,
    .hero-slide__price-note {
        padding: 11px 13px;
        font-size: .82rem;
    }

    .hero-slide__stamp {
        left: 10px;
        bottom: 12px;
    }

    .hero-slide__handnote {
        right: 8px;
        bottom: 12px;
    }

    .hero-slide__price-note {
        left: 8px;
        top: 12px;
    }

    .hero-slider__controls {
        right: 16px;
        bottom: 20px;
    }

    .back-to-top {
        right: 16px;
        bottom: 16px;
        width: 43px;
        height: 43px;
    }
}

/* Final mobile refinements */
@media (max-width: 520px) {
    html, body {
        max-width: 100%;
        overflow-x: clip;
    }

    .hero-slide__image {
        border-radius: 22px !important;
        box-shadow: none !important;
    }

    .home-hero__actions {
        display: flex !important;
        flex-wrap: nowrap !important;
        gap: 8px !important;
    }

    .home-hero__actions .btn {
        flex: 1 1 0 !important;
        width: auto !important;
        min-width: 0 !important;
        min-height: 44px !important;
        padding: 10px 12px !important;
        font-size: .78rem !important;
        white-space: nowrap !important;
    }

    .product-card__name {
        min-height: 2.7em !important;
    }

    .product-card__descriptor {
        min-height: 2.4em !important;
    }

    .product-card__rating {
        min-height: 1.5em !important;
    }
}

/* =========================================================
   BFT — Final mobile product-card refinements
   ========================================================= */
@media (max-width: 820px) {
    .product-card {
        display: block;
        height: auto;
    }

    .product-card__body {
        display: block;
        padding: 14px;
    }

    .product-card__name {
        min-height: 0 !important;
    }

    .product-card__descriptor {
        display: none;
        min-height: 0 !important;
    }

    .product-card__rating {
        min-height: 0 !important;
        margin-top: 7px;
    }

    .product-card__bottom {
        margin-top: 11px !important;
        padding-top: 0 !important;
        align-items: flex-start;
        flex-direction: column;
        gap: 8px;
    }

    .product-card__bottom > div:first-child {
        width: 100%;
    }

    .product-card__bottom .bft-card-cart-control {
        width: 94px;
        min-width: 94px;
        flex: 0 0 94px;
    }

    .bft-card-add,
    .bft-card-stepper,
    .bft-card-cart-label {
        width: 94px;
        min-width: 94px;
    }

    .product-price__current {
        font-size: .92rem;
    }

    .product-price__mrp {
        font-size: .68rem;
    }

    .product-card__bottom small {
        font-size: .65rem;
    }

    .category-card {
        min-height: 0;
        aspect-ratio: 1 / 1;
    }

    .category-card__content {
        padding: 15px;
    }

    .category-card__content h3 {
        margin-bottom: 3px;
        font-size: 1.18rem;
    }

    .category-card__content p {
        line-height: 1.45;
    }
}

@media (max-width: 520px) {
    .product-card__body {
        padding: 12px;
    }

    .product-card__name {
        font-size: .86rem;
        line-height: 1.25;
    }

    .product-card__rating {
        font-size: .68rem;
    }

    .product-card__bottom {
        margin-top: 10px !important;
        gap: 7px;
    }

    .product-price__current {
        font-size: .88rem;
    }

    .product-card__wishlist {
        top: 9px;
        right: 9px;
    }

    .category-card__content h3 {
        font-size: 1.08rem;
    }

    .category-card__content p {
        font-size: .7rem;
    }

    .blog-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px;
    }
}


/* BFT — compact, bottom-aligned product cards */
@media (max-width:820px) {
 .product-card { display:flex; flex-direction:column; height:100%; }
 .product-card__body { display:flex; flex:1; flex-direction:column; padding:12px; }
 .product-card__descriptor { display:none; min-height:0 !important; }
 .product-card__rating { min-height:0 !important; margin-top:6px; }
 .product-card__bottom { width:100%; margin-top:auto !important; padding-top:10px !important; align-items:flex-end; flex-direction:row; gap:8px; }
 .product-card__bottom > div:first-child { min-width:0; flex:1 1 auto; }
 .product-card__bottom .bft-card-cart-control { flex:0 0 102px; width:102px; min-width:102px; }
 .product-price { gap:5px; }
 .product-price__current { font-size:.9rem; }
 .product-price__mrp { font-size:.66rem; }
 .product-card__bottom small { font-size:.64rem; }
}
@media (max-width:520px) {
 .product-card__body { padding:12px; }
 .product-card__name { font-size:.86rem; line-height:1.25; }
 .product-card__rating { font-size:.68rem; }
 .product-card__bottom { padding-top:9px !important; }
 .blog-card__body { padding:12px; }
}

/* =========================================================
   BFT MOBILE CATEGORY CARDS — CLEAN IMAGE CROP
   The source category artwork is wide and already contains
   typography on its left side. On a 2-column mobile crop that
   baked-in text was becoming visible beside the HTML overlay.
   Keep the approved 2-column layout and crop from the right.
   ========================================================= */
@media (max-width: 820px) {
    .category-card__image img {
        object-position: right center !important;
        transform: none !important;
    }
}

@media (max-width: 520px) {
    .category-card__image img {
        object-position: right center !important;
    }

    .category-card {
        width: 100%;
        min-width: 0;
    }

    .category-grid {
        width: 100%;
        min-width: 0;
        overflow: hidden;
    }
}


/* =========================================================
   BFT — FINAL PRODUCT CARD SYSTEM (ALL PUBLIC SECTIONS)
   Applies to Shop, Homepage Best Sellers, Gifting, Product
   recommendations and any other page using includes/product-card.php.
   ========================================================= */

/* Desktop: keep the existing visual presentation, but anchor the
   price/weight/cart area to the bottom of every card. */
@media (min-width: 821px) {
    .product-grid,
    .gifting-product-grid,
    .bft-related-grid {
        align-items: stretch;
    }

    .product-grid .product-card,
    .gifting-product-grid .product-card,
    .bft-related-grid .product-card {
        display: flex;
        flex-direction: column;
        height: 100%;
    }

    .product-grid .product-card__body,
    .gifting-product-grid .product-card__body,
    .bft-related-grid .product-card__body {
        display: flex;
        flex: 1 1 auto;
        flex-direction: column;
    }

    .product-grid .product-card__bottom,
    .gifting-product-grid .product-card__bottom,
    .bft-related-grid .product-card__bottom {
        margin-top: auto !important;
    }

    /* Discount percentage is a compact mobile/tablet detail. */
    .product-price__discount {
        display: none;
    }
}

/* Mobile + tablet: one consistent product-card presentation everywhere. */
@media (max-width: 820px) {
    .product-grid,
    .gifting-product-grid,
    .bft-related-grid {
        align-items: stretch;
    }

    .product-grid .product-card,
    .gifting-product-grid .product-card,
    .bft-related-grid .product-card {
        display: flex;
        flex-direction: column;
        height: 100%;
    }

    .product-grid .product-card__body,
    .gifting-product-grid .product-card__body,
    .bft-related-grid .product-card__body {
        display: flex;
        flex: 1 1 auto;
        flex-direction: column;
        padding: 12px;
    }

    .product-grid .product-card__name,
    .gifting-product-grid .product-card__name,
    .bft-related-grid .product-card__name {
        min-height: 2.7em;
    }

    .product-grid .product-card__descriptor,
    .gifting-product-grid .product-card__descriptor,
    .bft-related-grid .product-card__descriptor {
        display: none;
        min-height: 0 !important;
    }

    .product-grid .product-card__rating,
    .gifting-product-grid .product-card__rating,
    .bft-related-grid .product-card__rating {
        min-height: 1.5em;
        margin-top: 6px;
    }

    /* Price -> weight -> full-width cart button. The whole block is pushed
       to the card bottom so every card in a row finishes at the same level. */
    .product-grid .product-card__bottom,
    .gifting-product-grid .product-card__bottom,
    .bft-related-grid .product-card__bottom {
        width: 100%;
        margin-top: auto !important;
        padding-top: 10px !important;
        align-items: stretch;
        flex-direction: column;
        gap: 8px;
    }

    .product-grid .product-card__bottom > div:first-child,
    .gifting-product-grid .product-card__bottom > div:first-child,
    .bft-related-grid .product-card__bottom > div:first-child {
        width: 100%;
        min-width: 0;
        flex: 0 0 auto;
    }

    .product-grid .product-card__bottom .bft-card-cart-control,
    .gifting-product-grid .product-card__bottom .bft-card-cart-control,
    .bft-related-grid .product-card__bottom .bft-card-cart-control {
        width: 100%;
        min-width: 0;
        flex: 0 0 auto;
    }

    .product-grid .bft-card-add,
    .product-grid .bft-card-stepper,
    .product-grid .bft-card-cart-label,
    .gifting-product-grid .bft-card-add,
    .gifting-product-grid .bft-card-stepper,
    .gifting-product-grid .bft-card-cart-label,
    .bft-related-grid .bft-card-add,
    .bft-related-grid .bft-card-stepper,
    .bft-related-grid .bft-card-cart-label {
        width: 100%;
        min-width: 0;
    }

    .product-grid .bft-card-add,
    .gifting-product-grid .bft-card-add,
    .bft-related-grid .bft-card-add,
    .product-grid .bft-card-stepper,
    .gifting-product-grid .bft-card-stepper,
    .bft-related-grid .bft-card-stepper {
        min-height: 40px;
    }

    .product-price {
        display: flex;
        align-items: baseline;
        flex-wrap: nowrap;
        gap: 6px;
        white-space: nowrap;
    }

    .product-price__current {
        font-size: .9rem;
    }

    .product-price__mrp {
        font-size: .66rem;
    }

    .product-price__discount {
        display: inline;
        color: var(--color-muted);
        font-size: .64rem;
        font-weight: 700;
    }

    .product-grid .product-card__bottom small,
    .gifting-product-grid .product-card__bottom small,
    .bft-related-grid .product-card__bottom small {
        display: block;
        margin-top: 4px;
        font-size: .64rem;
    }
}

@media (max-width: 520px) {
    .product-grid .product-card__body,
    .gifting-product-grid .product-card__body,
    .bft-related-grid .product-card__body {
        padding: 12px;
    }

    .product-grid .product-card__name,
    .gifting-product-grid .product-card__name,
    .bft-related-grid .product-card__name {
        font-size: .86rem;
        line-height: 1.25;
    }

    .product-grid .product-card__rating,
    .gifting-product-grid .product-card__rating,
    .bft-related-grid .product-card__rating {
        font-size: .68rem;
    }

    .product-grid .product-card__bottom,
    .gifting-product-grid .product-card__bottom,
    .bft-related-grid .product-card__bottom {
        padding-top: 9px !important;
    }
}
