﻿/* ================================================================
   barefoot_comfort.kz — product.css (Premium Redesign)
   ================================================================ */

/* ---- Хлебные крошки ---- */
.breadcrumb {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: .3rem;
    padding: 1rem 0;
    font-size: .8rem;
    color: var(--muted);
}
.breadcrumb a             { color: var(--muted); transition: color var(--tr); }
.breadcrumb a:hover       { color: var(--accent-dk); }
.breadcrumb-sep           { color: var(--border); user-select: none; }
.breadcrumb-current       { color: var(--text); font-weight: 600; }

/* ================================================================
   LAYOUT
   ================================================================ */
.product-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    align-items: start;
    padding: 1.25rem 0 4.5rem;
}

/* ================================================================
   ГАЛЕРЕЯ
   ================================================================ */
.product-gallery {
    position: sticky;
    top: 84px;
}

/* ---- Обёртка: миниатюры слева + фото справа ---- */
.product-gallery-wrapper {
    display: flex;
    flex-direction: row;
    gap: 14px;
    align-items: flex-start;
}

/* Вертикальные миниатюры слева */
.product-thumbnails {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 110px;
    flex-shrink: 0;
    max-height: 600px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #d5d0c8 transparent;
}
.product-thumbnails::-webkit-scrollbar { width: 3px; }
.product-thumbnails::-webkit-scrollbar-track { background: transparent; }
.product-thumbnails::-webkit-scrollbar-thumb { background: #d5d0c8; border-radius: 3px; }

/* Главное фото справа */
.product-main-image {
    flex: 1;
    background: #f4f5f5;
    padding: 10px;
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    height: 600px;
    cursor: zoom-in;
}
.product-main-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    mix-blend-mode: darken;
    transition: opacity .3s ease;
    display: block;
}
.product-main-image:hover img { opacity: .92; }

/* Бейджи поверх главного фото */
.pg-badges {
    position: absolute;
    top: 15px;
    left: 15px;
    display: flex;
    flex-direction: column;
    gap: 5px;
    z-index: 4;
    pointer-events: none;
}

/* Placeholder */
.product-gallery-placeholder {
    width: 100%; height: 100%;
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    gap: .6rem; color: #c0bbb4;
}
.product-gallery-placeholder span { font-size: .84rem; }

/* Миниатюры (вертикальные) */
.product-thumb {
    flex-shrink: 0;
    width: 110px;
    height: 110px;
    border-radius: 8px;
    overflow: hidden;
    border: 2px solid #e5e5e5;
    cursor: pointer;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: border-color .2s, transform .15s;
    padding: 0;
    box-sizing: border-box;
}
.product-thumb:hover  { border-color: #aaa; transform: translateX(2px); }
.product-thumb.active {
    border: 2px solid #111;
}
.product-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* ================================================================
   ИНФОРМАЦИЯ
   ================================================================ */
.product-info {
    display: flex;
    flex-direction: column;
    gap: 1.1rem;
}

.product-info-top {
    display: flex;
    flex-direction: column;
    gap: .35rem;
}

.product-category {
    font-size: .7rem;
    font-weight: 700;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--muted);
}

.product-title {
    font-size: clamp(1.4rem, 2.8vw, 1.9rem);
    font-weight: 800;
    color: #1a1a1a;
    line-height: 1.15;
    letter-spacing: -.02em;
}

.product-price-block {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: .5rem 10px;
    margin-top: .15rem;
}
.product-price-cur  {
    font-size: 1.7rem;
    font-weight: 800;
    color: #1a1a1a;
    letter-spacing: -.03em;
}
.product-price-old  {
    font-size: .95rem;
    color: #b0a898;
    text-decoration: line-through;
    font-weight: 400;
}
.product-price-disc {
    font-size: .8rem;
    font-weight: 700;
    color: #e63946;
    background: #fdecea;
    padding: 2px 7px;
    border-radius: 5px;
}

/* Статус */
.product-status {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    padding: .28rem .75rem;
    border-radius: 50px;
    font-size: .75rem;
    font-weight: 700;
    align-self: flex-start;
}
.status-in-stock { background: #dcfce7; color: #15803d; }
.status-on-order { background: var(--accent-lt); color: var(--accent-dk); }
.status-out      { background: #f1f5f9; color: #94a3b8; }

/* Разделитель */
.product-divider {
    border: none;
    border-top: 1px solid #f0ece6;
    margin: 0;
}

/* Описание */
.product-description {
    font-size: .9rem;
    line-height: 1.75;
    color: #666;
    max-width: none;
}

/* Характеристики */
.product-specs { display: grid; gap: 8px; }
.product-spec {
    display: grid;
    grid-template-columns: 150px 1fr;
    align-items: baseline;
    gap: 12px;
    font-size: .84rem;
}
.product-spec-key { color: #999; font-weight: 400; }
.product-spec-val { color: #1a1a1a; font-weight: 600; }
@media (max-width: 600px) {
    .product-spec { grid-template-columns: 1fr; gap: 2px; }
    .product-spec-key { font-size: .76rem; }
}

/* ================================================================
   ЦВЕТА
   ================================================================ */
.product-colors-block {
    display: flex;
    flex-direction: column;
    gap: .55rem;
}
.product-colors-label {
    font-size: .82rem;
    font-weight: 600;
    color: #1a1a1a;
    max-width: none;
}
.product-colors-label strong { font-weight: 700; }
.product-colors-row {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
}
.color-swatch {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid transparent;
    outline: 2px solid transparent;
    outline-offset: 2px;
    cursor: pointer;
    transition: transform .2s, outline-color .2s;
    flex-shrink: 0;
    padding: 0;
    box-shadow: 0 1px 4px rgba(0,0,0,.18);
}
.color-swatch:hover { transform: scale(1.14); }
.color-swatch--active {
    outline-color: #1a1a1a;
    transform: scale(1.08);
}

/* Группа товаров — свотчи с фото */
.group-swatches-row {
    display: flex;
    flex-wrap: wrap;
    gap: .6rem;
}
.group-swatch {
    width: 64px;
    height: 64px;
    border-radius: 10px;
    overflow: hidden;
    border: 2px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f4f2ef;
    text-decoration: none;
    transition: border-color .2s, transform .2s, box-shadow .2s;
    flex-shrink: 0;
}
.group-swatch img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.group-swatch:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,.12);
}
.group-swatch--active {
    border-color: #1a1a1a;
    border-width: 2.5px;
    box-shadow: 0 2px 8px rgba(0,0,0,.15);
}

/* ================================================================
   РАЗМЕРЫ
   ================================================================ */
.sizes-label-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: .55rem;
}
.sizes-label {
    font-size: .82rem;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0;
}
.sizes-na {
    font-weight: 400;
    color: var(--muted);
    font-size: .78rem;
}
/* Текстовая ссылка "Таблица размеров" */
.size-table-link {
    background: none;
    border: none;
    padding: 0;
    font-size: .78rem;
    font-weight: 600;
    color: #888;
    cursor: pointer;
    text-decoration: underline;
    text-decoration-style: dotted;
    text-underline-offset: 3px;
    transition: color .2s;
    white-space: nowrap;
}
.size-table-link:hover { color: #1a1a1a; }

.sizes-grid {
    display: flex;
    flex-wrap: wrap;
    gap: .45rem;
}
.size-btn {
    min-width: 44px;
    height: 40px;
    padding: 0 .65rem;
    border-radius: 8px;
    border: 1.5px solid #e5e5e3;
    background: #fafaf8;
    font-size: .86rem;
    font-weight: 700;
    color: #1a1a1a;
    cursor: pointer;
    transition: border-color .2s, background .2s, transform .2s, box-shadow .2s;
    display: flex;
    align-items: center;
    justify-content: center;
}
.size-btn:hover:not(.unavailable):not(.selected) {
    border-color: #b0a898;
    background: #f5f3ef;
    transform: translateY(-1px);
}
.size-btn.selected {
    border-color: #1a1a1a;
    background: #1a1a1a;
    color: #fff;
    box-shadow: 0 4px 12px rgba(26,26,26,.2);
}
.size-btn.unavailable {
    opacity: .28;
    text-decoration: line-through;
    cursor: not-allowed;
    pointer-events: none;
}

/* Уведомление "выберите размер" */
.size-alert {
    display: none;
    align-items: center;
    gap: .5rem;
    padding: .55rem .85rem;
    background: #fff7ed;
    border: 1px solid #fed7aa;
    border-radius: 8px;
    font-size: .8rem;
    color: #9a3412;
    font-weight: 600;
    margin-top: .55rem;
    animation: shake .4s ease;
}
.size-alert.visible { display: flex; }
@keyframes shake {
    0%,100% { transform: translateX(0); }
    25%      { transform: translateX(-5px); }
    75%      { transform: translateX(5px); }
}

/* ================================================================
   КНОПКИ ЗАКАЗА
   ================================================================ */
.product-order {
    display: flex;
    flex-direction: column;
    gap: .6rem;
}
.product-order-row {
    display: flex;
    gap: 10px;
    align-items: stretch;
}

/* "В корзину" — чёрный, основной */
.prd-btn-cart {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 48px;
    border-radius: 12px;
    background: #1a1a1a;
    color: #fff;
    font-size: .93rem;
    font-weight: 700;
    border: none;
    cursor: pointer;
    transition: background .2s, transform .15s;
    letter-spacing: -.01em;
}
.prd-btn-cart:hover {
    background: #2d2d2d;
    transform: translateY(-1px);
}
.prd-btn-cart:active { transform: scale(.98); }

/* WhatsApp — зелёный круг */
.prd-btn-wa {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #25d366;
    color: #fff;
    text-decoration: none;
    transition: background .2s, transform .2s;
    box-shadow: 0 3px 12px rgba(37,211,102,.35);
}
.prd-btn-wa:hover {
    background: #1db954;
    transform: scale(1.08);
    color: #fff;
}

.product-order-note {
    font-size: .76rem;
    color: #999;
    text-align: left;
    max-width: none;
    line-height: 1.55;
}

/* ================================================================
   ПОХОЖИЕ ТОВАРЫ
   ================================================================ */
.related-section {
    padding: 3.5rem 0 5rem;
    background: #faf9f7;
    border-top: 1px solid #f0ece6;
}

/* ================================================================
   ТОВАР НЕ НАЙДЕН
   ================================================================ */
.product-not-found { padding: 6rem 0; text-align: center; }
.product-not-found-icon { font-size: 4rem; margin-bottom: 1.25rem; line-height: 1; }
.product-not-found h2   { margin-bottom: .6rem; }
.product-not-found p    { margin-bottom: 2rem; }
.product-not-found-actions { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }

/* ================================================================
   МОДАЛЬНОЕ ОКНО ТАБЛИЦЫ РАЗМЕРОВ
   ================================================================ */
.size-modal-overlay {
    position: fixed; inset: 0;
    background: rgba(0,0,0,.45);
    z-index: 9000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.25rem;
    animation: overlayFadeIn .2s ease;
}
.size-modal-overlay[hidden] { display: none; }
@keyframes overlayFadeIn { from { opacity: 0; } to { opacity: 1; } }
.size-modal {
    background: #fff;
    border-radius: 20px;
    width: 100%;
    max-width: 560px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--sh-lg);
    animation: modalSlideIn .25s ease;
}
@keyframes modalSlideIn {
    from { opacity: 0; transform: translateY(20px) scale(.97); }
    to   { opacity: 1; transform: none; }
}
.size-modal-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 1.3rem 1.5rem 1rem;
    border-bottom: 1px solid #f0ece6;
}
.size-modal-header h3 { font-size: 1.1rem; font-weight: 800; color: #1a1a1a; }
.size-modal-close {
    background: none; border: none; cursor: pointer;
    font-size: 1.1rem; color: #999;
    width: 32px; height: 32px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    transition: background .2s, color .2s;
}
.size-modal-close:hover { background: #f5f3ef; color: #1a1a1a; }
.size-modal-body {
    padding: 1.25rem 1.5rem 1.5rem;
    display: flex; flex-direction: column; gap: 1.25rem;
}
.size-modal-note {
    font-size: .82rem; color: var(--muted); line-height: 1.65;
    background: var(--accent-lt); border-radius: 8px;
    padding: .75rem 1rem; border-left: 3px solid var(--accent);
    max-width: none;
}
.size-table-wrap { overflow-x: auto; }
.size-table { width: 100%; border-collapse: collapse; font-size: .88rem; }
.size-table th, .size-table td {
    padding: .6rem .85rem; text-align: left;
    border-bottom: 1px solid #f0ece6;
}
.size-table th {
    font-size: .7rem; font-weight: 700; letter-spacing: .06em;
    text-transform: uppercase; color: #999; background: #faf9f7;
}
.size-table td:first-child { font-weight: 800; color: #1a1a1a; font-size: .97rem; }
.size-table tbody tr:hover { background: #faf7f0; }
.size-table tbody tr:last-child td { border-bottom: none; }
.size-modal-footer {
    border-top: 1px solid #f0ece6; padding-top: 1.25rem;
    display: flex; flex-direction: column; gap: .75rem; align-items: flex-start;
}
.size-modal-footer p { font-size: .84rem; color: #999; max-width: none; }
.size-modal-tabs {
    display: flex; gap: .5rem; margin-bottom: 1.25rem;
    border-bottom: 2px solid #f0ece6; padding-bottom: 0;
}
.size-tab-btn {
    background: none; border: none; border-bottom: 2px solid transparent;
    margin-bottom: -2px; padding: .5rem 1.25rem;
    font-size: .95rem; font-weight: 600; color: #999; cursor: pointer;
    transition: color .2s, border-color .2s;
}
.size-tab-btn:hover { color: #1a1a1a; }
.size-tab-btn.active { color: var(--accent-dk, #BF9C55); border-bottom-color: var(--accent-dk, #BF9C55); }

/* ================================================================
   АДАПТИВ
   ================================================================ */
@media (max-width: 900px) {
    .product-layout { grid-template-columns: 1fr; gap: 1.5rem; max-width: 100%; overflow: hidden; }
    .product-gallery { position: static; overflow: hidden; max-width: 100%; }
    .product-info { max-width: 100%; overflow: hidden; }
    .product-gallery-wrapper { flex-direction: column; gap: 10px; }
    .product-thumbnails {
        flex-direction: row;
        width: 100%;
        max-height: none;
        overflow-x: auto;
        overflow-y: visible;
    }
    .product-main-image { height: auto; aspect-ratio: 1/1; width: 100%; box-sizing: border-box; }
    .product-main-image img { transform: none !important; width: 100%; height: 100%; }
}
@media (max-width: 500px) {
    .product-main-image { height: auto; aspect-ratio: 1/1; border-radius: 10px; padding: 6px; }
    .product-main-image img { transform: none; }
    .product-main-image:hover img { transform: none; }
    .product-thumbnails { gap: 6px; }
    .product-thumb { width: 72px; height: 72px; flex-shrink: 0; }
    .prd-btn-cart { height: 44px; font-size: .88rem; }
    .prd-btn-wa { width: 44px; height: 44px; }
}