/* ==========================================================
   PRODUCT CATALOG
========================================================== */

.products {
    --product-card-min-width: 320px;
    --product-card-max-width: 420px;
    --product-grid-gap: 24px;
}


/* ==========================================================
   CATALOG HEADING AND FILTERS
========================================================== */

.product-catalog-controls {
    box-sizing: border-box;
    width: calc(100% - 48px);
    margin: 0 auto 32px;
    text-align: center;
}

.product-catalog-controls__title {
    margin: 0 0 24px;
    color: var(--color-text);
    font-family: var(--font-heading);
    font-size: clamp(1.8rem, 3vw, 2.6rem);
    font-weight: 700;
    line-height: 1.2;
}


/* ==========================================================
   CATEGORY BUTTON GROUP
========================================================== */

.product-filters {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 10px;
}


/* ==========================================================
   CATEGORY BUTTON
========================================================== */

.product-filters .product-filter {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;

    box-sizing: border-box;
    min-height: 44px;
    max-width: 100%;
    padding: 10px 16px;

    border: 1px solid var(--color-border);
    border-radius: 999px;

    background: var(--color-surface);
    color: var(--color-text);

    font-family: var(--font-body);
    font-size: .9rem;
    font-weight: 600;
    line-height: 1.4;
    text-align: center;

    cursor: pointer;

    transition:
        background-color var(--transition-fast),
        border-color var(--transition-fast),
        color var(--transition-fast);
}

.product-filters .product-filter:hover {
    border-color: var(--color-primary);
    color: var(--color-primary);
}

.product-filters .product-filter.is-active {
    border-color: var(--color-primary);
    background: var(--color-primary);
    color: var(--color-text-light);
}

.product-filters .product-filter:focus-visible {
    outline: 3px solid var(--color-primary);
    outline-offset: 3px;
}

.product-filter__label {
    min-width: 0;
    overflow-wrap: anywhere;
}

.product-filter__count {
    display: inline-flex;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;

    box-sizing: border-box;
    min-width: 24px;
    min-height: 24px;
    padding: 2px 6px;

    border-radius: 999px;
    background: rgba(53, 41, 31, .08);
    color: inherit;

    font-size: .75rem;
    font-weight: 700;
    line-height: 1.2;
}

.product-filter.is-active .product-filter__count {
    background: rgba(255, 255, 255, .2);
}


/* ==========================================================
   FILTER RESULT COUNT
========================================================== */

.product-filters__status {
    margin: 16px 0 0;
    color: var(--color-text);
    font-size: .85rem;
    line-height: 1.5;
    opacity: .7;
}


/* ==========================================================
   PRODUCT GRID
========================================================== */

.products .products-grid {
    display: grid;

    grid-template-columns:
        repeat(
            auto-fit,
            minmax(
                min(100%, var(--product-card-min-width)),
                var(--product-card-max-width)
            )
        );

    justify-content: center;
    align-items: stretch;
    gap: var(--product-grid-gap);

    box-sizing: border-box;
    width: calc(100% - 48px);
    margin-inline: auto;
}


/* ==========================================================
   CARD WIDTH
========================================================== */

.products .product-card {
    box-sizing: border-box;
    width: 100%;
    max-width: var(--product-card-max-width);
    min-width: 0;
}

.products .product-card[hidden] {
    display: none !important;
}


/* ==========================================================
   PRODUCT IMAGE
========================================================== */

.products .product-card .card__image {
    position: relative;
    flex-shrink: 0;

    width: 100%;
    height: auto;
    aspect-ratio: 4 / 3;

    overflow: hidden;
    background: var(--color-background);
}

.products .product-card .card__image > img {
    position: absolute;
    inset: 0;

    display: block;
    width: 100%;
    height: 100%;

    object-fit: contain;
    object-position: center;
    transform: none;
}

.products .product-card:hover .card__image > img {
    transform: none;
}


/* ==========================================================
   PRODUCT BADGE CONTAINER
========================================================== */

.products .product-card__badges {
    position: absolute;
    top: 12px;
    right: 12px;
    left: 12px;
    z-index: 2;

    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 8px;

    pointer-events: none;
}


/* ==========================================================
   NEW PRODUCT BADGE
========================================================== */

.products .product-card .product-card__badges .card__badge {
    position: static;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    box-sizing: border-box;
    min-height: 34px;
    max-width: 100%;
    padding: 7px 13px;

    border: 1px solid rgba(255, 255, 255, .25);
    border-radius: 999px;

    background: var(--color-primary);
    color: var(--color-text-light);

    font-family: var(--font-body);
    font-size: .7rem;
    font-weight: 700;
    letter-spacing: .04em;
    line-height: 1.3;
    text-transform: uppercase;
    overflow-wrap: anywhere;

    box-shadow: 0 3px 10px rgba(53, 41, 31, .14);
}


/* ==========================================================
   SEASONAL BADGES
========================================================== */

.products .product-season-badge {
    --season-background: linear-gradient(135deg, #fff8ec, #f3e6cf);
    --season-color: #604723;
    --season-border: #d9c29a;
    --season-icon-color: #876129;
    --season-icon: none;

    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;

    box-sizing: border-box;
    min-height: 34px;
    max-width: 100%;
    padding: 7px 13px 7px 10px;

    border: 1px solid var(--season-border);
    border-radius: 999px;

    background: var(--season-background);
    color: var(--season-color);

    font-family: var(--font-body);
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .01em;
    line-height: 1.35;
    text-transform: none;
    overflow-wrap: anywhere;

    box-shadow:
        0 3px 10px rgba(53, 41, 31, .12),
        inset 0 1px 0 rgba(255, 255, 255, .25);
}

/*
 * Dekoratívne SVG ikony.
 * Názov sezóny zostáva v pôvodnom HTML štítku.
 */

.products .product-season-badge::before {
    content: "";

    display: block;
    flex: 0 0 19px;

    width: 19px;
    height: 19px;

    background-color: var(--season-icon-color);

    -webkit-mask-image: var(--season-icon);
    mask-image: var(--season-icon);

    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;

    -webkit-mask-position: center;
    mask-position: center;

    -webkit-mask-size: contain;
    mask-size: contain;
}


/* ==========================================================
   CHRISTMAS — GREEN AND GOLD / TREE
========================================================== */

.products .product-season-badge--christmas {
    --season-background: linear-gradient(135deg, #173e31, #2b6049);
    --season-color: #fff7df;
    --season-border: #bca465;
    --season-icon-color: #f2d58c;

    --season-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 1 7 7h3l-5 6h4l-6 7h7v3h4v-3h7l-6-7h4l-5-6h3z'/%3E%3C/svg%3E");
}


/* ==========================================================
   EASTER — MINT / DECORATED EGG
========================================================== */

.products .product-season-badge--easter {
    --season-background: linear-gradient(135deg, #f4fae9, #dcecd1);
    --season-color: #34552e;
    --season-border: #b9cfa5;
    --season-icon-color: #598347;

    --season-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 14c0 5-3.6 8-8 8s-8-3-8-8S8.2 2 12 2s8 7 8 12Z'/%3E%3Cpath d='m5 12 3 2 4-3 4 3 3-2M5 17h14'/%3E%3C/svg%3E");
}


/* ==========================================================
   HALLOWEEN — ORANGE / PUMPKIN
========================================================== */

.products .product-season-badge--halloween {
    --season-background: linear-gradient(135deg, #fff0d8, #ffc77f);
    --season-color: #64320e;
    --season-border: #e4a357;
    --season-icon-color: #a84d13;

    --season-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 7V5c0-2 2-3 3-3M12 7C7 3 2 8 2 14s5 10 10 7c5 3 10-1 10-7S17 3 12 7Z'/%3E%3Cpath d='m7 11-1 3h3Zm10 0-2 3h3ZM8 17l2 2 2-1 2 1 2-2'/%3E%3C/svg%3E");
}


/* ==========================================================
   VALENTINE'S DAY — BURGUNDY / HEART
========================================================== */

.products .product-season-badge--valentines-day {
    --season-background: linear-gradient(135deg, #7e2943, #a83d59);
    --season-color: #fff4f6;
    --season-border: #c77a8f;
    --season-icon-color: #ffd3df;

    --season-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 21 3.4 12.6a5.8 5.8 0 0 1 8.2-8.2l.4.4.4-.4a5.8 5.8 0 0 1 8.2 8.2Z'/%3E%3C/svg%3E");
}


/* ==========================================================
   MOTHER'S DAY — ROSE / FLOWER
========================================================== */

.products .product-season-badge--mothers-day {
    --season-background: linear-gradient(135deg, #fff2f5, #f2d5e1);
    --season-color: #743a54;
    --season-border: #dcb1c4;
    --season-icon-color: #aa567a;

    --season-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 5c-4-6-9 0-5 4-7 0-6 8 0 7-4 5 3 9 5 3 2 6 9 2 5-3 6 1 7-7 0-7 4-4-1-10-5-4Z'/%3E%3Ccircle cx='12' cy='12' r='3'/%3E%3C/svg%3E");
}


/* ==========================================================
   FATHER'S DAY — BLUE / BOW TIE
========================================================== */

.products .product-season-badge--fathers-day {
    --season-background: linear-gradient(135deg, #eef4fb, #d5e3f1);
    --season-color: #2b4967;
    --season-border: #abc2d8;
    --season-icon-color: #416a91;

    --season-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linejoin='round'%3E%3Cpath d='M10 10 2 5v14l8-5m4-4 8-5v14l-8-5'/%3E%3Crect x='9' y='9' width='6' height='6' rx='1.5'/%3E%3C/svg%3E");
}


/* ==========================================================
   TEXT CONTENT
========================================================== */

.products .product-card .card__content {
    min-width: 0;
}

.products .product-card .card__title,
.products .product-card .card__description {
    overflow-wrap: anywhere;
}


/* ==========================================================
   CONFIGURATION TOTAL PRICE
========================================================== */

#productModalConfigurationPrice {
    box-sizing: border-box;
    width: 100%;
    min-width: 0;

    margin: 18px 0 16px;
    padding: 16px 18px;

    border: 1px solid #dfc7a6;
    border-left: 4px solid var(--color-primary, #922f32);
    border-radius: 12px;

    background: linear-gradient(135deg, #fffaf2, #f3e8d8);
    color: #71302d;

    font-family: var(--font-body);
    font-size: clamp(1rem, 1.2vw, 1.2rem);
    font-weight: 700;
    line-height: 1.5;

    text-align: left;
    overflow-wrap: anywhere;

    box-shadow: 0 3px 12px rgba(77, 52, 26, .05);
}

#productModalPrice[hidden],
#productModalConfigurationPrice[hidden] {
    display: none !important;
}


/* ==========================================================
   MOBILE
========================================================== */

@media (max-width: 600px) {

    .products {
        --product-grid-gap: 20px;
    }

    .product-catalog-controls {
        width: calc(100% - 32px);
        margin-bottom: 24px;
    }

    .product-catalog-controls__title {
        margin-bottom: 18px;
    }

    .product-filters {
        flex-wrap: nowrap;
        justify-content: flex-start;
        gap: 8px;
        padding: 6px 4px;

        overflow-x: auto;
        overscroll-behavior-x: contain;
        scrollbar-width: thin;
    }

    .product-filters .product-filter {
        flex-shrink: 0;
        padding: 10px 14px;
        font-size: .85rem;
    }

    .product-filter__label {
        white-space: nowrap;
    }

    .products .products-grid {
        width: calc(100% - 32px);
    }

    .products .product-card__badges {
        top: 10px;
        right: 10px;
        left: 10px;
        gap: 6px;
    }

    .products .product-season-badge {
        min-height: 31px;
        gap: 6px;
        padding: 6px 10px 6px 8px;
        font-size: .68rem;
    }

    .products .product-season-badge::before {
        flex-basis: 17px;
        width: 17px;
        height: 17px;
    }

    .products .product-card .product-card__badges .card__badge {
        min-height: 31px;
        padding: 6px 11px;
        font-size: .68rem;
    }

    #productModalConfigurationPrice {
        margin-top: 16px;
        padding: 14px;
        font-size: 1rem;
    }

}


/* ==========================================================
   REDUCED MOTION
========================================================== */

@media (prefers-reduced-motion: reduce) {

    .product-filters .product-filter {
        transition: none;
    }

}