/* The flash-sale deals section (includes/deals_section.php). The bar is a real
   <progress>, so its width needs no inline style. */
.deals {
    --deals-pink: #E0115F;
    --deals-magenta: #B5119B;
    --deals-green: #16A34A;
    margin-bottom: 0.75rem;
    border-radius: 12px;
    box-shadow: 0 4px 18px rgba(15, 23, 42, 0.08);
    font-family: var(--font-family-base);
}

.deals-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.5rem 1rem;
    border-radius: 12px 12px 0 0;
    background: linear-gradient(90deg, var(--deals-pink), var(--deals-magenta));
    color: var(--color-white);
}

/* Category and section pages: the solid admin colour (inline style), red by default. */
.deals-head.is-solid {
    background-image: none;
    background-color: var(--color-primary);
}

/* Any admin colour: a neutral arrow, not the home page's pink. */
.deals-head.is-solid .deals-see-all-arrow {
    color: var(--color-dark);
}

.deals-title {
    margin: 0;
    min-width: 0;
    font-family: var(--font-family-heading);
    font-size: 1.05rem;
    font-weight: 700;
    line-height: 1.25;
    color: inherit;
}

.deals-see-all {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 0.45rem;
    color: inherit;
    font-size: 0.875rem;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
}

.deals-see-all:hover,
.deals-see-all:focus {
    color: inherit;
    text-decoration: underline;
}

.deals-see-all-arrow {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.3rem;
    height: 1.3rem;
    border-radius: 50%;
    background-color: var(--color-white);
    color: var(--deals-pink);
    font-size: 0.7rem;
}

.deals-panel {
    padding: 0.75rem;
    border: 1px solid var(--color-border);
    border-top: 0;
    border-radius: 0 0 12px 12px;
    background-color: var(--color-white);
}

.deals-viewport {
    position: relative;
}

.deals-track {
    display: flex;
    gap: 0.75rem;
    margin: 0;
    padding: 0;
    list-style: none;
    overflow-x: auto;
    scroll-snap-type: x proximity;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
}

.deals-track::-webkit-scrollbar {
    display: none;
}

.deals-item {
    flex: 0 0 200px;
    min-width: 0;
    scroll-snap-align: start;
}

.deals-card {
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: 0.5rem;
    border-radius: 8px;
    color: var(--color-dark);
}

.deals-card:hover {
    box-shadow: 0 2px 12px rgba(15, 23, 42, 0.14);
}

.deals-card-image {
    position: relative;
    display: block;
    aspect-ratio: 1 / 1;
    margin-bottom: 0.5rem;
    overflow: hidden;
    border-radius: 6px;
}

.deals-card-image img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.deals-badge {
    position: absolute;
    top: 0.3rem;
    right: 0.3rem;
    z-index: 1;
    padding: 0.1rem 0.4rem;
    border-radius: 4px;
    background-color: #FDE7F1;
    color: #A80D4E;
    font-size: 0.8rem;
    font-weight: 700;
}

.deals-card-name {
    display: block;
    overflow: hidden;
    color: var(--color-dark);
    font-size: 0.875rem;
    text-decoration: none;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.deals-card-name:hover,
.deals-card-name:focus {
    color: var(--deals-pink);
}

.deals-card-price-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.25rem;
    margin-top: 0.2rem;
}

.deals-card-prices {
    min-width: 0;
}

/* The heart: the same button as the category cards, which the home page has no stylesheet for. */
.deals .cat-wishlist-btn {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border: none;
    border-radius: 50%;
    background: none;
    color: var(--color-text-muted);
    font-size: 1.15rem;
}

.deals .cat-wishlist-btn:hover,
.deals .cat-wishlist-btn.is-saved {
    color: var(--color-primary);
}

.deals .cat-wishlist-btn:focus-visible {
    outline: 2px solid var(--color-primary);
}

.deals .cat-heart-on,
.deals .cat-wishlist-btn.is-saved .cat-heart-off {
    display: none;
}

.deals .cat-wishlist-btn.is-saved .cat-heart-on {
    display: inline;
}

.deals-card-price {
    font-size: 1.05rem;
    font-weight: 700;
    line-height: 1.3;
}

.deals-card-old {
    color: var(--color-text-muted);
    font-size: 0.8rem;
}

.deals-sold-label {
    padding-top: 0.4rem;
    color: var(--color-text-muted);
    font-size: 0.75rem;
}

.deals-sold-bar {
    display: block;
    flex: 0 0 auto;
    width: 100%;
    height: 6px;
    margin-top: 0.2rem;
    overflow: hidden;
    border: 0;
    border-radius: 3px;
    background-color: var(--color-border);
    color: var(--deals-green);
    -webkit-appearance: none;
    appearance: none;
}

.deals-sold-bar::-webkit-progress-bar {
    border-radius: 3px;
    background-color: var(--color-border);
}

/* A sliver at 0%, so an unsold product reads as a nearly empty bar rather than no bar. */
.deals-sold-bar::-webkit-progress-value {
    min-width: 5px;
    border-radius: 3px;
    background-color: var(--deals-green);
}

.deals-sold-bar::-moz-progress-bar {
    min-width: 5px;
    border-radius: 3px;
    background-color: var(--deals-green);
}

.deals-cart {
    width: 100%;
    margin-top: 0.6rem;
    padding: 0.5rem;
    border: none;
    border-radius: 8px;
    background-color: var(--color-primary);
    color: var(--color-white);
    font-size: 0.9rem;
    font-weight: 600;
}

.deals-cart:hover:not(:disabled),
.deals-cart:focus-visible {
    background-color: var(--color-primary-dark);
}

.deals-cart:disabled {
    opacity: 0.75;
}

.deals-arrow {
    position: absolute;
    top: 35%;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: 1px solid var(--color-border);
    border-radius: 50%;
    background-color: var(--color-white);
    box-shadow: 0 2px 10px rgba(15, 23, 42, 0.18);
    color: var(--color-dark);
}

.deals-arrow[hidden] {
    display: none;
}

.deals-arrow:hover {
    color: var(--deals-pink);
}

.deals-arrow.is-prev { left: -4px; }
.deals-arrow.is-next { right: -4px; }

@media (max-width: 575.98px) {
    .deals-head {
        padding: 0.45rem 0.75rem;
    }

    .deals-title {
        font-size: 0.95rem;
    }

    .deals-see-all {
        gap: 0.35rem;
        font-size: 0.8rem;
    }

    /* "See all" on a phone, so a long title stays on one line and the bar stays slim. */
    .deals-see-all-more {
        display: none;
    }

    .deals-panel {
        padding: 0.5rem;
    }

    .deals-track {
        gap: 0.4rem;
    }

    /* Two and a bit cards, so the next one peeks in and invites a swipe. */
    .deals-item {
        flex-basis: 42%;
    }

    .deals-arrow {
        width: 34px;
        height: 34px;
    }
}
