/* CONTAINER */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* PRODUCT SECTION */
.product-section {
    display: grid;
    grid-template-columns: 1.1fr 1fr;
    gap: 70px;
    background: white;
    padding: 50px;
    margin: -40px auto 50px;
    position: relative;
    z-index: 10;
    border-radius: 16px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.08);
}

/* GALLERY */
.gallery-section {
    display: flex;
    gap: 12px;

    overflow: hidden;
}

.thumbnails-vertical {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 70px;
    max-height: 500px;
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 15px;
}

.thumbnails-vertical::-webkit-scrollbar {
    width: 4px;
}

.thumbnails-vertical::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.thumbnails-vertical::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 10px;
}

.thumbnails-vertical::-webkit-scrollbar-thumb:hover {
    background: #999;
}

.thumbnail {
    width: 70px;
    height: 70px;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.25s;
    opacity: 0.6;
    flex-shrink: 0;
}

.thumbnail:hover {
    opacity: 1;
    border-color: var(--primary-light);
}

.thumbnail.active {
    border-color: var(--primary);
    opacity: 1;
}

.thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.main-image-container {
    flex: 1;
}

.main-image {
    position: relative;
    width: 100%;
    aspect-ratio: 1;
    overflow: hidden;
    border-radius: 12px;
    cursor: zoom-in;
    border: 1px solid var(--border);
    transition: transform 0.3s;
    margin-bottom: 32px;
}

.main-image-modal {
    position: relative;
}

.main-image .badge,
.main-image-modal .badge {
    padding: 10px 15px;

    position: absolute;
    right: 0;
    bottom: 0;
    z-index: 100;

    font-weight: bold;
    font-size: 12px;
    background: white;
    color: var(--primary);
    border-radius: 10px 0 0 0;
}

.main-image-modal .badge {
    padding: 15px 20px;
    font-size: 16px;
}

.image-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: #fafbfc;
    border-radius: 8px;
    border: 1px solid #f0f0f0;
}

.image-counter {
    font-size: 13px;
    color: var(--gray);
    font-weight: 500;
}

.image-zoom-hint {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--gray);
}

.image-zoom-hint svg {
    width: 16px;
    height: 16px;
}

.main-image:hover {
    transform: scale(1.01);
}

.main-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* PRODUCT INFO */
.product-info h2 {
    font-size: 28px;
    margin-bottom: 15px;
    font-weight: 600;
    color: var(--dark);
    line-height: 1.3;
}

.price-section, .product-sku {
    display: flex;
    flex-flow: row wrap;
    align-items: baseline;
    gap: 16px;
    margin-bottom: 30px;
    padding: 20px;
    background: linear-gradient(135deg, #f8f9ff 0%, #f0f4ff 100%);
    border-radius: 12px;
    border: 1px solid rgba(20, 40, 160, 0.08);
}

.sku-label {
    font-size: 12px;
    font-weight: 700;
    display: block;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #555;
}

.sku-value {
    font-size: 14px;
    color: #555;
    line-height: 1.5;
}

.current-price {
    font-size: 40px;
    font-weight: 700;
    color: var(--primary);
    letter-spacing: -1px;
}

.old-price {
    font-size: 20px;
    color: #999;
    text-decoration: line-through;
    opacity: 0.7;
}

.discount-badge {
    background: linear-gradient(135deg, #ff4757 0%, #ff6b7a 100%);
    color: white;
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 700;
    box-shadow: 0 2px 8px rgba(255, 71, 87, 0.25);
    letter-spacing: 0.5px;
}

.option-group {
    margin-bottom: 28px;
    padding: 18px;
    background: #fafbfc;
    border-radius: 10px;
    border: 1px solid #f0f0f0;
}

.option-label {
    font-size: 12px;
    font-weight: 700;
    margin-bottom: 12px;
    display: block;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #555;
}

.color-options {
    display: flex;
    gap: 10px;
}

.color-option {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: 2px solid #e5e7eb;
    cursor: pointer;
    position: relative;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.06);
}

.selected-color-name {
    margin-top: 10px;

    font-size: 14px;
    color: #555;
    line-height: 1.5;
}

.color-option:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.color-option.active {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(20, 40, 160, 0.12);
    transform: scale(1.05);
}

.color-option.active::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-weight: bold;
    font-size: 18px;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
}

.size-options {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.size-option {
    padding: 10px 20px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    cursor: pointer;
    background: white;
    font-weight: 600;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 14px;
    min-width: 55px;
    text-align: center;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.size-option:hover {
    border-color: var(--primary);
    background: #f8f9ff;
    box-shadow: 0 3px 8px rgba(20, 40, 160, 0.1);
}

.size-option.active {
    border-color: var(--primary);
    background: var(--primary);
    color: white;
    box-shadow: 0 4px 12px rgba(20, 40, 160, 0.25);
}

.key-features {
    background: linear-gradient(135deg, #f8fafb 0%, #f1f5f9 100%);
    padding: 24px;
    border-radius: 12px;
    margin-bottom: 28px;
    border: 1px solid #e8edf2;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.02);
}

.key-features h3 {
    font-size: 14px;
    margin-bottom: 16px;
    font-weight: 700;
    color: var(--dark);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.feature-list {
    list-style: none;
}

.feature-list li {
    padding: 9px 0;
    padding-left: 28px;
    position: relative;
    font-size: 14px;
    color: #555;
    line-height: 1.5;
}

.feature-list li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: var(--success);
    font-weight: bold;
    font-size: 17px;
    width: 20px;
    height: 20px;
    background: rgba(46, 204, 113, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.action-buttons {
    display: flex;
    gap: 12px;
    margin-bottom: 30px;
}

.btn {
    flex: 1;
    padding: 14px 24px;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.25s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-light);
    box-shadow: 0 4px 16px rgba(20, 40, 160, 0.25);
}

.btn-secondary {
    background: white;
    color: var(--primary);
    border: 1.5px solid var(--primary);
}

.btn-secondary:hover {
    background: var(--primary);
    color: white;
}

.benefits {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;

    padding: 16px 16px 16px 26px;
    margin-top: 20px;
    background: #fafbfc;
    border-radius: 8px;
    border: 1px solid #f0f0f0;
}

.benefit-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    color: var(--gray);
}

.benefit-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    color: var(--primary);
}

/* TABS SECTION */
.tabs-section {
    background: white;
    padding: 40px 50px;
    border-radius: 16px;
    margin-bottom: 50px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
}

.tabs {
    display: flex;
    gap: 35px;
    border-bottom: 2px solid var(--border);
    margin-bottom: 35px;
}

.tab {
    padding: 14px 0;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
    transition: all 0.25s;
    color: var(--gray);
}

.tab:hover {
    color: var(--primary);
}

.tab.active {
    border-bottom-color: var(--primary);
    color: var(--primary);
}

.tab-content {
    display: none;
    animation: fadeIn 0.4s;
}

.tab-content.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.tab-content h3 {
    font-size: 20px;
    margin-bottom: 18px;
    color: var(--dark);
}

.tab-content p {
    font-size: 15px;
    line-height: 1.7;
    color: var(--gray);
    margin-bottom: 14px;
}

.specs-table {
    width: 100%;
    border-collapse: collapse;
}

.specs-table tr {
    border-bottom: 1px solid #f0f0f0;
}

.specs-table tr:last-child {
    border-bottom: none;
}

.specs-table td {
    padding: 14px 0;
    font-size: 15px;
}

.specs-table td:first-child {
    font-weight: 600;
    width: 220px;
    color: var(--dark);
}

.specs-table td:last-child {
    color: var(--gray);
}

/* MODAL */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
}

.modal-image {
    max-width: 100%;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 4px;
}

.modal-close {
    position: absolute;
    top: -45px;
    right: 0;
    background: none;
    border: none;
    color: white;
    font-size: 32px;
    cursor: pointer;
    padding: 5px 12px;
    transition: transform 0.25s;
}

.modal-close:hover {
    transform: scale(1.15);
}

.modal-nav {
    position: absolute;
    top: 50%;
    z-index: 100;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 1);
    border: none;
    color: var(--primary);
    font-size: 28px;
    cursor: pointer;
    padding: 16px;
    border-radius: 50%;
    transition: all 0.25s;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-nav:hover {
    background: rgba(255, 255, 255, 0.7);
}

.modal-nav.prev {
    left: -100px;
}

.modal-nav.next {
    right: -100px;
}

/* MOBILE */
@media (max-width: 768px) {
    .image-info {
        flex-direction: column;
        gap: 8px;
        align-items: flex-start;
    }

    .image-zoom-hint {
        font-size: 11px;
    }

    .hero {
        padding: 80px 20px 60px;
    }

    .hero h1 {
        font-size: 2rem;
    }

    .hero p {
        font-size: 1rem;
    }

    .product-section {
        grid-template-columns: 1fr;
        padding: 30px 25px;
        gap: 35px;
        margin-top: -30px;
    }

    .gallery-section {
        flex-direction: column-reverse;
    }

    .thumbnails-vertical {
        flex-direction: row;
        width: 100%;
        max-height: none;
        overflow-x: auto;
        overflow-y: hidden;
        padding-bottom: 5px;
        padding-right: 0;
    }

    .thumbnails-vertical::-webkit-scrollbar {
        height: 4px;
        width: auto;
    }

    .thumbnail {
        min-width: 70px;
    }

    .product-info h2 {
        font-size: 24px;
    }

    .current-price {
        font-size: 32px;
    }

    .old-price {
        font-size: 20px;
    }

    .benefits {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .action-buttons {
        flex-direction: column;
    }

    .tabs-section {
        padding: 30px 25px;
    }

    .tabs {
        gap: 25px;
    }

    .tab {
        font-size: 15px;
    }

    .specs-table td:first-child {
        width: 140px;
        font-size: 14px;
    }

    .specs-table td:last-child {
        font-size: 14px;
    }

    .modal-nav {
        width: 44px;
        height: 44px;
        font-size: 24px;
    }

    .modal-nav.prev {
        left: 15px;
    }

    .modal-nav.next {
        right: 15px;
    }
}

@media (max-width: 480px) {
    .hero h1 {
        font-size: 1.75rem;
    }

    .product-section {
        padding: 25px 20px;
    }

    .current-price {
        font-size: 28px;
    }

    .tabs-section {
        padding: 25px 20px;
    }
}

svg {
    width: 20px;
    height: 20px;
}



/* Недоступные цветовые опции */
.color-option.disabled {
    opacity: 0.35;
    cursor: not-allowed;
    position: relative;
}

.color-option.disabled::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 2px;
    height: 140%;
    background: #ff4757;
    transform: translate(-50%, -50%) rotate(45deg);
    pointer-events: none;
    z-index: 1;
}

.color-option.disabled:hover {
    transform: none !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1) !important;
    border-color: var(--border) !important;
}

/* Недоступные опции размера/памяти */
.size-option.disabled {
    opacity: 0.4;
    cursor: not-allowed;
    background: #f5f5f5 !important;
    color: #999 !important;
    text-decoration: line-through;
    pointer-events: none;
    border-color: #ddd !important;
}

.size-option.disabled:hover {
    transform: none !important;
    background: #f5f5f5 !important;
    color: #999 !important;
}

/* Кнопка добавления в корзину когда недоступна */
.ajax-add-to-cart-single.disabled,
.ajax-add-to-cart-single:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: #ccc !important;
}

.ajax-add-to-cart-single.disabled:hover,
.ajax-add-to-cart-single:disabled:hover {
    background: #ccc !important;
    transform: none !important;
}