/* Product Detail Page - Dark Background with White Sections */

/* Image Lightbox */
.image-lightbox {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 9999;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.image-lightbox.active {
    display: flex;
}

.lightbox-image-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    height: 100%;
    overflow: hidden;
    cursor: zoom-in;
}

.lightbox-image-wrapper.dragging {
    cursor: grabbing;
}

.lightbox-image {
    max-width: 85%;
    max-height: 85%;
    object-fit: contain;
    border-radius: 4px;
    transition: transform 0.2s ease;
    user-select: none;
    -webkit-user-drag: none;
}

.lightbox-image.zoomed {
    cursor: grab;
    transition: none;
}

.lightbox-hint {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.9rem;
    padding: 0.5rem 1rem;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 4px;
    pointer-events: none;
    z-index: 10;
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 20px;
    font-size: 4rem;
    color: #fff;
    cursor: pointer;
    line-height: 1;
    transition: opacity 0.2s;
    z-index: 10;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.4);
    border-radius: 50%;
}

.lightbox-close:hover {
    opacity: 0.7;
    background: rgba(0, 0, 0, 0.6);
}

/* Clickable image cursor */
.image-clickable {
    cursor: zoom-in;
}

/* Mobile lightbox adjustments */
@media (max-width: 768px) {
    .lightbox-image {
        max-width: 95%;
        max-height: 80%;
    }

    .lightbox-hint {
        bottom: 20px;
        font-size: 0.8rem;
    }

    .lightbox-close {
        top: 15px;
        right: 15px;
        font-size: 3.5rem;
        width: 56px;
        height: 56px;
    }
}

/* Product Page Container - Dark background for entire page */
.product-page-container {
    background: #363636;
    min-height: 100vh;
    padding: 2rem 0;
}

/* Individual Product Sections - White cards with rounded corners */
.product-section {
    background: #ffffff;
    border-radius: 12px;
    padding: 2rem;
    margin-bottom: 2rem;
}

/* Page Header: Brand + Measurements */
.product-page-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 2rem;
    position: relative;
}

.brand-measurements-title {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.brand-name {
    font-size: 2.5rem;
    font-weight: 700;
    margin: 0;
    color: #000;
    font-family: "Stencil", sans-serif;
}

.measurements-display {
    font-size: 1.25rem;
    color: #666;
    font-weight: 500;
}

.header-availability {
    margin-left: auto;
    font-size: 1.1rem;
    font-weight: 600;
}

.header-availability .stock-available {
    color: #28a745;
}

.header-availability .stock-orderable {
    color: #FF7F2A;
}

.header-availability .stock-unavailable {
    color: #6c757d;
}

/* Product Detail Card - Use exact card styling, just with more height/spacing */
.product-detail-card {
    /* Inherits all styles from .product-card-horizontal in search-results.css */
    height: auto !important; /* Allow card to grow on detail page */
    min-height: 400px;
    margin-bottom: 0;
}

/* Ribbon positioning for product detail - smaller and positioned to not cover brand */
.ribbon-detail {
    width: 150px;
    height: 150px;
    top: -8px;
    left: -8px;
}

.ribbon-detail .badge {
    font-size: 13px;
    padding: 5px 0;
    top: 24px;
    left: -52px;
    width: 190px;
}

/* Indicator spacing for product detail page */
.product-detail-card .indicators-row {
    gap: 4rem;
}

/* Product Detail Card - Larger sizing for detail page */
.product-detail-card .product-image-section {
    width: 480px;
    height: 460px;
}

.product-detail-card .image-container img {
    max-height: 300px;
}

.product-detail-card .product-info-section {
    gap: 1.25rem;
}

/* Technical Specifications */
.tech-specs-section {
    margin-bottom: 0;
}

.tech-specs-section h3 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    color: #000;
}

.specs-table {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.specs-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0;
}

.spec-cell {
    display: flex;
    justify-content: space-between;
    padding: 1rem;
    background: #f5f5f5;
    border: 1px solid #e0e0e0;
}

.spec-key {
    color: #666;
    font-weight: 500;
}

.spec-val {
    color: #000;
    font-weight: 600;
}

/* EU Label Section */
.eu-label-section {
    margin-bottom: 0;
}

.eu-label-section h3 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: #000;
}

.eu-label-hint {
    color: #666;
    margin-bottom: 2rem;
}

.eu-label-content {
    display: flex;
    gap: 3rem;
    margin-bottom: 2rem;
}

.eprel-image-container {
    flex: 0 0 400px;
}

.eprel-label {
    max-width: 100%;
    height: auto;
}

.eu-explanations {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.eu-explain-item {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
}

.eu-icon-orange {
    flex-shrink: 0;
    width: 3rem;
    height: 3rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.eu-icon-orange img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.eu-text h4 {
    font-size: 0.95rem;
    font-weight: 700;
    margin: 0 0 0.5rem 0;
    color: #000;
    line-height: 1.2;
}

.eu-text p {
    font-size: 0.85rem;
    line-height: 1.5;
    color: #666;
    margin: 0;
}

.eu-label-footer {
    font-size: 0.8rem;
    color: #999;
    line-height: 1.5;
}

/* Responsive */
@media (max-width: 768px) {
    .product-section {
        padding: 1.5rem;
        margin-bottom: 1.5rem;
    }

    .product-detail-card {
        flex-direction: column;
        gap: 1.5rem;
    }

    /* Reset image section sizing for mobile */
    .product-detail-card .product-image-section {
        width: 100%;
        height: auto;
    }

    .product-image-detail {
        flex: none;
        width: 100%;
    }

    .price-cart-section {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
    }

    .cart-controls {
        flex-direction: column;
    }

    .specs-row {
        grid-template-columns: 1fr;
    }

    .eu-label-content {
        flex-direction: column;
        gap: 1.5rem;
    }

    .eprel-image-container {
        flex: none;
    }
}

/* Product Variants Section - "Saadavus ja Tarneaeg" */
.variants-section h3 {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0 0 1rem 0;
    color: #000;
    text-transform: uppercase;
}

/* See other availability link */
.see-other-availability {
    display: block;
    margin-top: 0.5rem;
    color: #FF7F2A;
    text-decoration: underline;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: color 0.2s;
}

.see-other-availability:hover {
    color: #e06a1f;
}

/* Smooth scroll and highlight animation for availability section */
html {
    scroll-behavior: smooth;
}

#availability-section {
    scroll-margin-top: 20px;
}

#availability-section.highlight {
    animation: highlightSection 1.5s ease-out;
}

@keyframes highlightSection {
    0% {
        box-shadow: 0 0 0 4px rgba(255, 127, 42, 0.6);
    }
    100% {
        box-shadow: none;
    }
}

/* Availability Table */
.availability-table-wrapper {
    overflow-x: auto;
}

.availability-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.availability-table th,
.availability-table td {
    padding: 0.75rem 1rem;
    text-align: left;
    border-bottom: 1px solid #e0e0e0;
    color: #333;
}

.availability-table th {
    background: #f5f5f5;
    font-weight: 600;
    color: #333;
    white-space: nowrap;
}

.availability-table tbody tr {
    transition: background-color 0.2s;
}

.availability-table .current-product-row {
    background: #fff8f0;
    font-weight: 600;
    color: #333;
}

.availability-table .current-product-row td {
    color: #333;
}

.availability-table .variant-row {
    cursor: pointer;
    color: #333;
}

.availability-table .variant-row td {
    color: #333;
}

.availability-table .variant-row:hover {
    background: #f9f9f9;
}

.availability-table .price-cell {
    font-weight: 700;
    white-space: nowrap;
}

.availability-table .variant-sale-price {
    color: #e74c3c;
}

/* Legacy variants-list (keep for backward compatibility) */
.variants-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.variant-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    text-decoration: none;
    transition: opacity 0.2s ease;
    border-bottom: 1px solid #f0f0f0;
}

.variant-item:hover {
    opacity: 0.7;
}

.variant-availability {
    flex: 1;
}

.variant-availability .stock-available,
.variant-availability .stock-orderable,
.variant-availability .stock-unavailable {
    font-size: 0.9rem;
    font-weight: 500;
    display: inline;
}

.variant-availability .stock-available {
    color: #28a745;
}

.variant-availability .stock-orderable {
    color: #FF7F2A;
}

.variant-availability .stock-unavailable {
    color: #6c757d;
}

.variant-price {
    font-size: 1.1rem;
    font-weight: 700;
    color: #000;
    margin-left: 1rem;
}

.variant-sale-price {
    color: #e74c3c;
}

.variant-regular-price {
    color: #000;
}

/* Mobile responsiveness for variants */
@media (max-width: 768px) {
    .variant-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.25rem;
        padding: 0.75rem 0;
    }

    .variant-price {
        margin-left: 0;
        align-self: flex-end;
    }
}

/* Small mobile: Product Detail Page specific styles */
@media (max-width: 500px) {
    .product-page-container {
        padding: 0.5rem 0;
    }

    .product-section {
        padding: 1rem;
        margin-bottom: 1rem;
        border-radius: 8px;
    }

    /* Page header compact */
    .product-page-header {
        margin-bottom: 1rem;
        gap: 0.5rem 0.75rem;
        flex-wrap: wrap;
    }

    .brand-name {
        font-size: 1.75rem;
    }

    .measurements-display {
        font-size: 1rem;
    }

    .header-availability {
        font-size: 0.85rem;
        margin-left: 0;
        width: 100%;
        order: 3;
    }

    /* Product detail card - override search results mobile styles */
    .product-detail-card.product-card-horizontal {
        flex-direction: column;
        height: auto !important;
        padding: 0;
    }

    /* SHOW image section on product detail (unlike search results) */
    .product-detail-card .product-image-section {
        display: flex !important;
        width: 100%;
        padding: 0.75rem;
        flex-direction: column;
        align-items: center;
        background: #ffffff;
        border-radius: 8px 8px 0 0;
    }

    .product-detail-card .image-container {
        display: flex !important;
        justify-content: center;
        align-items: center;
        max-height: 150px;
        margin-bottom: 0.5rem;
    }

    .product-detail-card .image-container img {
        max-height: 140px;
        max-width: 100%;
        object-fit: contain;
    }

    .product-detail-card .price-display-left {
        flex-direction: row;
        gap: 0.5rem;
        align-items: center;
    }

    .product-detail-card .price-display-left .current-price {
        font-size: 1.5rem;
    }

    .product-detail-card .price-display-left .sale-price {
        font-size: 1.5rem;
    }

    .product-detail-card .price-display-left .old-price {
        font-size: 1rem;
    }

    /* Info section - SHOW all specs (unlike search results) */
    .product-detail-card .product-info-section {
        padding: 0.75rem;
        gap: 0.5rem;
        display: flex;
        flex-direction: column;
    }

    /* Explicit ordering for product detail card elements */
    .product-detail-card .product-title-card {
        font-size: 1rem;
        height: auto;
        padding: 0;
        margin-bottom: 0.25rem;
        order: 1 !important;
    }

    /* Hide mobile price row on detail page since image section shows price */
    .product-detail-card .mobile-price-row {
        display: none !important;
    }

    /* Tire type/stock row */
    .product-detail-card .tire-type-stock-row {
        padding: 0.35rem 0;
        font-size: 0.8rem;
        order: 2 !important;
    }

    /* SHOW tire indicators on product detail page */
    .product-detail-card .tire-indicators {
        display: block !important;
        padding: 0.5rem 0;
        order: 3 !important;
    }

    .product-detail-card .tire-indicators .indicators-label {
        font-size: 0.75rem;
        margin-bottom: 0.35rem;
    }

    .product-detail-card .tire-indicators .indicators-row {
        gap: 1rem;
    }

    .product-detail-card .tire-indicators .indicator-icon {
        width: 24px;
        height: 24px;
    }

    .product-detail-card .tire-indicators .indicator-value {
        font-size: 0.9rem;
    }

    /* SHOW detailed specs on product detail page - AFTER tire indicators */
    .product-detail-card .tire-specs-detailed {
        display: flex !important;
        flex-direction: column;
        gap: 0.35rem;
        padding: 0.5rem 0;
        order: 4 !important;
    }

    .product-detail-card .spec-row {
        grid-template-columns: 20px 1fr auto;
        font-size: 0.85rem;
        gap: 0.5rem;
    }

    .product-detail-card .spec-icon {
        width: 20px;
        height: 20px;
    }

    /* Add to cart section - LAST */
    .product-detail-card .product-actions-card {
        gap: 0.5rem;
        padding-top: 0.75rem;
        flex-wrap: nowrap;
        order: 5 !important;
    }

    .product-detail-card .qty-btn {
        width: 32px;
        height: 32px;
    }

    .product-detail-card .qty-input {
        width: 45px;
        height: 32px;
    }

    .product-detail-card .btn-add-to-cart {
        padding: 0.6rem 1rem;
        font-size: 0.85rem;
        flex: 1;
    }

    /* Tech specs section */
    .tech-specs-section h3 {
        font-size: 1.1rem;
        margin-bottom: 1rem;
    }

    .spec-cell {
        padding: 0.75rem;
        font-size: 0.85rem;
    }

    /* EU Label section */
    .eu-label-section h3 {
        font-size: 1.1rem;
    }

    .eu-label-hint {
        font-size: 0.85rem;
        margin-bottom: 1rem;
    }

    .eprel-image-container {
        text-align: center;
    }

    .eprel-label {
        max-width: 280px;
    }

    .eu-explain-item {
        gap: 0.75rem;
    }

    .eu-icon-orange {
        width: 2.5rem;
        height: 2.5rem;
    }

    .eu-text h4 {
        font-size: 0.85rem;
    }

    .eu-text p {
        font-size: 0.8rem;
    }

    .eu-label-footer {
        font-size: 0.75rem;
    }

    /* Variants section */
    .variants-section h3 {
        font-size: 1.1rem;
    }

    /* Availability table mobile */
    .availability-table {
        font-size: 0.8rem;
    }

    .availability-table th,
    .availability-table td {
        padding: 0.5rem 0.5rem;
    }

    .see-other-availability {
        font-size: 0.8rem;
    }
}

/* Campaign Info Section */
.campaign-info-section {
    background: linear-gradient(135deg, #fff9f5 0%, #fff 100%);
    border: 2px solid #FF7F2A;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 4px 12px rgba(255, 127, 42, 0.15);
}

.campaign-info-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(255, 127, 42, 0.3);
}

.campaign-info-icon {
    width: 50px;
    height: 50px;
    object-fit: contain;
    flex-shrink: 0;
}

.campaign-info-header h3 {
    margin: 0;
    color: #2c3e50;
    font-size: 1.3rem;
    font-weight: 700;
}

.campaign-info-content {
    color: #444;
    font-size: 0.95rem;
    line-height: 1.6;
}

.campaign-info-content p {
    margin: 0 0 0.75rem 0;
}

.campaign-info-content p:last-child {
    margin-bottom: 0;
}

.campaign-info-content h4,
.campaign-info-content h5,
.campaign-info-content h6 {
    color: #2c3e50;
    margin: 1rem 0 0.5rem 0;
}

.campaign-info-content ul,
.campaign-info-content ol {
    margin: 0.5rem 0;
    padding-left: 1.5rem;
}

.campaign-info-content li {
    margin-bottom: 0.25rem;
}

.campaign-info-content a {
    color: #FF7F2A;
    text-decoration: underline;
}

.campaign-info-content a:hover {
    color: #e66a1a;
}

/* Campaign icon in product detail - significantly larger */
.campaign-icon-detail .campaign-icon {
    width: 100px;
    height: 100px;
}

/* Mobile adjustments for campaign info */
@media (max-width: 768px) {
    .campaign-info-section {
        padding: 1rem;
    }

    .campaign-info-header {
        gap: 0.75rem;
    }

    .campaign-info-icon {
        width: 40px;
        height: 40px;
    }

    .campaign-info-header h3 {
        font-size: 1.1rem;
    }

    .campaign-info-content {
        font-size: 0.9rem;
    }

    .campaign-icon-detail .campaign-icon {
        width: 80px;
        height: 80px;
    }
}
