/**
 * Страница товара (product.php) — светлый фон
 */

.page-product .catalog-main__content {
    padding-top: 0.5rem;
}

/* Хлебные крошки */
.product-breadcrumb {
    font-family: var(--font-heading);
    font-size: 0.9rem;
    margin-bottom: 1.25rem;
    color: var(--cream-dark, #6b6560);
    letter-spacing: 0.02em;
}

.product-breadcrumb a {
    color: var(--charcoal, #2a2825);
}

.product-breadcrumb a:hover {
    color: var(--gold-dark);
    text-decoration: underline;
}

.product-breadcrumb ol {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
}
.product-breadcrumb li {
    display: inline-flex;
    align-items: center;
}
.product-breadcrumb__sep {
    margin: 0 0.4rem;
    opacity: 0.7;
}

/* Карточка товара */
.product-detail {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
    max-width: 920px;
    margin: 0 auto;
    padding: 1.5rem;
}

@media (min-width: 640px) {
    .product-detail {
        grid-template-columns: 1fr 1fr;
        gap: 2.25rem;
        padding: 2.25rem;
    }
}

/* В каталоге — квадрат (catalog.css). На карточке товара — постер сверху, галерея отдельно ниже */
.product-detail__poster {
    aspect-ratio: 4/3;
    background: linear-gradient(145deg, #d5cdc4 0%, var(--beige-dark) 100%);
    border-radius: 10px;
    overflow: hidden;
    display: flex;
    align-items: stretch;
    justify-content: stretch;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.08);
}

.product-detail__gallery-wrap {
    display: flex;
    width: 100%;
    height: 100%;
    gap: 0;
}

.product-detail__thumbs {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 0.5rem;
    background: rgba(0, 0, 0, 0.06);
    border-right: 1px solid rgba(0, 0, 0, 0.08);
}

.product-detail__thumb {
    position: relative;
    width: 56px;
    min-height: 56px;
    padding: 0;
    border: 2px solid transparent;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: border-color 0.2s, background 0.2s;
}

.product-detail__thumb:hover {
    background: rgba(255, 255, 255, 0.8);
}

.product-detail__thumb--active {
    border-color: var(--gold);
    background: #fff;
}

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

.product-detail__thumb-num {
    position: absolute;
    top: 2px;
    right: 2px;
    font-size: 0.7rem;
    font-weight: 700;
    color: #2a2520;
    background: rgba(255, 255, 255, 0.9);
    width: 1.1rem;
    height: 1.1rem;
    border-radius: 3px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.product-detail__main {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 0;
}

.product-detail__poster-trigger,
.product-detail__gallery-trigger {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    padding: 0;
    border: none;
    background: none;
    cursor: zoom-in;
    position: relative;
}

.product-detail__poster-img,
.product-detail__img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    flex: 1;
}

.product-detail__zoom-hint {
    position: absolute;
    bottom: 0.5rem;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.75rem;
    color: #555;
    background: rgba(255, 255, 255, 0.9);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    white-space: nowrap;
    opacity: 0.9;
}

.product-detail__zoom-hint-icon {
    margin-right: 0.2rem;
}

/* Галерея — отдельная строка ниже постера и инфо, превью в ряд */
.product-detail__gallery-block {
    grid-column: 1 / -1;
    margin-top: 0.5rem;
    padding: 1rem 0 0;
    border-top: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 0;
    background: transparent;
    border-left: none;
    border-right: none;
    border-bottom: none;
}
.product-detail__gallery-title {
    font-family: var(--font-heading);
    font-size: 0.95rem;
    font-weight: 700;
    color: #2a2520;
    margin: 0 0 0.25rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.product-detail__gallery-hint {
    font-size: 0.8rem;
    color: #555;
    margin: 0 0 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.35rem;
}
.product-detail__gallery-hint-icon {
    opacity: 0.85;
}
.product-detail__gallery-thumbs {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 0.75rem;
    justify-content: flex-start;
}
.product-detail__gallery-thumb {
    width: 128px;
    height: 128px;
    padding: 0;
    border: none;
    border-radius: 10px;
    background: #fff;
    cursor: zoom-in;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: box-shadow 0.2s, transform 0.2s;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}
.product-detail__gallery-thumb:hover {
    box-shadow: 0 4px 12px rgba(201, 169, 98, 0.25);
    transform: scale(1.04);
}
.product-detail__gallery-thumb-inner {
    position: relative;
    width: 100%;
    height: 100%;
    display: block;
}
.product-detail__gallery-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.product-detail__gallery-thumb-zoom {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.35);
    opacity: 0;
    transition: opacity 0.2s;
}
.product-detail__gallery-thumb:hover .product-detail__gallery-thumb-zoom {
    opacity: 1;
}
.product-detail__gallery-thumb-zoom-icon {
    font-size: 1.5rem;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.3));
}

.product-detail__placeholder {
    font-family: var(--font-body);
    font-size: 1.25rem;
    color: #666;
}

.product-detail__info {
    color: #2a2520;
    display: flex;
    flex-direction: column;
}

.product-detail__title {
    font-family: var(--font-heading);
    font-size: 1.6rem;
    font-weight: 700;
    margin: 0 0 0.35rem;
    line-height: 1.25;
    letter-spacing: -0.01em;
}

.product-detail__category {
    margin: 0 0 0.75rem;
    font-size: 0.95rem;
}

.product-detail__category a {
    color: var(--gold-dark);
}

.product-detail__category a:hover {
    text-decoration: underline;
}

.product-detail__price {
    font-family: var(--font-heading);
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--gold-dark);
    margin: 0.5rem 0 0.75rem;
    letter-spacing: 0.02em;
}

.product-detail__stock {
    font-family: var(--font-heading);
    font-size: 0.95rem;
    font-weight: 600;
    margin: 0.5rem 0;
}

.product-detail__stock--yes {
    color: #2d6a2d;
}

.product-detail__stock--no {
    color: var(--gold-dark);
}

.product-detail__description {
    margin: 1rem 0 0;
    font-size: 1rem;
    line-height: 1.65;
    flex: 1;
}

.product-detail__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: center;
    margin-top: 1.5rem;
    padding-top: 1.25rem;
    border-top: 1px solid rgba(196, 184, 168, 0.5);
}

.product-detail__actions .btn--red {
    padding: 0.75rem 1.6rem;
    font-size: 1rem;
}

.product-detail__actions .btn--outline {
    padding: 0.65rem 1.4rem;
}

/* Подписка на уведомление о появлении товара (нет в наличии) */
.product-notify {
    width: 100%;
    max-width: 360px;
    padding: 1rem 0 0;
}
.product-notify__lead {
    font-size: 0.95rem;
    color: #444;
    margin: 0 0 0.75rem;
    font-weight: 500;
}
.product-notify__form {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}
.product-notify__input {
    flex: 1;
    min-width: 160px;
    padding: 0.55rem 0.75rem;
    font-size: 1rem;
    border: 1px solid rgba(0, 0, 0, 0.15);
    border-radius: 6px;
    background: #fff;
    color: #2a2520;
}
.product-notify__input:focus {
    outline: none;
    border-color: var(--gold);
    box-shadow: 0 0 0 2px rgba(201, 169, 98, 0.2);
}
.product-notify__btn {
    padding: 0.55rem 1.1rem;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--black);
    background: linear-gradient(135deg, var(--gold) 0%, var(--gold-dark) 100%);
    border: none;
    border-radius: 6px;
    cursor: pointer;
    white-space: nowrap;
    transition: opacity 0.2s, box-shadow 0.2s;
}
.product-notify__btn:hover {
    opacity: 0.95;
    box-shadow: 0 2px 8px rgba(201, 169, 98, 0.35);
}
.product-notify__error {
    margin: 0.5rem 0 0;
    font-size: 0.9rem;
    color: var(--gold-dark);
}
.product-notify--success {
    margin: 0;
    padding: 0.75rem 1rem;
    font-size: 0.95rem;
    color: #2d6a2d;
    background: rgba(45, 106, 45, 0.1);
    border-radius: 8px;
    border: 1px solid rgba(45, 106, 45, 0.3);
}

/* Анимация загрузки при нажатии «В корзину» */
.product-add-cart-btn {
    position: relative;
    transition: opacity 0.2s;
}
.product-add-cart-btn.is-loading {
    pointer-events: none;
    opacity: 0.85;
}
.product-add-cart-btn.is-loading .product-add-cart-btn__text {
    visibility: hidden;
}
.product-add-cart-btn.is-loading .product-add-cart-btn__spinner {
    display: block;
}
.product-add-cart-btn__spinner {
    display: none;
    position: absolute;
    left: 50%;
    top: 50%;
    margin: -0.6em 0 0 -0.6em;
    width: 1.2em;
    height: 1.2em;
    border: 2px solid rgba(0,0,0,0.15);
    border-top-color: var(--charcoal, #2a2825);
    border-radius: 50%;
    animation: product-cart-spin 0.6s linear infinite;
}
@keyframes product-cart-spin {
    to { transform: rotate(360deg); }
}

/* Заголовки блоков */
.page-product .product-related__title,
.page-product .product-reviews .product-related__title {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--charcoal, #2a2825);
    margin: 0 0 1rem;
}
