/* =============================================================================
   INDEX / ГЛАВНАЯ СТРАНИЦА
   Требует: shared.css
   Содержит:
     1. Hero
     2. Модалка товара (если открывается с главной)
   ============================================================================= */


/* =============================================================================
   1. HERO (главный баннер)
   ============================================================================= */
.hero {
    padding: var(--hero-padding-y) 0;
    text-align: center;
    background:
            radial-gradient(ellipse at 60% 40%,
            rgba(139, 195, 74, 0.12),
            transparent 60%),
            linear-gradient(180deg,
            var(--green-500) 0%,
            var(--green-600) 40%,
            var(--green-700) 100%);
    border-bottom: 3px solid var(--green-800);
    box-shadow: var(--shadow-hero);
}

.hero__title {
    margin-bottom: 12px;
    font-family: var(--font-accent);
    font-size: var(--fs-4xl);
    font-weight: var(--fw-bold);
    color: var(--craft-200);
    line-height: var(--lh-tight);
    text-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.hero__subtitle {
    margin-bottom: 28px;
    font-size: var(--fs-lg);
    font-weight: var(--fw-regular);
    color: var(--green-100);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

/* Используется ВМЕСТЕ с .button: <a class="button hero__button"> */
.hero__button {
    margin-top: 30px;
    padding: 16px 40px;
    font-size: var(--fs-3xl);
    font-weight: var(--fw-bold);
    letter-spacing: 0.5px;
    color: #fff;
    background: linear-gradient(180deg, var(--green-200) 0%, var(--green-300) 100%);
    border: 1px solid var(--green-150);
    box-shadow: 0 6px 16px rgba(104, 159, 56, 0.3);
}

.hero__button:hover {
    background: linear-gradient(180deg, var(--green-150) 0%, var(--green-250) 100%);
    box-shadow: 0 8px 20px rgba(104, 159, 56, 0.45);
}


/* =============================================================================
   2. МОДАЛКА ТОВАРА
   ============================================================================= */
.product-modal {
    position: fixed;
    inset: 0;
    z-index: var(--z-modal);
    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;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.product-modal__content {
    position: relative;
    z-index: 1;
    width: 90%;
    max-width: 750px;
    max-height: 90vh;
    overflow-y: auto;
    background: var(--craft-50);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-card-hover);
    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;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    font-size: 18px;
    background: #fff;
    border: 1px solid var(--craft-400);
    border-radius: 50%;
    cursor: pointer;
    transition:
            background   var(--transition-fast),
            border-color var(--transition-fast),
            transform    var(--transition-fast);
}

.product-modal__close:hover {
    background: var(--status-sold-bg);
    border-color: var(--status-sold-border);
    transform: scale(1.1);
}

/* --- Тело --- */
.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;
    object-fit: cover;
    border-radius: var(--radius-sm);
}

.product-modal__info {
    display: flex;
    flex-direction: column;
    flex: 1;
    gap: 12px;
}

.product-modal__name {
    margin: 0;
    font-family: var(--font-accent);
    font-size: var(--fs-xl);
    font-weight: var(--fw-bold);
    color: var(--craft-900);
    line-height: var(--lh-tight);
}

.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: var(--text-subtle);
    text-decoration: line-through;
}

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

.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: var(--text-label);
}

/* --- Количество --- */
.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: var(--text-label);
}

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

.product-modal__qty-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    font-size: 18px;
    font-weight: var(--fw-bold);
    color: var(--green-700);
    background: #fff;
    border: 2px solid var(--green-150);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition:
            background   var(--transition-fast),
            border-color 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 {
    align-self: flex-start;
    margin-top: 4px;
}

.product-modal__description {
    margin-top: 8px;
    padding-top: 12px;
    font-size: var(--fs-base);
    color: #555;
    line-height: var(--lh-relaxed);
    border-top: 1px solid var(--craft-400);
}


/* =============================================================================
   3. АДАПТИВ
   ============================================================================= */
@media (max-width: 768px) {
    .hero__title {
        font-size: var(--fs-3xl);
    }

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

    .hero__button {
        padding: 14px 32px;
        font-size: var(--fs-2xl);
    }

    /* Модалка */
    .product-modal__body {
        flex-direction: column;
        gap: 16px;
        padding: 20px;
    }

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

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

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

@media (max-width: 600px) {

    .hero__title {
        font-size: var(--fs-xl);
        margin-bottom: 8px;
    }

    .hero__subtitle {
        font-size: var(--fs-sm);
        margin-bottom: 16px;
    }

    .hero__button {
        margin-top: 18px;
        padding: 12px 24px;
        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%;
    }
}

@media (max-width: 380px) {
    .hero__title {
        padding: 12px 14px;
        font-size: var(--fs-lg);
    }

    .hero__subtitle {
        font-size: var(--fs-xs);
    }

    /* Иначе .button из shared.css перебьёт через каскад */
    .hero__button {
        padding: 10px 18px;
        font-size: var(--fs-md);
    }
}
