/* Default soft shadow style override & compact sleek dimensions */
.product-card {
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.03) !important;
    border: 1px solid rgba(236, 231, 221, 0.7) !important;
    transition: all 0.25s ease-in-out;
}

/* Image sits inset from the card edges (gap on top/left/right) with softer corners */
.product-card .product-image-container {
    aspect-ratio: auto !important;
    padding: 12px 12px 0 12px;
    background: transparent !important;
    overflow: visible !important;
}
.product-card .product-image-container > a {
    aspect-ratio: 1 / 1;
    height: auto !important;
    border-radius: 8px;
    overflow: hidden;
    background: #f6f3ec;
}
.product-card .product-image-container .product-discount-tag {
    top: 12px !important;
    left: 22px !important;
}

/* Image hover transition: slow, soft cross-fade */
.product-card .product-card-img-primary {
    transition: transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
    opacity: 1;
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.product-card .product-card-img-hover {
    transition: opacity 0.8s ease-in-out, transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
    will-change: opacity;
    opacity: 0;
    pointer-events: none;
    width: 100%;
    height: 100%;
    object-fit: cover;
}
/* Hover effects only on real hover devices (mouse). On touch screens a :hover
   that reveals content (the alternate image fading in) makes iOS/Android treat
   the first tap as "hover" and swallow it, so tapping a card did nothing. */
@media (hover: hover) and (pointer: fine) {
    .product-card:hover {
        box-shadow: 0 8px 18px rgba(0, 0, 0, 0.06) !important;
        transform: translateY(-2px);
    }
    .product-card:hover .product-card-img-primary {
        transform: scale(1.03);
    }
    .product-card:hover .product-card-img-hover {
        opacity: 1 !important;
        transform: scale(1.03);
    }
    .product-card:hover .product-actions {
        transform: translateY(0) !important;
    }
}

/* Touch devices: never render the hover-only image, and remove tap delay. */
@media (hover: none), (pointer: coarse) {
    .product-card .product-card-img-hover {
        display: none;
    }
    .product-card a {
        touch-action: manipulation;
    }
}

.product-card .card-body {
    padding: 8px 12px 10px 12px !important;
}

.product-card .product-card-title {
    font-size: 0.90rem;
    font-weight: 500;
    line-height: 1.3;
}

.product-card .card-title {
    min-height: 2.3rem;
    margin-bottom: 4px !important;
}

.product-card .price-select-row {
    margin-bottom: 6px !important;
    padding-top: 5px !important;
}

.product-card .card-sale-price {
    font-size: 1.02rem;
}

.product-card .card-mrp-price {
    font-size: 0.72rem;
}

.product-card .btn-premium {
    padding: 6px 10px !important;
    font-size: 0.73rem !important;
    letter-spacing: 0.2px !important;
}

.product-card .btn-premium i {
    font-size: 0.85rem;
}

/* "Best Price ₹X with CODE" – highlighted pill with a soft shimmer sweep */
.product-card .card-best-price {
    position: relative;
    display: inline-flex !important;
    align-items: center;
    overflow: hidden;
    font-size: 0.74rem !important;
    font-weight: 700 !important;
    letter-spacing: 0.1px;
    padding: 4px 11px !important;
    border-radius: 999px !important;
    color: #1b6b3a !important;
    background: linear-gradient(90deg, #eaf6ee 0%, #f6fbf0 100%) !important;
    border: 1px dashed rgba(36, 132, 67, 0.55);
    box-shadow: 0 1px 4px rgba(36, 132, 67, 0.12);
}
.product-card .card-best-price::after {
    content: "";
    position: absolute;
    top: 0;
    left: -60%;
    width: 40%;
    height: 100%;
    background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.85), transparent);
    transform: skewX(-20deg);
    animation: rfBestPriceShine 3.2s ease-in-out infinite;
    pointer-events: none;
}
@keyframes rfBestPriceShine {
    0%, 55% { left: -60%; }
    100% { left: 140%; }
}
@media (prefers-reduced-motion: reduce) {
    .product-card .card-best-price::after { animation: none; display: none; }
}

.product-card .product-badge-row {
    min-height: 24px !important;
    padding-top: 6px !important;
    padding-left: 12px !important;
    padding-right: 12px !important;
}

/* Responsive custom compact classes for product card in mobile viewports */
@media (max-width: 767px) {
    .product-card {
        border-radius: 12px !important;
    }
    .product-card .product-card-title {
        font-size: 0.78rem !important;
        font-weight: 600 !important;
        line-height: 1.25 !important;
    }
    .product-card .card-title {
        min-height: 2rem !important;
        margin-bottom: 4px !important;
    }
    .product-card .price-select-row {
        padding-top: 4px !important;
        margin-bottom: 6px !important;
    }
    .product-card .card-sale-price {
        font-size: 0.88rem !important;
        font-weight: 700 !important;
    }
    .product-card .card-mrp-price {
        font-size: 0.68rem !important;
    }
    .product-card .btn-premium {
        font-size: 0.66rem !important;
        padding-top: 5px !important;
        padding-bottom: 5px !important;
        letter-spacing: 0.2px !important;
    }
    .product-card .btn-premium i {
        font-size: 0.76rem !important;
    }
    .product-card .card-best-price {
        font-size: 0.64rem !important;
        padding: 3px 8px !important;
    }
    .product-card .badge {
        font-size: 0.54rem !important;
    }
    .product-card .product-badge-row {
        min-height: 20px !important;
        padding-top: 4px !important;
        padding-left: 8px !important;
        padding-right: 8px !important;
    }
    .product-card .card-body {
        padding: 6px 8px 8px 8px !important;
    }
    .product-card .product-image-container {
        padding: 8px 8px 0 8px;
        border-radius: 0 !important;
    }
    .product-card .product-image-container > a {
        border-radius: 6px;
    }
    .product-card .product-image-container .product-discount-tag {
        top: 8px !important;
        left: 16px !important;
    }
}

/* On narrow devices, stack price and variant dropdown */
@media (max-width: 480px) {
    .product-card .price-select-row {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 3px !important;
    }
    .product-card .price-select-row > .w-50 {
        width: 100% !important;
    }
    /* Price block first */
    .product-card .price-select-row > .price-container {
        order: 1;
        align-items: flex-start !important;
        margin-bottom: 2px;
    }
    .product-card .price-select-row > .price-container .d-flex {
        justify-content: flex-start !important;
    }
    /* Variant select second, directly above Add to Cart */
    .product-card .price-select-row > div:not(.price-container) {
        order: 2;
    }
    .product-card .price-select-row .variant-selector {
        width: 100% !important;
        padding: 2px 5px !important;
        font-size: 0.7rem !important;
    }
}

/* Variant selector dropdown & weight badge styling */
.product-card .price-select-row .variant-selector,
.product-card .price-select-row .card-variant-badge,
.product-card .price-select-row .badge {
    background-color: #8b5a2b !important;
    color: #ffffff !important;
    border-color: #8b5a2b !important;
}

.product-card .price-select-row .variant-selector {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23ffffff' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e") !important;
    background-repeat: no-repeat !important;
    background-position: right 0.5rem center !important;
    background-size: 10px 8px !important;
    padding-right: 1.4rem !important;
}

.product-card .price-select-row .variant-selector:focus {
    border-color: #8b5a2b !important;
    box-shadow: 0 0 0 0.2rem rgba(139, 90, 43, 0.25) !important;
    color: #ffffff !important;
    background-color: #8b5a2b !important;
}

.product-card .price-select-row .variant-selector option {
    background-color: #ffffff !important;
    color: #212529 !important;
}

