/* Стили для карточки товара */
.product-detail {
    margin-bottom: 40px;
}

.product-detail h1 {
    margin-bottom: 25px;
    font-size: 1.8rem;
}

.product-wrapper {
    display: grid;
    grid-template-columns: minmax(300px, 1fr) minmax(300px, 1fr);
    gap: 30px;
}

.product-gallery {
    width: 100%;
    max-width: 100%;
}

.product-info {
    width: 100%;
}

.product-main-image {
    width: 100%;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    margin-bottom: 15px;
    aspect-ratio: 4/3;
    position: relative;
    background-color: #fff;
}

.image-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: zoom-in;
    z-index: 5;
}

.product-main-image img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    transition: transform 0.3s ease, opacity 0.3s ease;
    cursor: zoom-in;
}

.gallery-controls {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    pointer-events: none;
    padding: 0 15px;
    z-index: 10;
}

.gallery-nav-btn {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.3);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border: none;
    outline: none;
    transition: all 0.2s ease;
    pointer-events: auto;
    backdrop-filter: blur(2px);
    font-size: 20px;
    z-index: 15;
}

.gallery-nav-btn:hover {
    background: rgba(0, 0, 0, 0.6);
    transform: scale(1.1);
}

.gallery-nav-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
    background: rgba(0, 0, 0, 0.2);
    transform: scale(1);
}

.product-thumbnails {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 15px;
    justify-content: center;
}

.thumbnail {
    width: 70px;
    height: 70px;
    cursor: pointer;
    border-radius: 6px;
    overflow: hidden;
    transition: all 0.3s ease;
    opacity: 0.7;
    position: relative;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.thumbnail.active {
    opacity: 1;
    transform: translateY(-3px);
    box-shadow: 0 5px 10px rgba(0,0,0,0.15);
}

.thumbnail.active::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 30px;
    height: 3px;
    background-color: #0078d4;
    border-radius: 3px;
}

.thumbnail:hover {
    opacity: 0.9;
    transform: translateY(-2px);
}

.thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Анимация смены изображений */
.product-main-image.loading .image-container {
    background-color: rgba(240, 240, 240, 0.4);
}

.product-main-image.loading img {
    opacity: 0.6;
    transform: scale(0.98);
}

/* Premium product accent */
.product-page.premium-product .product-detail {
    margin-bottom: 56px;
}

.product-page.premium-product .product-detail h1 {
    font-family: 'Manrope', 'Segoe UI', sans-serif;
    font-size: clamp(1.9rem, 3.2vw, 2.45rem);
    font-weight: 800;
    margin-bottom: 26px;
    letter-spacing: -0.01em;
    color: #18222c;
}

.product-page.premium-product .product-wrapper {
    position: relative;
    display: grid;
    grid-template-columns: minmax(280px, 0.95fr) minmax(0, 1.2fr);
    gap: 34px;
    padding: 30px;
    border-radius: 26px;
    border: 1px solid rgba(214, 220, 226, 0.95);
    background:
        radial-gradient(circle at 100% -10%, rgba(58, 134, 255, 0.16), transparent 42%),
        radial-gradient(circle at -6% 102%, rgba(232, 93, 4, 0.13), transparent 32%),
        linear-gradient(160deg, rgba(255, 255, 255, 0.97), rgba(246, 250, 253, 0.94));
    box-shadow: 0 20px 38px rgba(18, 31, 44, 0.16);
    overflow: hidden;
}

.product-page.premium-product .product-wrapper::before {
    content: none;
}

.product-page.premium-product .product-gallery,
.product-page.premium-product .product-info {
    border: 0;
    background: transparent;
    box-shadow: none;
    border-radius: 0;
}

.product-page.premium-product .product-gallery {
    padding: 0;
}

.product-page.premium-product .product-info {
    padding: 4px 0 0 6px;
}

.product-page.premium-product .product-main-image {
    border-radius: 16px;
    border: 1px solid rgba(220, 227, 234, 0.85);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9), 0 10px 22px rgba(16, 28, 40, 0.12);
    background:
        radial-gradient(circle at 20% 15%, rgba(232, 93, 4, 0.08), transparent 30%),
        linear-gradient(160deg, #ffffff, #f2f6fa);
}

.product-page.premium-product .product-main-image img {
    transition: transform 0.4s ease, opacity 0.3s ease;
}

.product-page.premium-product .product-main-image:hover img {
    transform: scale(1.035);
}

.product-page.premium-product .product-thumbnails {
    margin-top: 18px;
    gap: 10px;
    justify-content: flex-start;
}

.product-page.premium-product .thumbnail {
    width: 72px;
    height: 72px;
    border-radius: 10px;
    border: 1px solid rgba(214, 220, 226, 0.95);
    opacity: 0.85;
    box-shadow: 0 6px 14px rgba(17, 31, 44, 0.12);
}

.product-page.premium-product .thumbnail.active {
    opacity: 1;
    border-color: rgba(232, 93, 4, 0.55);
    transform: translateY(-4px);
    box-shadow: 0 10px 20px rgba(16, 28, 41, 0.2);
}

.product-page.premium-product .thumbnail.active::after {
    bottom: -10px;
    width: 34px;
    height: 4px;
    background: linear-gradient(90deg, #e85d04, #3a86ff);
}

.product-page.premium-product .product-description {
    padding: 0;
    margin-bottom: 0;
    color: #344450;
    font-size: 1.03rem;
    line-height: 1.82;
    text-align: left;
    text-wrap: pretty;
    max-width: 74ch;
}

.product-page.premium-product .product-description > *:first-child {
    margin-top: 0;
}

.product-page.premium-product .product-description > *:last-child {
    margin-bottom: 0;
}

.product-page.premium-product .product-description p {
    margin: 0 0 1rem;
    color: #334756;
}

.product-page.premium-product .product-description p + p {
    margin-top: 0.9rem;
}

.product-page.premium-product .product-description h2,
.product-page.premium-product .product-description h3,
.product-page.premium-product .product-description h4 {
    margin: 1.6rem 0 0.75rem;
    padding-left: 0.8rem;
    border-left: 3px solid rgba(232, 93, 4, 0.45);
    color: #c1450d;
    line-height: 1.35;
}

.product-page.premium-product .product-description h2,
.product-page.premium-product .product-description h3,
.product-page.premium-product .product-description h4 {
    color: #c1450d;
}

.product-page.premium-product .product-description h2 {
    font-size: 1.45rem;
}

.product-page.premium-product .product-description h3 {
    font-size: 1.22rem;
}

.product-page.premium-product .product-description h4 {
    font-size: 1.08rem;
}

.product-page.premium-product .product-description .product-spec-list {
    margin: 0.25rem 0 1.3rem;
    padding: 0;
    border-radius: 14px;
    border: 1px solid rgba(214, 220, 226, 0.95);
    background: rgba(255, 255, 255, 0.82);
    overflow: hidden;
}

.product-page.premium-product .product-description .product-spec-item {
    display: grid;
    grid-template-columns: 260px minmax(0, 1fr);
    gap: 14px;
    align-items: start;
    padding: 10px 14px;
    border-bottom: 1px solid rgba(225, 232, 238, 0.95);
}

.product-page.premium-product .product-description .product-spec-item:nth-child(odd) {
    background: rgba(248, 251, 254, 0.85);
}

.product-page.premium-product .product-description .product-spec-item:last-child {
    border-bottom: 0;
}

.product-page.premium-product .product-description .product-spec-item dt,
.product-page.premium-product .product-description .product-spec-item dd {
    margin: 0;
    min-width: 0;
}

.product-page.premium-product .product-description .product-spec-item dt {
    font-weight: 700;
    color: #1f2f3d;
    overflow-wrap: anywhere;
}

.product-page.premium-product .product-description .product-spec-item dd {
    color: #334756;
    overflow-wrap: anywhere;
}

.product-page.premium-product .product-description ul,
.product-page.premium-product .product-description ol {
    margin: 0.75rem 0 1.1rem;
    padding-left: 1.25rem;
}

.product-page.premium-product .product-description li {
    margin-bottom: 0.45rem;
    padding-left: 0.2rem;
}

.product-page.premium-product .product-description ul li::marker {
    color: #d9480f;
}

.product-page.premium-product .product-description ol li::marker {
    color: #2f4f68;
    font-weight: 700;
}

.product-page.premium-product .product-description a {
    color: #1665d8;
    text-decoration-color: rgba(22, 101, 216, 0.35);
    text-underline-offset: 3px;
    transition: color 0.2s ease, text-decoration-color 0.2s ease;
}

.product-page.premium-product .product-description a:hover {
    color: #d9480f;
    text-decoration-color: rgba(217, 72, 15, 0.5);
}

.product-page.premium-product .product-description strong {
    color: #1d2d3a;
    font-weight: 700;
}

.product-page.premium-product .product-description blockquote {
    margin: 1.2rem 0;
    padding: 0.9rem 1rem;
    border-left: 4px solid rgba(58, 134, 255, 0.55);
    border-radius: 0 10px 10px 0;
    background: rgba(58, 134, 255, 0.08);
    color: #2b3f4f;
}

.product-page.premium-product .product-description hr {
    height: 1px;
    border: 0;
    margin: 1.35rem 0;
    background: linear-gradient(90deg, rgba(214, 220, 226, 0), rgba(214, 220, 226, 1), rgba(214, 220, 226, 0));
}

.product-page.premium-product .product-description img {
    display: block;
    margin: 1rem auto;
    border-radius: 12px;
    box-shadow: 0 10px 22px rgba(20, 33, 45, 0.14);
}

.product-page.premium-product .product-description table {
    width: 100%;
    table-layout: fixed;
    border-collapse: collapse;
    margin: 1.2rem 0;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid rgba(214, 220, 226, 0.95);
}

.product-page.premium-product .product-description table th:first-child,
.product-page.premium-product .product-description table td:first-child {
    width: 260px;
    font-weight: 700;
    color: #1f2f3d;
    background: rgba(58, 134, 255, 0.08);
}

.product-page.premium-product .product-description table th:last-child,
.product-page.premium-product .product-description table td:last-child {
    width: auto;
    overflow-wrap: anywhere;
}

.product-page.premium-product .product-description th,
.product-page.premium-product .product-description td {
    padding: 0.7rem 0.8rem;
    border-bottom: 1px solid rgba(226, 232, 238, 0.95);
    text-align: left;
}

.product-page.premium-product .product-description th {
    font-weight: 700;
    color: #1d2e3d;
    background: rgba(58, 134, 255, 0.08);
}

.product-page.premium-product .product-description tr:last-child td {
    border-bottom: 0;
}

.product-page.premium-product .product-description code {
    padding: 0.12rem 0.36rem;
    border-radius: 6px;
    font-size: 0.9em;
    background: rgba(24, 33, 43, 0.08);
    color: #1e2a33;
}

.product-page.premium-product .product-description pre {
    margin: 1rem 0;
    padding: 0.9rem;
    border-radius: 12px;
    border: 1px solid rgba(214, 220, 226, 0.95);
    background: #f7f9fb;
    overflow-x: auto;
}

.product-page.premium-product .product-description pre code {
    padding: 0;
    border-radius: 0;
    background: transparent;
}

@media (max-width: 1100px) {
    .product-page.premium-product .product-description .product-spec-item {
        grid-template-columns: 220px minmax(0, 1fr);
    }

    .product-page.premium-product .product-description table th:first-child,
    .product-page.premium-product .product-description table td:first-child {
        width: 220px;
    }
}

/* Медиа-запросы */
@media (max-width: 768px) {
    .product-wrapper {
        grid-template-columns: 1fr;
    }
    
    .thumbnail {
        width: 60px;
        height: 60px;
    }
    
    .product-main-image {
        aspect-ratio: 3/2;
    }
    
    .gallery-nav-btn {
        width: 40px;
        height: 40px;
        font-size: 18px;
    }

    .product-page.premium-product .product-wrapper {
        gap: 20px;
        padding: 18px;
        border-radius: 18px;
    }

    .product-page.premium-product .product-gallery,
    .product-page.premium-product .product-info {
        border-radius: 0;
        padding: 0;
    }

    .product-page.premium-product .product-thumbnails {
        justify-content: center;
    }

    .product-page.premium-product .product-description {
        font-size: 0.97rem;
        line-height: 1.74;
    }

    .product-page.premium-product .product-description h2 {
        font-size: 1.28rem;
    }

    .product-page.premium-product .product-description h3 {
        font-size: 1.14rem;
    }

    .product-page.premium-product .product-description .product-spec-item {
        grid-template-columns: 1fr;
        gap: 5px;
    }

    .product-page.premium-product .product-description table th:first-child,
    .product-page.premium-product .product-description table td:first-child {
        width: 46%;
    }
}