/* =============================================
   МОДАЛКА ТОВАРА
   ============================================= */

.product-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--transition-base), visibility var(--transition-base);
}

.product-modal.active {
    opacity: 1;
    visibility: visible;
}

/* Оверлей */
.product-modal__overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

/* Контент */
.product-modal__content {
    position: relative;
    background: var(--craft-50);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-card-hover);
    max-width: 750px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    z-index: 1;
    transform: translateY(20px);
    transition: transform var(--transition-base);
}

.product-modal.active .product-modal__content {
    transform: translateY(0);
}

/* Крестик */
.product-modal__close {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 36px;
    height: 36px;
    background: white;
    border: 1px solid var(--craft-400);
    border-radius: 50%;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
    transition: var(--transition-fast);
}

.product-modal__close:hover {
    background: #fbe9e7;
    border-color: #ef9a9a;
    transform: scale(1.1);
}

/* Body: картинка + инфо */
.product-modal__body {
    display: flex;
    gap: 24px;
    padding: 28px;
}

/* Картинка */
.product-modal__image-wrapper {
    flex-shrink: 0;
    width: 280px;
}

.product-modal__image {
    width: 100%;
    height: auto;
    border-radius: var(--radius-sm);
    object-fit: cover;
}

/* Инфо */
.product-modal__info {
    display: flex;
    flex-direction: column;
    gap: 12px;
    flex: 1;
}

/* Название */
.product-modal__name {
    font-family: var(--font-accent);
    font-size: var(--fs-xl);
    font-weight: var(--fw-bold);
    color: var(--craft-900);
    line-height: var(--lh-tight);
    margin: 0;
}

/* Цены */
.product-modal__prices {
    display: flex;
    align-items: baseline;
    gap: 10px;
}

.product-modal__price {
    font-size: var(--fs-2xl);
    font-weight: var(--fw-bold);
    color: var(--green-800);
}

.product-modal__price-old {
    font-size: var(--fs-base);
    color: #999;
    text-decoration: line-through;
}

/* Бейдж */
.product-modal__badge {
    display: inline-block;
    padding: 4px 12px;
    font-size: var(--fs-xs);
    font-weight: var(--fw-bold);
    border-radius: var(--radius-status);
    border: 1px solid;
    align-self: flex-start;
}

/* Объём */
.product-modal__volume {
    display: flex;
    gap: 8px;
    font-size: var(--fs-base);
    color: var(--craft-900);
}

.product-modal__volume-label {
    font-weight: var(--fw-semibold);
    color: #686868;
}

/* Количество */
.product-modal__quantity {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 8px 0;
}

.product-modal__quantity-label {
    font-size: var(--fs-base);
    font-weight: var(--fw-semibold);
    color: #686868;
}

.product-modal__quantity-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}

.product-modal__qty-btn {
    width: 32px;
    height: 32px;
    border: 2px solid var(--green-150);
    background: white;
    color: var(--green-700);
    border-radius: var(--radius-sm);
    font-size: 18px;
    font-weight: var(--fw-bold);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-fast);
}

.product-modal__qty-btn:hover {
    background: var(--green-50);
    border-color: var(--green-300);
}

.product-modal__qty-value {
    min-width: 30px;
    text-align: center;
    font-size: var(--fs-md);
    font-weight: var(--fw-semibold);
}

/* Кнопка в корзину */
.product-modal__cart-btn {
    margin-top: 4px;
    align-self: flex-start;
}

/* Описание */
.product-modal__description {
    font-size: var(--fs-base);
    color: #555;
    line-height: var(--lh-relaxed);
    margin-top: 8px;
    padding-top: 12px;
    border-top: 1px solid var(--craft-400);
}

/* =============================================
   АДАПТИВ МОДАЛКИ
   ============================================= */
@media (max-width: 768px) {
    .product-modal__body {
        flex-direction: column;
        padding: 20px;
        gap: 16px;
    }

    .product-modal__image-wrapper {
        width: 100%;
    }

    .product-modal__image {
        max-height: 250px;
        width: 100%;
        object-fit: cover;
    }

    .product-modal__name {
        font-size: var(--fs-lg);
    }
}

@media (max-width: 480px) {
    .product-modal__content {
        width: 95%;
        max-height: 95vh;
    }

    .product-modal__body {
        padding: 16px;
        gap: 12px;
    }

    .product-modal__name {
        font-size: var(--fs-md);
    }

    .product-modal__price {
        font-size: var(--fs-xl);
    }

    .product-modal__close {
        top: 10px;
        right: 10px;
        width: 30px;
        height: 30px;
        font-size: 14px;
    }

    .product-modal__cart-btn {
        width: 100%;
    }
}