/* =========================================
   ГЛОБАЛЬНІ ФІКСИ (Скроли та приховані елементи)
   ========================================= */
::-webkit-scrollbar { display: none !important; width: 0 !important; height: 0 !important; }
* { -ms-overflow-style: none !important; scrollbar-width: none !important; }

.top-spacing { height: 40px; }

.visually-hidden {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0,0,0,0) !important;
    border: 0 !important;
}

/* =========================================
   ХЛІБНІ КРИХТИ ТА ШАПКА
   ========================================= */
.product-breadcrumbs {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-bottom: 25px;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.4);
}
.product-breadcrumbs a { color: inherit; text-decoration: none; transition: 0.3s; }
.product-breadcrumbs a:hover { color: #f97316; }
.product-breadcrumbs .is-current { color: rgba(255, 255, 255, 0.8); }

.product-head { margin-bottom: 30px; }
.product-head-meta { display: flex; align-items: center; gap: 12px; margin-bottom: 15px; flex-wrap: wrap; }

.section-badge {
    background: rgba(249, 115, 22, 0.1);
    color: #f97316;
    padding: 4px 12px;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
}

.status-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    padding: 4px 12px;
    border-radius: 20px;
}
.status-chip.highlight { background: rgba(239, 68, 68, 0.1); color: #ef4444; }
.status-chip.success { color: #10b981; }
.status-chip.warning { color: #f59e0b; }

.product-page-title {
    font-size: 2.2rem;
    font-weight: 800;
    line-height: 1.2;
    margin: 0;
    color: #fff;
}

/* =========================================
   СІТКИ
   ========================================= */
.product-hero-grid {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 40px;
    align-items: start;
    margin-bottom: 40px;
}
.content-layout-grid {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 40px;
    align-items: start;
}

/* =========================================
   ГАЛЕРЕЯ (ФІКС РОЗМІРІВ ФОТО)
   ========================================= */
.product-gallery-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 24px;
    padding: 20px;
    position: relative;
}
.product-gallery-viewer {
    width: 100%;
    aspect-ratio: 1/1;
    background: #fff;
    border-radius: 16px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}
.product-gallery-main img {
    max-width: 102%;
    max-height: 90%;
    object-fit: contain;
    transition: transform 0.2s ease;
}

.product-gallery-thumbs {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    margin-top: 15px;
    padding-bottom: 5px;
    -webkit-overflow-scrolling: touch;
}

/* Жорстка фіксація розмірів мініатюр */
.product-gallery-thumb {
    width: 70px !important;
    height: 70px !important;
    flex-shrink: 0;
    border-radius: 12px;
    border: 2px solid transparent;
    background: #fff;
    padding: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    transition: 0.3s;
}
.product-gallery-thumb.is-active { border-color: #f97316; transform: scale(1.05); }
.product-gallery-thumb img { width: 100% !important; height: 100% !important; object-fit: contain !important; }

/* =========================================
   ПАНЕЛЬ КУПІВЛІ (ЦІНИ, ЗНИЖКИ, КНОПКИ)
   ========================================= */
.product-buy-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 24px;
    padding: 30px;
}

.prices {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 15px;
}
.current-price.giant { font-size: 3rem; font-weight: 900; color: #f97316; line-height: 1; }
.old-price { font-size: 1.4rem; text-decoration: line-through; color: rgba(255, 255, 255, 0.3); }

.product-badge.badge-sale {
    background: linear-gradient(135deg, #f97316 0%, #ea580c 100%);
    color: #fff;
    padding: 6px 12px;
    border-radius: 10px;
    font-weight: 800;
    font-size: 0.95rem;
    display: inline-block;
}

.stock-status-large { margin-bottom: 20px; }

.product-discount-timer-wrap {
    background: rgba(249, 115, 22, 0.05);
    border: 1px solid rgba(249, 115, 22, 0.1);
    border-radius: 12px;
    padding: 12px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}
.product-discount-timer-label { color: rgba(255, 255, 255, 0.7); font-size: 0.9rem; }
.product-discount-timer { font-family: monospace; font-size: 1.2rem; font-weight: 800; color: #f97316; }

/* МЕТА БЛОК (БРЕНД, АРТИКУЛ) */
.product-meta-grid {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 16px;
    padding: 16px 20px;
    margin-bottom: 24px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.meta-item { display: flex; justify-content: space-between; font-size: 0.95rem; }
.meta-item span { color: rgba(255, 255, 255, 0.4); }
.meta-item strong { color: #fff; font-weight: 600; text-align: right; }

/* КНОПКИ */
.btn-primary.btn-lg {
    width: 100%;
    background: #f97316;
    color: #fff;
    border: none;
    padding: 18px;
    border-radius: 16px;
    font-size: 1.1rem;
    font-weight: 800;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: 0.3s;
}
.btn-primary.btn-lg:hover { transform: translateY(-2px); box-shadow: 0 8px 25px rgba(249, 115, 22, 0.4); }

.action-row-split {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-top: 15px;
}
.btn-secondary {
    width: 100%;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #fff;
    padding: 14px;
    border-radius: 14px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: 0.3s;
}
.btn-secondary:hover { background: rgba(255, 255, 255, 0.08); border-color: #f97316; }
.btn-secondary.is-active { color: #f97316; border-color: #f97316; background: rgba(249, 115, 22, 0.05); }

.product-buy-links { display: flex; justify-content: center; flex-wrap: wrap; gap: 20px; margin-top: 20px; font-size: 0.85rem; }
.product-buy-links a { color: rgba(255, 255, 255, 0.5); text-decoration: underline; transition: 0.3s; }
.product-buy-links a:hover { color: #fff; }

.product-benefits-list {
    margin-top: 25px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding-top: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.benefit-row { display: flex; align-items: flex-start; gap: 10px; font-size: 0.9rem; color: rgba(255, 255, 255, 0.7); line-height: 1.4; }
.benefit-row svg { flex-shrink: 0; margin-top: 2px; }

/* =========================================
   НИЖНЯ ЧАСТИНА (ТЕКСТИ, ВІДГУКИ)
   ========================================= */
.product-panel {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 24px;
    padding: 30px;
    margin-bottom: 30px;
}
.panel-header { margin-bottom: 20px; }
.panel-header h2 { font-size: 1.5rem; margin: 10px 0 0 0; color: #fff; }

/* --- МАГІЯ ПЕРЕНОСІВ РЯДКІВ ТУТ --- */
.text-formatted {
    line-height: 1.8;
    color: rgba(255, 255, 255, 0.8);
    white-space: pre-wrap; /* ВАЖЛИВО: Зберігає ентери з бази даних */
    word-wrap: break-word;
    font-size: 1.05rem;
}

.specs-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 25px; }
.spec-box h3 { color: #f97316; font-size: 1.1rem; margin-bottom: 8px; }
.spec-box p { color: rgba(255, 255, 255, 0.7); margin: 0; line-height: 1.6; }

/* --- ФОРМА ВІДГУКІВ --- */
.form-group { margin-bottom: 15px; }
.form-group label { display: block; margin-bottom: 8px; color: rgba(255,255,255,0.7); font-size: 0.9rem; }

.form-control {
    width: 100%;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 15px;
    color: #fff;
    font-family: inherit;
    box-sizing: border-box;
}
.form-control:focus { outline: none; border-color: #f97316; }
textarea.form-control { resize: none !important; }

.file-upload-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    color: #fff;
    cursor: pointer;
    font-size: 0.9rem;
    transition: 0.3s;
}
.file-upload-label:hover { background: rgba(255, 255, 255, 0.1); border-color: #f97316; }

.btn-primary { background: #f97316; color: #fff; border: none; padding: 12px 24px; border-radius: 12px; font-weight: 700; cursor: pointer; transition: 0.3s; }

.comment-item { padding: 20px 0; border-bottom: 1px solid rgba(255, 255, 255, 0.05); }
.comment-head { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; margin-bottom: 10px; }
.comment-avatar { width: 40px; height: 40px; background: rgba(249, 115, 22, 0.2); color: #f97316; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: bold; flex-shrink: 0; }
.comment-meta strong { display: block; color: #fff; }
.comment-meta span { font-size: 0.8rem; color: rgba(255, 255, 255, 0.4); }

.comment-gallery { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 15px; }
.comment-gallery img { width: 80px; height: 80px; object-fit: cover; border-radius: 8px; }

.empty-state.compact { text-align: center; color: rgba(255,255,255,0.5); padding: 30px; }
.empty-state.compact svg { margin-bottom: 15px; stroke: rgba(255,255,255,0.2); }

/* =========================================
   СХОЖІ ТОВАРИ (САЙДБАР)
   ========================================= */
.sticky-panel { position: sticky; top: 20px; }

.similar-list { display: flex; flex-direction: column; gap: 15px; }
.similar-card {
    display: flex;
    align-items: center;
    gap: 15px;
    text-decoration: none;
    padding: 10px;
    border-radius: 12px;
    transition: 0.3s;
    border: 1px solid transparent;
}
.similar-card:hover { background: rgba(255, 255, 255, 0.03); border-color: rgba(249, 115, 22, 0.3); }

.similar-img {
    width: 60px;
    height: 60px;
    background: #fff;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
}
.similar-img img { max-width: 90%; max-height: 90%; object-fit: contain; }

.similar-info { display: flex; flex-direction: column; gap: 5px; }
.similar-title { color: rgba(255, 255, 255, 0.8); font-size: 0.9rem; line-height: 1.3; }
.similar-price { color: #f97316; font-weight: 700; font-size: 1rem; }

/* =========================================
   TOAST (СИСТЕМНІ ПОВІДОМЛЕННЯ)
   ========================================= */
.toast-container { position: fixed; bottom: 30px; right: 30px; z-index: 10000; display: flex; flex-direction: column; gap: 10px; }
.toast {
    background: #18181b;
    border: 1px solid #f97316;
    color: #fff;
    padding: 15px 25px;
    border-radius: 12px;
    font-size: 0.95rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    transform: translateX(120%);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}
.toast.show { transform: translateX(0); }

/* =========================================
   АДАПТАЦІЯ (МОБІЛЬНІ ПРИСТРОЇ ТА ПЛАНШЕТИ)
   ========================================= */

/* Планшети (до 992px) */
@media (max-width: 992px) {
    .product-hero-grid { grid-template-columns: 1fr; gap: 30px; }
    .content-layout-grid { grid-template-columns: 1fr; }

    .sticky-panel { position: static; }

    .similar-list {
        flex-direction: row;
        overflow-x: auto;
        padding-bottom: 10px;
        scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch;
    }
    .similar-card {
        min-width: 250px;
        scroll-snap-align: start;
        background: rgba(255, 255, 255, 0.02);
        border: 1px solid rgba(255, 255, 255, 0.05);
    }
}

/* Смартфони (до 768px) */
@media (max-width: 768px) {
    .product-page-title { font-size: 1.7rem; }
    .current-price.giant { font-size: 2.2rem; }

    .product-gallery-card { padding: 15px; }
    .product-buy-card, .product-panel { padding: 20px; }

    .action-row-split { grid-template-columns: 1fr; }
    /* ВАЖЛИВО ДЛЯ МОБІЛЬНИХ: Всі характеристики стають в одну колонку */
    .specs-grid { grid-template-columns: 1fr; gap: 20px; }

    .product-meta-grid { padding: 12px 15px; }
    .product-discount-timer-wrap { flex-direction: column; gap: 8px; text-align: center; }
    .file-upload-label { width: 100%; justify-content: center; }
    .review-form .btn-primary { width: 100%; justify-content: center; margin-top: 10px; }
}

/* Маленькі смартфони (до 480px) */
@media (max-width: 480px) {
    .product-page-title { font-size: 1.4rem; }
    .current-price.giant { font-size: 1.8rem; }
    .old-price { font-size: 1.1rem; }
    .product-gallery-thumb { width: 60px !important; height: 60px !important; }
    .btn-primary.btn-lg { font-size: 1rem; padding: 15px; }
    .product-buy-card, .product-panel { padding: 15px; }
    .comment-gallery img { width: 60px; height: 60px; }
    .similar-card { min-width: 200px; }
}
