.page-products {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: #fff;
}

.page-products .nav {
    padding: 0 1.4rem;
    height: 120px;
}
.page-products .site-header {
    height: 120px;
}
.page-products .nav__toggle-bar {
    background: var(--orange);
}

.page-products .nav__menu {
    color: #f0b27a;
    font-weight: 500;
}

.page-products .nav__menu a:hover {
    color: var(--orange);
    opacity: 1;
}

.page-products .nav__cart {
    background: transparent;
    color: var(--orange);
    border: 1.6px solid var(--orange);
    box-shadow: none;
    border-radius: 8px;
    position: relative;
}

.page-products .nav__cart-count {
    position: absolute;
    top: -8px;
    right: -8px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 999px;
    background: var(--orange);
    color: #fff;
    font-size: 0.68rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.page-products .nav__cart-count[hidden] {
    display: none;
}

.catalog {
    flex: 1;
    width: 100%;
    max-width: 1080px;
    margin: 0 auto;
    padding: 0.4rem 1.4rem 3.4rem;
}

.catalog h1 {
    margin: 0 0 1.8rem;
    text-align: center;
    color: var(--orange);
    font-size: clamp(1.9rem, 4vw, 2.55rem);
    font-weight: 700;
}

.catalog__grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1.8rem 1.5rem;
    justify-items: center;
}

.product-card {
    --card: #EE7D04;
    width: 100%;
    max-width: 280px;
    border: 1.5px solid var(--card);
    border-radius: 18px;
    padding: 0.7rem 0.7rem 1rem;
    background: #fff;
    display: flex;
    flex-direction: column;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.product-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.08);
}

.product-card[data-color="purple"] {
    --card: #6d3fa3;
}

.product-card[data-color="brown"] {
    --card: #6d4333;
}

.product-card[data-color="red"] {
    --card: #e23a3a;
}

.product-card__photo {
    border-radius: 12px;
    overflow: hidden;
    aspect-ratio: 1 / 1;
    background: #f4f4f4;
}

.product-card[data-color="orange"] .product-card__photo {
    background: #EE7D04;
}

.product-card[data-color="orange"] .product-card__photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 62%;
    transform: scale(1.18);
    transform-origin: center 58%;
}

.product-card__photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.product-card h2 {
    margin: 0.85rem 0 0;
    color: var(--card);
    font-size: clamp(1.55rem, 2.4vw, 2.05rem);
    font-weight: 500;
    line-height: 1.05;
    letter-spacing: -0.03em;
}

.product-card p {
    margin: 0.15rem 0 0.85rem;
    color: #222;
    font-size: 1.02rem;
    font-weight: 500;
}

.product-card__row {
    margin-top: auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.6rem;
}

.product-card__price {
    font-size: 1.12rem;
    font-weight: 700;
}

.product-card__btn {
    appearance: none;
    border: 0;
    background: var(--card);
    color: #fff;
    font-family: inherit;
    font-size: 0.78rem;
    font-weight: 600;
    padding: 0.48rem 0.7rem;
    border-radius: 6px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.15rem;
    white-space: nowrap;
    transition: transform 0.15s ease, filter 0.15s ease;
}

.product-card__btn:hover {
    filter: brightness(1.05);
    transform: translateY(-1px);
}

.product-card__btn.is-added {
    filter: brightness(0.92);
}

@media (max-width: 980px) {
    .catalog__grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 760px) {
    .page-products .nav__menu {
        color: var(--text);
    }

    .page-products .nav__cart {
        color: var(--orange);
        justify-content: center;
    }

    .catalog {
        padding: 0.2rem 1rem 2.4rem;
    }
}

@media (max-width: 560px) {
    .catalog__grid {
        grid-template-columns: 1fr;
    }

    .product-card {
        max-width: 340px;
    }
}

body.product-modal-open {
    overflow: hidden;
}

.product-modal {
    --modal: #EE7D04;
    --modal-soft: #fff4e8;
    position: fixed;
    inset: 0;
    z-index: 200;
    display: none;
    place-items: center;
    padding: 1.2rem;
    background: rgba(28, 22, 32, 0.58);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    pointer-events: none;
}

.product-modal[data-color="purple"] {
    --modal: #6d3fa3;
    --modal-soft: #f4edfb;
}

.product-modal[data-color="brown"] {
    --modal: #6d4333;
    --modal-soft: #f6efe9;
}

.product-modal[data-color="red"] {
    --modal: #e23a3a;
    --modal-soft: #fdeeee;
}

.product-modal.is-open {
    display: grid;
    pointer-events: auto;
}

.product-modal[hidden] {
    display: none !important;
    pointer-events: none !important;
}

.product-modal__dialog {
    width: min(780px, 100%);
    background: #fff;
    border-radius: 32px;
    padding: 1.15rem 1.55rem 1.35rem;
    box-shadow:
        0 0 0 1px color-mix(in srgb, var(--modal) 12%, transparent),
        0 28px 70px rgba(20, 12, 28, 0.28);
    animation: productModalIn 0.32s ease;
}

@keyframes productModalIn {
    from {
        opacity: 0;
        transform: translateY(18px) scale(0.97);
    }
    to {
        opacity: 1;
        transform: none;
    }
}

.product-modal__back {
    border: 0;
    background: var(--modal-soft);
    color: var(--modal);
    font-family: inherit;
    font-size: 0.98rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.42rem 0.85rem 0.42rem 0.65rem;
    border-radius: 999px;
    margin-bottom: 1.05rem;
    transition: transform 0.15s ease, filter 0.15s ease;
}

.product-modal__back:hover {
    filter: brightness(0.97);
    transform: translateX(-2px);
}

.product-modal__body {
    display: grid;
    grid-template-columns: 240px 1fr;
    gap: 1.7rem;
    align-items: center;
}

.product-modal__photo {
    width: 100%;
    aspect-ratio: 1 / 1;
    border-radius: 22px;
    overflow: hidden;
    background: color-mix(in srgb, var(--modal) 16%, #f7f7f7);
    box-shadow: 0 16px 36px color-mix(in srgb, var(--modal) 26%, transparent);
}

.product-modal[data-color="orange"] .product-modal__photo {
    background: #EE7D04;
}

.product-modal__photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.product-modal[data-color="orange"] .product-modal__photo img {
    object-position: center 62%;
    transform: scale(1.18);
    transform-origin: center 58%;
}

.product-modal__copy {
    min-width: 0;
}

.product-modal__title {
    margin: 0 0 0.35rem;
    color: var(--modal);
    font-size: clamp(2.35rem, 4.2vw, 3.15rem);
    font-weight: 600;
    letter-spacing: -0.04em;
    line-height: 1;
}

.product-modal__tagline,
.product-modal__text {
    margin: 0;
    background: none;
    box-shadow: none;
    text-shadow: none;
}

.product-modal__tagline {
    margin-bottom: 0.85rem;
    color: #3a3a3a;
    font-size: 1.08rem;
    font-weight: 600;
    line-height: 1.35;
}

.product-modal__text {
    color: #5a5a5a;
    font-size: 0.98rem;
    font-weight: 400;
    line-height: 1.55;
}

.product-modal__flavors {
    margin-top: 1.05rem;
}

.product-modal__flavors-label {
    margin: 0 0 0.55rem;
    color: #1a1a1a;
    font-size: 0.92rem;
    font-weight: 700;
}

.product-modal__flavor-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.product-modal__flavor {
    appearance: none;
    border: 1.5px solid #eadfd8;
    background: #fff;
    color: #333;
    font-family: inherit;
    font-size: 0.88rem;
    font-weight: 600;
    padding: 0.48rem 0.9rem;
    border-radius: 999px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.product-modal__flavor::before {
    content: "";
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #ccc;
}

.product-modal__flavor[data-flavor-tone="fresa"]::before {
    background: #e35d7a;
}

.product-modal__flavor[data-flavor-tone="vainilla"]::before {
    background: #e4c77b;
}

.product-modal__flavor[data-flavor-tone="chocolate"]::before {
    background: #6b3e2a;
}

.product-modal__flavor:hover {
    border-color: var(--modal);
}

.product-modal__flavor.is-selected {
    border-color: var(--modal);
    background: var(--modal-soft);
    color: var(--modal);
}

.product-modal__footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 1.35rem;
    padding-top: 1.15rem;
    border-top: 1px solid #f0e9e2;
}

.product-modal__price {
    margin: 0;
    font-size: clamp(1.9rem, 3vw, 2.45rem);
    font-weight: 600;
    color: #1a1a1a;
    letter-spacing: -0.03em;
}

.product-modal__add {
    appearance: none;
    border: 0;
    background: var(--modal);
    color: #fff;
    font-family: inherit;
    font-size: 1.02rem;
    font-weight: 600;
    padding: 0.88rem 1.45rem;
    border-radius: 14px;
    cursor: pointer;
    box-shadow: 0 10px 22px color-mix(in srgb, var(--modal) 32%, transparent);
    transition: transform 0.15s ease, filter 0.15s ease;
}

.product-modal__add:hover {
    filter: brightness(1.06);
    transform: translateY(-1px);
}

.product-modal__add:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
    filter: none;
}

@media (max-width: 720px) {
    .product-modal {
        padding: 0.55rem;
        align-items: end;
    }

    .product-modal__dialog {
        padding: 1rem 1.05rem 1.15rem;
        border-radius: 24px;
        animation-name: productModalInMobile;
    }

    @keyframes productModalInMobile {
        from {
            opacity: 0;
            transform: translateY(28px);
        }
        to {
            opacity: 1;
            transform: none;
        }
    }

    .product-modal__body {
        grid-template-columns: 1fr;
        justify-items: center;
        text-align: center;
        gap: 1rem;
    }

    .product-modal__photo {
        max-width: 220px;
    }

    .product-modal__footer {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
    }

    .product-modal__flavor-list {
        justify-content: center;
    }

    .product-modal__add {
        width: 100%;
    }
}

@media (prefers-reduced-motion: reduce) {
    .product-modal__dialog,
    .product-modal__back,
    .product-modal__add {
        animation: none;
        transition: none;
    }
}
