@import './promo.css';
@import './favorite.css';
@import './brand-logo.css';
@import './amount-calc.css';
@import './buttons.css';

.card-container {
    display: block;
    padding: 10px;
    height: 100%;
    box-sizing: border-box;
}

a.card-container * {
    text-decoration: none !important;
    text-decoration-color: transparent !important;
    text-underline-offset: 0 !important;
    text-decoration-thickness: 0 !important;
    text-decoration-style: none !important;
    text-decoration-color: transparent !important;
    text-decoration-color: transparent !important;
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
    box-sizing: border-box !important;
    box-shadow: none !important;
    box-shadow: none !important;
    border-bottom: none !important;
    border-bottom-color: transparent !important;
}

@media (max-width: 768px) {
    .card-container {
        width: 100%;
        padding: 4px; /* knob: spacing around each card (was 10px) — affects gap above/below rows */
    }
}

.card {
    position: relative;
    background-color: #FFFFFF;
    box-shadow: 0px 6px 20px 0px rgba(0, 0, 0, 0.12);
    display: flex;
    flex-direction: column;
    max-width: 100%;

    border-radius: 8px;
    overflow: hidden;
}

@media (max-width: 768px) {
    .mobile-small-card .card {
        max-width: 100%;
        height: 283px;
    }
}


.card.cupon,
.card.product,
.card.item {
    width: 100%;
    max-width: 327px;
    height: 100%;
}

.card.item,
.card.product {
    text-decoration: none;
}

@media (max-width: 768px) {

    .mobile-small-card .card.product,
    .mobile-small-card .card.cupon,
    .mobile-small-card .card.item {
        width: 100%;
        height: 283px;
    }
}

/* Image Section */
.card-header {
    position: relative;
    width: 100%;
    aspect-ratio: 950 / 540;
    height: auto;
    background-color: #FFFFFF;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

@media (max-width: 768px) {
    .mobile-small-card .card-header {
        min-height: 100px;
        height: 100px;
        align-items: flex-start;
    }
}

.card-image {
    max-width: 100%;
    max-height: 100%;
    object-fit: cover;

}

@media (max-width: 768px) {
    .mobile-small-card .card-image {
        max-width: 100%;

        max-height: 100px;
        object-fit: cover;
    }
}


.card-body {
    width: 100%;
    height: auto;
    padding: 20px;
    background-color: #FFFFFF;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    flex: 1;
}

@media (max-width: 768px) {
    .mobile-small-card .card-body {
        padding: 12px 12px 12px 12px;
        gap: 4px;
        min-height: 0;
        overflow: hidden;
    }

    .mobile-small-card .brand-logo {
        height: 28px;
    }
}


.card-details {
    max-width: 100%;
    display: flex;
    flex-direction: column;
    gap: 0px;
    align-items: flex-start;
    color: #46494F;

    font-style: normal;
}

.card-details em {
    font-style: normal;
    font-size: 36px;
    font-weight: 700;
    line-height: 32px;
    /* 80% */
}

.card-details span {
    font-size: 20px;
    font-weight: 400;
    line-height: 32px;
}

.card-details span.sub {
    font-size: 20px;
}


/* cupons */
.card.cupon .card-details{
    margin: 5px 0 0 0;
}

.card.cupon .card-details span{
    font-size: 18px;
    line-height: 28px;
}

.card.cupon .card-details em{
    font-size: 28px;
    line-height: 30px;
    font-style: normal;
    font-weight: 700;
}



@media (max-width: 768px) {
    .mobile-small-card .card-details {
        gap: 4px;
    }

    .mobile-small-card .card-details em {
        font-size: 24px;
        line-height: 20px;
    }

    .mobile-small-card .card-details span {
        font-size: 14px;
        line-height: 18px;
    }

    .mobile-small-card .card-details .product-title-bold {
        font-size: 16px;
        line-height: 18px;
    }
}

/* .card.cupon .card-details em {
    font-size: 32px;
    font-style: normal;
    font-weight: 700;
    line-height: 32px;
} */

@media (max-width: 768px) {
    .mobile-small-card .card.cupon .card-details em {
        font-size: 20px;
        line-height: 20px;
    }
}


.card-footer {
    width: 100%;
    padding: 0 20px 20px 20px;
    background-color: #FFFFFF;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
}

@media (max-width: 768px) {
    .mobile-small-card .card-footer {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
        padding: 0 12px 12px 12px;
    }

    /* 1-col view strips .mobile-small-card; without it the base
       space-between snaps the single button to flex-start (= right in RTL).
       Mirror the desktop convention and push to flex-end. */
    .benefit-grid-section--mobile-1col .card-footer {
        justify-content: flex-end;
    }
}

.product-price {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 24px;
    margin-top: 15px;
}

@media (max-width: 768px) {
    .mobile-small-card .product-price {
        font-size: 14px;
        line-height: 14px;
        gap: 4px;
        margin-top: 0;
    }
}

.price-old-container {
    display: flex;
    align-items: center;
    gap: 4px;
}

@media (max-width: 768px) {
    .mobile-small-card .price-old-container {
        gap: 2px;
    }
}

.price-old {
    font-weight: 400;
    text-decoration: line-through;
    color: rgba(0, 0, 0, 0.5);
    font-size: 28px;
}

@media (max-width: 768px) {
    .mobile-small-card .price-old {
        font-size: 20px;
        line-height: 20px;
    }
}

span.price-currency-old {
    font-weight: 400;
    color: rgba(0, 0, 0, 0.5);
    font-size: 28px;
}

@media (max-width: 768px) {
    .mobile-small-card span.price-currency-old {
        font-size: 20px;
        line-height: 20px;
    }
}

span.price-current {
    font-weight: 700;
    color: #000000;
}

@media (max-width: 768px) {
    .mobile-small-card .price-current {
        font-size: 20px;
        line-height: 20px;
    }
}

span.product-title-bold {
    font-weight: 600;
    display: block;
}

@media (max-width: 768px) {
    .mobile-small-card span.product-title-bold {
        font-weight: 500;
    }
}

span.product-title-regular {
    font-weight: 400;
    display: block;
}

.expire {
    color: #46494F;
    text-align: right;
    font-size: 16px;
    font-style: normal;
    font-weight: 400;
    line-height: 32px;
    /* 200% */
}

@media (max-width: 768px) {
    .mobile-small-card .expire {
        font-size: 11px;
        line-height: 13px;
    }
}






/* new */
section.new .card-body {
    gap: 30px;
}

section.new .card-body .card-details .card-title-regular {
    font-size: 18px;
    line-height: 23px;
    margin: 7px 0 0 0;
}


/* recommended (desktop only — mobile uses .mobile-small-card overrides above) */
@media (min-width: 769px) {
    :is(.benefit-section, .benefit-grid) .card-details {
        margin: 15px 0 0 0;
    }

    :is(.benefit-section, .benefit-grid) .card-details .product-title-bold{
        font-size: 18px;
        line-height: 24px;
    }

    :is(.benefit-section, .benefit-grid) .card-details .product-title-regular{
        font-size: 16px;
    }

    :is(.benefit-section, .benefit-grid) .card-details .product-price span{
        font-size: 22px;
    }

    :is(.benefit-section, .benefit-grid) .card-details .product-price .price-old-container .price-currency-old{
        font-size: 14px;
    }

    :is(.benefit-section, .benefit-grid) .card-footer{
        justify-content: flex-end;
    }

    :is(.benefit-section, .benefit-grid) .card-footer .add-button{
        font-size: 18px;
        padding: 8px 36px;
    }
}




/* desktop resolutions */

/* 1599 */
@media screen and (min-width: 1024px) and (max-width: 1599px) {

    section.new .card-body .card-details .card-title-regular {
font-size: 15px;
        line-height: 22px;
    }

    
    :is(.benefit-section, .benefit-grid) .card-details .product-title-bold{
        font-size: 16px;
        line-height: 22px;
    }

    :is(.benefit-section, .benefit-grid) .card-details .product-title-regular{
        font-size: 14px;
    }

    .card.cupon .card-footer{
        flex-direction: column;
        justify-content: flex-start;
        align-items: center;
        gap: 8px;
    }
        
    .card.cupon .card-footer .amount-container{
        max-width: unset;
    }

    
    .card.cupon .card-details em{
        font-size: 25px;
        line-height: 29px;
    }

}

/* 1499 */
@media screen and (min-width: 1024px) and (max-width: 1499px) {

    section.new .card-body {
        gap: 25px;
    }

    
    .card.cupon .card-details span{
        font-size: 17px;
        line-height: 27px;
    }

    :is(.benefit-section, .benefit-grid) .card-details span{
        font-size: 17px;
        line-height: 27px;
    }

    :is(.benefit-section, .benefit-grid) .card-details .product-title-bold{
        font-size: 14px;
        line-height: 20px;
    }

    :is(.benefit-section, .benefit-grid) .card-details .product-title-regular{
        font-size: 12px;
    }

    .card.cupon .card-details em{
        font-size: 22px;
        line-height: 28px;
    }

    section.new .card-body .card-details em{
        font-size: 32px;
    }


    :is(.benefit-section, .benefit-grid) .card-details .product-price span{
        font-size: 20px;
    }

}

/* 1399 */
@media screen and (min-width: 1024px) and (max-width: 1399px) {

    section.new .card-body {
        gap: 20px;
    }


    .card-details span {
        font-size: 16px;
        line-height: 26px;
    }

    .card-details em {
        font-size: 32px;
    }

    section.new .card-body .card-details .card-title-regular {
        font-size: 14px;
        line-height: 20px;
    }

        
    .card.cupon .card-details span{
        font-size: 16px;
        line-height: 26px;
    }
    
    .card.cupon .card-details em{
        font-size: 20px;
        line-height: 26px;
    }

    
    section.new .card-body .card-details em{
        font-size: 30px;
    }

            
    :is(.benefit-section, .benefit-grid) .card-details .product-price{
        margin: 0;
    }
                
    :is(.benefit-section, .benefit-grid) .card-details .product-title-regular{
        font-size: 12px;
    }

    :is(.benefit-section, .benefit-grid) .card-details .product-price span{
        font-size: 18px;
    }

}

/* 1299 */
@media screen and (min-width: 1024px) and (max-width: 1299px) {

    
    .card-details span {
        font-size: 14px;
        line-height: 24px;
    }

    .card-details em {
        font-size: 28px;
    }

    
    section.new .card-body .card-details .card-title-regular {
        font-size: 13px;
        line-height: 18px;
    }

        
    section.new .card-body .card-details em{
        font-size: 26px;
    }

        
    .card.cupon .card-details em{
        font-size: 18px;
        line-height: 26px;
    }
            
    .card.cupon .card-details span{
        font-size: 14px;
        line-height: 25px;
    }

                    
    :is(.benefit-section, .benefit-grid) .card-details .product-title-regular{
        font-size: 12px;
        line-height: 24px;
    }
}


/* 1199 */
@media screen and (min-width: 1024px) and (max-width: 1199px) {
    section.new .card-body {
        gap: 15px;
    }

    .card-details em {
        font-size: 25px;
    }
            
    section.new .card-body .card-details em{
        font-size: 24px;
    }


}


/* Hover effects on benefit/product cards.
   Two layered changes triggered by hovering anywhere on the card:
   1. The card lifts 4px and the shadow gains a tint from --card-hover-shadow-color
      (set inline on .benefit-section from $set['color4']). Mirrors the same
      pattern the header's search container uses for its hover state, so the
      colored-shadow language is consistent across the page.
   2. The image inside scales gently (clipped by .card-header's overflow: hidden).
   Transitions sit outside the hover media query so they're always primed; the
   :hover rules are gated to (hover: hover) so mobile taps don't trigger a
   sticky-hover state. */
.card.product {
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.card.product .card-image {
    transition: transform 0.3s ease;
}

@media (hover: hover) {
    .card.product:not(.is-out-of-stock):hover {
        transform: translateY(-4px);
        box-shadow: 0 7px 20px 0 var(--card-hover-shadow-color, rgba(0, 0, 0, 0.12));
    }

    .card.product:not(.is-out-of-stock):hover .card-image {
        transform: scale(1.05);
    }
}

/* Press feedback — works on both mouse-click and touch-tap. The transform
   overrides the hover lift (translateY 0) and adds a slight scale-down so the
   card visibly "presses in" when activated. Outside the (hover: hover) gate
   so tap users get the tactile response too.
   Scoped via .card-container to reach (0,0,4,0) specificity — same as the
   desktop hover rule above — so it isn't shadowed by the lift while a mouse
   hovers during the press. Still matches out-of-stock cards (the lift doesn't),
   so their press feedback is preserved. */
.card-container .card.product:active {
    transform: translateY(0) scale(0.98);
}


/* Out-of-stock treatment — when the .card.product carries .is-out-of-stock,
   the image gets a subtle blur (signaling the product is paused) and a
   frosted-red pill floats inside the image area near the bottom with the
   OOS text. The card itself stays fully clickable — pointer-events: none on
   the banner ensures clicks pass through to the underlying <a>. Hover/zoom
   effects are suppressed on out-of-stock cards (see :not(.is-out-of-stock)
   above) so the card stays visually static. */
.card.product.is-out-of-stock .card-image {
    filter: blur(2.5px);
    /* small scale to push the blurred edges past the card-header's bounds —
       prevents the soft transparent fringe of the blur from being visible
       at the card edges */
    transform: scale(1.04);
}

.out-of-stock-banner {
    position: absolute;
    /* inset from all sides so the pill floats inside the image area
       rather than spanning corner-to-corner */
    bottom: 16px;
    left: 16px;
    right: 16px;
    z-index: 2;
    padding: 10px 16px;
    border-radius: 12px;

    /* Dark frosted glass: dark translucent fill with heavy backdrop blur.
       White text on top reads as premium / Apple-like — the OOS context
       comes from the blurred image and the dark glass overlay rather than
       any alarm color. Falls back to a more opaque dark background for
       browsers without backdrop-filter. */
    background-color: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);

    pointer-events: none;
}

.out-of-stock-banner__text {
    display: block;
    color: #FFFFFF;
    font-size: 14px;
    font-weight: 600;
    text-align: center;
    letter-spacing: 0.5px;
    line-height: 1.2;
}

/* Browsers that don't support backdrop-filter get a more opaque background
   so the text stays readable without the blur effect. */
@supports not (backdrop-filter: blur(14px)) {
    .out-of-stock-banner {
        background-color: rgba(0, 0, 0, 0.7);
    }
}
