/*--------------------------------------------------------------
# Section Featured Products
--------------------------------------------------------------*/
.products-section {
    padding: var(--spacing-xl) 0;
    background-color: transparent;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: var(--spacing-xl);
}

.header-content {
    text-align: left;
}

.header-actions {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: var(--spacing-lg);
}

/* Hide desktop View All on mobile by default */
.btn-view-all-desktop {
    display: none;
}

@media (min-width: 992px) {
    .btn-view-all-desktop {
        display: flex;
    }

    .header-actions {
        flex-direction: column;
        align-items: flex-end;
        gap: var(--spacing-sm);
    }
}

.section-header .section-title {
    font-size: var(--font-size-4xl);
    font-weight: var(--font-weight-extrabold);
    color: var(--viro-secondary-color);
    margin-bottom: var(--spacing-xs);
}

.section-subtitle {
    color: var(--color-grey);
    font-size: var(--font-size-normal);
    font-weight: var(--font-weight-medium);
}

.btn-view-all {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-xs);
    padding: var(--spacing-xs) var(--spacing-sm);
    border: 1px solid var(--viro-primary-color);
    color: var(--viro-primary-color);
    border-radius: var(--radius-sm);
    font-weight: var(--font-weight-semibold);
    font-size: var(--font-size-sm);
    transition: all var(--transition-fast);
    text-decoration: none;
    background-color: transparent;
}

.btn-view-all:hover {
    background-color: var(--viro-primary-color);
    color: var(--color-white) !important;
}

.btn-view-all:hover i,
.btn-view-all:hover svg {
    color: var(--color-white) !important;
    stroke: var(--color-white) !important;
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--spacing-sm);
}

.product-card {
    position: relative;
    background-color: var(--color-white);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    overflow: hidden;
    transition: transform var(--transition-normal), box-shadow var(--transition-normal);
    display: flex;
    flex-direction: column;
    font-family: var(--font-family);
    width: 100%;
    height: 100%;
}


.stretched-link::after {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 1;
    content: "";
}

.product-title a {
    color: inherit;
    text-decoration: none;
}

.product-title a:hover {
    color: var(--viro-primary-color);
}

.product-image-wrapper {
    position: relative;
    height: 240px;
    overflow: hidden;
    background-color: transparent;
}

.product-image-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition-normal);
}

.product-card:hover .product-image-wrapper img {
    transform: scale(1.1);
}

.badge-discount,
.badge-new {
    position: absolute;
    top: var(--spacing-sm);
    left: var(--spacing-sm);
    padding: var(--spacing-xs) var(--spacing-sm);
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-extrabold);
    color: var(--color-white);
    border-radius: var(--radius-sm);
    z-index: 2;
    text-transform: uppercase;
    box-shadow: var(--shadow-sm);
}

.badge-discount {
    background-color: var(--accent-red);
}

.badge-new {
    background-color: var(--viro-primary-color);
}

.product-card.has-badge-new {
    border: var(--border-width-2) solid var(--viro-primary-color);
}

.product-info {
    padding: var(--spacing-md);
    flex: 1;
    display: flex;
    flex-direction: column;
}

.product-category {
    font-size: var(--font-size-xs);
    color: var(--viro-primary-color);
    margin-bottom: var(--spacing-xs);
    text-transform: uppercase;
    font-weight: var(--font-weight-bold);
}

.product-title {
    font-size: var(--font-size-lg);
    font-weight: var(--font-weight-bold);
    color: var(--viro-secondary-color);
    margin-bottom: var(--spacing-xs);
    line-height: var(--line-height-tight);
}

.product-meta {
    font-size: var(--font-size-xs);
    color: var(--color-grey);
    margin-bottom: var(--spacing-md);
}

/* Price styling */
.product-price {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    margin-bottom: var(--spacing-md);
    flex-wrap: wrap;
    text-decoration: none !important;
    min-height: 50px;
}

.product-price *,
.current-price,
.old-price {
    text-decoration: none !important;
    border: none !important;
    box-shadow: none !important;
}

/* Common style for current price */
.current-price,
.product-price .amount {
    font-size: var(--font-size-lg);
    font-weight: var(--font-weight-extrabold);
    white-space: nowrap;
}

/* If NO sale (Regular price) -> Primary Color */
.current-price,
.product-price .amount {
    color: var(--viro-primary-color);
}

/* If ON sale (Promo price) -> Red Color */
.product-price ins,
.product-price ins *,
ins.current-price,
ins.current-price * {
    color: var(--accent-red) !important;
    text-decoration: none !important;
}

/* Old price (Regular price before sale) -> Grey */
.old-price,
.product-price del,
.product-price del * {
    font-size: var(--font-size-xs);
    color: var(--color-grey) !important;
    text-decoration: line-through !important;
    font-weight: var(--font-weight-semibold);
    opacity: 0.7;
}

.product-price del {
    margin-right: var(--spacing-xs);
}

/* Highlight border for specific products (e.g. Featured) */
.product-card.is-featured-product {
    border: 1.5px solid var(--viro-primary-color) !important;
}

.product-rating {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: var(--spacing-sm);
}

.product-rating .stars {
    display: flex;
    gap: 2px;
}

.product-rating svg,
.product-rating i {
    width: 14px;
    height: 14px;
}

.star-filled {
    color: var(--color-warning);
    fill: var(--color-warning);
}

.star-half {
    color: var(--color-warning);
    fill: var(--color-warning);
}

.rating-count {
    font-size: var(--font-size-xs);
    color: var(--color-grey);
    font-weight: var(--font-weight-semibold);
}

.product-actions {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    width: 100%;
    margin-top: auto;
    position: relative;
    z-index: 2;
}

/* Wishlist button — default style (inline in actions bar) */
.btn-wishlist {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: var(--avatar-size-md);
    height: var(--avatar-size-md);
    border: var(--border-width) solid var(--color-border);
    border-radius: var(--radius-sm);
    color: var(--color-grey);
    background: var(--color-white);
    box-shadow: none;
    transition: all var(--transition-fast);
    cursor: pointer;
    position: relative;
    z-index: 2;
}

/* Wishlist button — absolute top-right (only when inside image wrapper) */
.product-image-wrapper .btn-wishlist {
    position: absolute;
    top: var(--spacing-sm);
    right: var(--spacing-sm);
    z-index: 3;
    width: 38px;
    height: 38px;
    border: var(--border-width) solid var(--color-border-lighter);
    border-radius: var(--radius-full) !important;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(4px);
    box-shadow: var(--shadow-sm);
}

.btn-wishlist:hover,
.btn-wishlist.active {
    transform: scale(1.12);
    background-color: var(--accent-red) !important;
    color: var(--color-white) !important;
    border-color: var(--accent-red) !important;
    box-shadow: 0 4px 12px rgba(245, 81, 87, 0.35);
}

.btn-wishlist:hover svg.lucide,
.btn-wishlist:hover i,
.btn-wishlist.active svg.lucide,
.btn-wishlist.active i {
    stroke: var(--color-white) !important;
    fill: var(--color-white) !important;
}

/* Adjust Add to Cart width dynamically */
.product-actions .btn-add-cart {
    width: 100%;
}

/* If wishlist button is present in actions, adjust add-to-cart width */
.product-actions:has(.btn-wishlist) .btn-add-cart {
    width: calc(100% - 54px);
}

.btn-add-cart {
    width: 100%;
    height: var(--avatar-size-md);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-xs);
    background-color: var(--color-white);
    border: var(--border-width) solid var(--color-border);
    color: var(--viro-secondary-color);
    font-weight: var(--font-weight-bold);
    font-size: var(--font-size-sm);
    font-family: var(--font-family);
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
    padding: 0 var(--spacing-sm);
    cursor: pointer;
    text-decoration: none;
}

.btn-add-cart i,
.btn-add-cart svg {
    stroke: currentColor;
    width: var(--icon-size-md);
    height: var(--icon-size-md);
}

.btn-add-cart:hover {
    background-color: var(--viro-primary-color);
    border-color: var(--viro-primary-color);
    color: var(--color-white);
    transform: translateY(-3px);
    box-shadow: 0 8px 15px rgba(98, 208, 182, 0.3);
}

.btn-add-cart:hover i,
.btn-add-cart:hover svg {
    stroke: currentColor;
    transform: translateX(3px);
}

.btn-add-cart i,
.btn-add-cart svg,
.btn-add-cart span {
    transition: color var(--transition-fast), stroke var(--transition-fast), transform var(--transition-fast) ease;
}

/* ── Loading state (spinner while WC adds item) ── */
.btn-add-cart.loading {
    pointer-events: none;
    opacity: 0.85;
    background-color: var(--viro-primary-color) !important;
    border-color: var(--viro-primary-color) !important;
    color: var(--color-white) !important;
}

.btn-add-cart.loading svg,
.btn-add-cart.loading i {
    display: none;
}

.btn-add-cart.loading span::before {
    content: '';
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.4);
    border-top-color: var(--color-white);
    border-radius: 50%;
    animation: viro-spin 0.7s linear infinite;
    margin-right: 8px;
    vertical-align: middle;
}

@keyframes viro-spin {
    to {
        transform: rotate(360deg);
    }
}

/* ── View Cart state (after item is added) ── */
.btn-add-cart.btn-view-cart-active {
    background-color: var(--viro-secondary-color) !important;
    border-color: var(--viro-secondary-color) !important;
    color: var(--color-white) !important;
    text-decoration: none;
}

.btn-add-cart.btn-view-cart-active i,
.btn-add-cart.btn-view-cart-active svg {
    stroke: var(--color-white) !important;
}

.btn-add-cart.btn-view-cart-active:hover {
    background-color: var(--viro-primary-color) !important;
    border-color: var(--viro-primary-color) !important;
    box-shadow: 0 8px 20px rgba(98, 208, 182, 0.45);
}

/* Responsive adjustments */
@media (max-width: 1200px) {
    .products-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 992px) {
    .header-content {
        width: 100%;
    }

    .products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--spacing-sm);
    }

    .product-info {
        padding: var(--spacing-sm);
    }

    .product-image-wrapper {
        height: 180px;
    }

    .btn-add-cart {
        padding: 10px;
        font-size: 0.75rem;
    }
}

@media (max-width: 576px) {
    .product-image-wrapper {
        height: 160px;
    }
}

@media (max-width: 476px) {
    .products-grid {
        grid-template-columns: 1fr;
        gap: var(--spacing-lg);
    }

    .product-image-wrapper {
        height: 220px;
    }

    .btn-add-cart span {
        display: block;
    }
}

/* ── Overrides for bold currency & 100% button width ── */
.woocommerce-Price-currencySymbol {
    font-weight: inherit !important;
}

.product-actions {
    width: 100% !important;
    display: flex !important;
}

.btn-add-cart {
    width: 100% !important;
    flex: 1 1 100% !important;
    display: flex !important;
    justify-content: center !important;
    box-sizing: border-box !important;
}

/* Override any rules adjusting add-to-cart width when wishlist button is present inside actions */
.product-actions:has(.btn-wishlist) .btn-add-cart,
.product-actions:has(.add-to-wishlist-btn) .btn-add-cart {
    width: 100% !important;
    flex: 1 1 100% !important;
}