/* ============================================
   PRODUCT DETAIL PAGE – FULL CSS WITH SLIDER BUTTONS
   ============================================ */

/* ---------- GLOBAL RESET & BASE ---------- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background: linear-gradient(135deg, #f9fafc 0%, #ffffff 100%);
    color: #1e2f3c;
    font-family: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.5;
}

/* ---------- PRODUCT CONTAINER (LAYOUT) ---------- */
.product-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    max-width: 1400px;
    margin: 120px auto 4rem;
    padding: 0 2rem;
    align-items: start;
}

@media (max-width: 900px) {
    .product-container {
        grid-template-columns: 1fr;
        gap: 2rem;
        margin-top: 100px;
    }
}

/* ---------- IMAGE SLIDER SECTION ---------- */
.slider-wrapper {
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
}

.slider-nav {
    display: none;
}

.main-image-container {
    position: relative;   /* обязательно для абсолютного позиционирования кнопок */
    width: 100%;
    overflow: hidden;
    border-radius: 28px;
    background: #f8fafc;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.04);
    border: 1px solid #eef2f6;
    max-height: 550px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.slide-wrapper {
    display: flex;
    width: 100%;
    transition: transform 0.3s ease-in-out;
}

.slide-wrapper img {
    flex: 0 0 100%;
    width: 100%;
    max-height: 550px;
    object-fit: contain;
    display: block;
}

/* ---------- SLIDER BUTTONS (new styles) ---------- */
.slider-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(0, 0, 0, 0.08);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.25s ease;
    color: #1e2f3c;
    z-index: 10;
    padding: 0;
}

.slider-btn:hover {
    background: #fff;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.18);
    color: #2c6280;
    border-color: #2c6280;
}

.slider-btn:active {
    transform: translateY(-50%) scale(0.94);
}

.slider-prev {
    left: 12px;
}

.slider-next {
    right: 12px;
}

/* ---------- THUMBNAILS ---------- */
.thumbnail-container {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
    justify-content: center;
}

.thumbnail {
    width: 70px;
    height: 70px;
    object-fit: cover;
    cursor: pointer;
    border: 2px solid transparent;
    border-radius: 16px;
    transition: all 0.2s ease;
    min-width: 44px;
    min-height: 44px;
}

.thumbnail:hover {
    transform: translateY(-3px);
    border-color: #2c6280;
}

.thumbnail.active {
    border-color: #1e4a8f;
    box-shadow: 0 0 0 2px rgba(30, 74, 143, 0.3);
}

/* ---------- PRODUCT INFO CARD ---------- */
.product-info {
    background: #ffffff;
    border-radius: 32px;
    padding: 2rem;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.03);
    border: 1px solid #eef2f6;
    transition: all 0.3s ease;
    overflow-x: hidden;
    word-wrap: break-word;
}

.product-info:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 35px -12px rgba(44, 98, 128, 0.15);
    border-color: #2c6280;
}

.brand-name {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: #4b6f8c;
    margin-bottom: 0.5rem;
    word-wrap: break-word;
}

.bag-name {
    font-size: 1.5rem;
    color: #0e2a3a;
    margin: 0.5rem 0;
    word-wrap: break-word;
}

.product-info h4 {
    font-size: 1rem;
    font-weight: 500;
    color: #2c6280;
    margin: 0.5rem 0;
    word-wrap: break-word;
}

/* ---------- ENHANCED SPECIFICATIONS GRID ---------- */
.specs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 1rem;
    margin: 1.5rem 0;
    padding: 0.5rem 0;
}

.spec-card {
    background: linear-gradient(135deg, #f8fafc 0%, #ffffff 100%);
    border-radius: 28px;
    padding: 0.75rem 1rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: all 0.25s ease;
    border: 1px solid #eef2f6;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.02);
}

.spec-card:hover {
    transform: translateY(-3px);
    border-color: #2c6280;
    box-shadow: 0 8px 18px rgba(44, 98, 128, 0.1);
    background: linear-gradient(135deg, #ffffff 0%, #f0f4fa 100%);
}

.spec-icon {
    font-size: 1.8rem;
    line-height: 1;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.1));
    transition: transform 0.2s;
}

.spec-card:hover .spec-icon {
    transform: scale(1.05);
}

.spec-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.spec-label {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #4b6f8c;
}

.spec-value {
    font-size: 1.1rem;
    font-weight: 600;
    color: #0e2a3a;
    background: rgba(255,255,255,0.6);
    padding: 0.2rem 0.5rem;
    border-radius: 20px;
    display: inline-block;
    width: fit-content;
    line-height: 1.3;
}

/* ---------- TEXT DESCRIPTION ---------- */
.text {
    font-size: 1rem;
    line-height: 1.6;
    color: #334155;
    margin-top: 1rem;
    word-wrap: break-word;
    word-break: break-word;
    white-space: normal;
    overflow-wrap: break-word;
    max-width: 100%;
}

/* ---------- ANALOGS (SIMILAR PRODUCTS) ---------- */
.analogs_h2 {
    text-align: center;
    font-size: 2rem;
    font-weight: 600;
    color: #0e2a3a;
    margin: 3rem 0 1.5rem;
    letter-spacing: -0.01em;
}

.analogs {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 2rem;
    max-width: 1400px;
    margin: 0 auto 4rem;
    padding: 0 2rem;
}

.analogs > div {
    flex: 0 0 auto;
    width: 200px;
    max-width: calc(20% - 2rem);
    background: white;
    border-radius: 24px;
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.04);
    border: 1px solid #eef2f6;
    text-align: center;
}

.analogs > div:hover {
    transform: translateY(-6px);
    box-shadow: 0 20px 30px -12px rgba(44, 98, 128, 0.15);
    border-color: #2c6280;
}

.analogs a {
    text-decoration: none;
    display: block;
    padding: 1rem;
}

.analogs img {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    border-radius: 16px;
    transition: transform 0.3s ease;
}

.analogs > div:hover img {
    transform: scale(1.02);
}

.analogs .bag-name {
    font-size: 1rem;
    font-weight: 500;
    color: #1e2f3c;
    margin: 0.75rem 0 0;
    transition: color 0.2s;
    word-wrap: break-word;
}

.analogs > div:hover .bag-name {
    color: #2c6280;
}

.analog-title, .analog-link {
    text-decoration: none;
    color: #2c6280;;
}

/* ========== RESPONSIVE BREAKPOINTS ========== */

/* Tablet and below */
@media (max-width: 950px) {
    .product-container {
        grid-template-columns: 1fr;
        gap: 2rem;
        margin-top: 100px;
        padding: 0 1.5rem;
    }
    .slider-wrapper {
        max-width: min(480px, 85vw);
        margin: 0 auto;
    }
    .thumbnail {
        width: 60px;
        height: 60px;
    }
    .specs-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
    .analogs > div {
        width: 180px;
        max-width: calc(25% - 1.5rem);
    }
}

/* Small tablets & large phones */
@media (max-width: 700px) {
    .product-container {
        margin-top: 90px;
        padding: 0 1rem;
    }
    .thumbnail {
        width: 50px;
        height: 50px;
    }
    .product-info {
        padding: 1.2rem;
    }
    .bag-name {
        font-size: 1.2rem;
    }
    .specs-grid {
        grid-template-columns: 1fr;
    }
    .analogs > div {
        width: 160px;
        max-width: calc(33.33% - 1rem);
    }

    .slider-btn {
        width: 36px;
        height: 36px;
    }
    .slider-btn svg {
        width: 20px;
        height: 20px;
    }
}

/* Mobile landscape */
@media (max-width: 550px) {
    .product-container {
        margin-top: 80px;
    }
    .thumbnail {
        width: 45px;
        height: 45px;
        border-radius: 12px;
    }
    .brand-name {
        font-size: 0.7rem;
    }
    .bag-name {
        font-size: 1rem;
    }
    .spec-card {
        padding: 0.4rem 0.7rem;
    }
    .spec-icon {
        font-size: 1.3rem;
    }
    .spec-value {
        font-size: 0.9rem;
    }
    .text {
        font-size: 0.85rem;
    }
    .analogs_h2 {
        font-size: 1.3rem;
        margin: 2rem 0 1rem;
    }
    .analogs {
        gap: 0.8rem;
        padding: 0 1rem;
    }
    .analogs > div {
        width: 140px;
        max-width: calc(50% - 0.8rem);
    }
    .analogs .bag-name {
        font-size: 0.75rem;
    }
}

/* Small phones */
@media (max-width: 450px) {
    .thumbnail {
        width: 40px;
        height: 40px;
    }
    .analogs {
        gap: 1rem;
    }
    .analogs > div {
        width: 90%;
        max-width: 240px;
    }
    .analogs_h2 {
        font-size: 1.2rem;
    }
}

/* Very small devices (≤ 360px) */
@media (max-width: 360px) {
    .product-container {
        margin-top: 70px;
        padding: 0 0.75rem;
    }
    .thumbnail {
        width: 35px;
        height: 35px;
    }
    .bag-name {
        font-size: 0.9rem;
    }
}

/* Landscape orientation – prevent image being too tall */
@media (max-width: 900px) and (orientation: landscape) {
    .main-image-container {
        max-height: 85vh;
    }
    .slide-wrapper img {
        max-height: 85vh;
    }
    .product-container {
        margin-top: 60px;
        gap: 1rem;
    }
}