/**
 * Alfa Slab — offer / status ribbon on the bottom edge of product images, and countdown.
 * The product card design itself is untouched (owner rule 2026-10-18).
 *
 * @package Alfa_Slab
 */

/* ── Promotion ribbon ─────────────────────────────────────────
 * Overlays the bottom edge of the photo, so cards with and without a
 * ribbon keep the same height.
 */
.alfa-promo-ribbon {
    --pb-bg: #1a1a1a;
    --pb-fg: #ffffff;
    --pb-accent: #c9a96e;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 6px 16px;
    background: var(--pb-bg);
    color: var(--pb-fg);
    font-family: 'Tajawal', 'Inter', sans-serif;
    font-size: 12.5px;
    line-height: 1.5;
    letter-spacing: 0.2px;
}

.alfa-promo-ribbon__label {
    display: inline-flex;
    align-items: baseline;
    gap: 7px;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.alfa-promo-ribbon__occasion {
    font-weight: 500;
    opacity: 0.88;
}

.alfa-promo-ribbon__sep {
    opacity: 0.55;
}

.alfa-promo-ribbon__offer {
    font-weight: 700;
}

/* Thin sadu-inspired line under the ribbon (National Day / Founding Day) */
.alfa-promo-ribbon--sadu::after {
    content: "";
    position: absolute;
    inset-inline: 0;
    bottom: -2px;
    height: 2px;
    background: repeating-linear-gradient(90deg, var(--pb-accent) 0 6px, transparent 6px 9px);
    opacity: 0.9;
}

.alfa-promo-ribbon--large {
    display: inline-flex;
    padding: 8px 18px;
    border-radius: 4px;
    font-size: 14px;
    gap: 16px;
}

.alfa-promo-ribbon--large.alfa-promo-ribbon--sadu::after {
    border-radius: 0 0 4px 4px;
}

/* Fixed height on cards so the offsets below stay exact. */
.alfa-product-card-image > .alfa-promo-ribbon,
.alfa-slab-image-wrap > .alfa-promo-ribbon,
ul.products li.product a img + .alfa-promo-ribbon {
    box-sizing: border-box;
    min-height: 30px;
    padding-block: 0;
}

/* Stone cards and slab cards: on the image, flush to its bottom edge. */
.alfa-product-card-image > .alfa-promo-ribbon,
.alfa-slab-image-wrap > .alfa-promo-ribbon {
    position: absolute;
    inset-inline: 0;
    bottom: 0;
    z-index: 2;
}

/* The image clips overflow, so the sadu line goes inside the ribbon. */
.alfa-product-card-image > .alfa-promo-ribbon--sadu::after,
.alfa-slab-image-wrap > .alfa-promo-ribbon--sadu::after {
    bottom: 0;
}

/* Availability pill sits above the ribbon. */
.alfa-product-card-image:has(> .alfa-promo-ribbon) .alfa-product-badge-available,
.alfa-product-card-image:has(> .alfa-promo-ribbon) .alfa-product-badge-sold {
    bottom: 42px;
}

/* WooCommerce loop: pulled up over the image's bottom margin (shop 22px,
   homepage [products] 20px), so the title does not move. */
ul.products li.product a img + .alfa-promo-ribbon {
    z-index: 2;
    margin: -52px 0 22px;
}

.alfa-products .woocommerce ul.products li.product a img + .alfa-promo-ribbon {
    margin: -50px 0 20px;
}

/* ── Countdown ────────────────────────────────────────────────── */
.alfa-countdown {
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.alfa-countdown--compact,
.alfa-countdown--full {
    font-size: 11.5px;
    font-weight: 500;
    opacity: 0.8;
}

.alfa-promo-ribbon--large .alfa-countdown--full {
    font-size: 13px;
}

/* Status ribbon (no offer): new arrival / last slabs / out of stock */
.alfa-promo-ribbon--status {
    --pb-bg: #1a1a1a;
    --pb-fg: #ffffff;
    --pb-accent: #c9a96e;
}

.alfa-promo-ribbon--status .alfa-promo-ribbon__offer {
    color: var(--pb-accent);
}

.alfa-promo-ribbon--sold {
    --pb-bg: #8a8a8a;
    --pb-fg: #ffffff;
}

/* ── Promotion landing banner ─────────────────────────────────── */
.alfa-promo-banner {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    margin: 0 0 28px;
}

.alfa-promo-banner__title {
    margin: 0;
    font-family: 'Tajawal', 'Inter', sans-serif;
    font-size: 22px;
    font-weight: 700;
    color: #1a1a1a;
}

/* ── Single product page ──────────────────────────────────────── */
.alfa-single-flags {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    margin: 16px 0 4px;
}

/* ── Catalog: search-only header (theme prints the title) ─────── */
.alfa-catalog-header.alfa-catalog-header--search-only {
    justify-content: flex-start;
    margin-bottom: 20px;
}

/* ── Catalog: colour chips (same look as the category tabs) ───── */
/* Desktop: the row wraps inside the container. Phones: one scrolling row. */
.alfa-color-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 20px;
    padding-bottom: 4px;
    max-width: 100%;
}

.alfa-color-chips::-webkit-scrollbar {
    display: none;
}

.alfa-color-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 20px;
    border: 1.5px solid var(--alfa-border);
    border-radius: 50px;
    background: var(--alfa-surface);
    font-family: inherit;
    font-size: 14px;
    font-weight: 500;
    color: var(--alfa-text-muted);
    cursor: pointer;
    transition: all var(--alfa-duration) var(--alfa-ease);
    white-space: nowrap;
    flex: 0 0 auto;
}

.alfa-color-chip:hover {
    border-color: var(--alfa-gold);
    color: var(--alfa-gold-dark);
}

.alfa-color-chip.active {
    background: var(--alfa-dark);
    border-color: var(--alfa-dark);
    color: #fff;
}

.alfa-color-chip__swatch {
    flex: 0 0 auto;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.15);
}

.alfa-color-chip.active .alfa-color-chip__swatch {
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.45);
}

/* ── Catalog: results count + sort ────────────────────────────── */
.alfa-results-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px 16px;
}

.alfa-sort-select {
    min-width: 150px;
    padding: 8px 14px;
    padding-inline-end: 36px;
    border: 1.5px solid var(--alfa-border);
    border-radius: var(--alfa-radius-sm);
    background: var(--alfa-surface);
    font-family: inherit;
    font-size: 13px;
    color: var(--alfa-text);
    cursor: pointer;
    transition: all var(--alfa-duration) var(--alfa-ease);
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%237a7a7a' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: left 12px center;
    outline: none;
}

[dir="ltr"] .alfa-sort-select {
    background-position: right 12px center;
}

.alfa-sort-select:focus {
    border-color: var(--alfa-gold);
    box-shadow: 0 0 0 3px rgba(201, 169, 110, 0.15);
}

.alfa-sort-select:hover {
    border-color: var(--alfa-gold-light);
}

@media (max-width: 768px) {
    .alfa-color-chips {
        flex-wrap: nowrap;
        overflow-x: auto;
        -ms-overflow-style: none;
        scrollbar-width: none;
        scroll-behavior: smooth;
    }
}

@media (max-width: 600px) {
    .alfa-promo-ribbon {
        padding: 5px 12px;
        font-size: 11.5px;
    }

    .alfa-countdown--compact {
        font-size: 10.5px;
    }

}

@media (max-width: 480px) {
    .alfa-color-chips {
        gap: 6px;
    }

    .alfa-color-chip {
        padding: 6px 14px;
        font-size: 13px;
    }
}
