/* app/static/css/product-detail.css */
/* Modern product detail page styles - SINGLE COLUMN LAYOUT */

:root {
    --primary-color: #008c45;
    --text-color: #333;
    --text-light: #666;
    --border-color: #e0e0e0;
    --badge-color: #e74c3c;
    --card-bg: #ffffff;
    --section-bg: #f8f8f8;
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.product-detail {
    margin: 30px 0;
}

/* SINGLE COLUMN LAYOUT - Changed from grid to single column */
.product-detail-grid {
    display: block;  /* Changed from grid */
    max-width: 100%;  /* Use full width of the main content area */
    margin-bottom: 60px;
}

/* Product Gallery - Now full width at top */
.product-gallery {
    margin-bottom: 40px;  /* Space between gallery and info */
    width: 100%;
}

.main-image {
    position: relative;
    background-color: #ffffff;
    border-radius: 12px;
    border: 0px solid var(--border-color);
    padding: 20px;               /* <-- Mindre padding */
    display: flex;
    align-items: center;
    justify-content: center;
    /* aspect-ratio: 1 / 1; */         /* <-- Kvadratisk istället för 4/3 */
    max-width: 900px;            /* <-- Ny rad: begränsa bredden */
    max-height: 500px;           /* <-- Mindre max-height */
    margin: 0 auto 20px;         /* <-- Centrera containern */
    overflow: hidden;
}


.main-image picture {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

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

.no-image.large {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    background-color: var(--section-bg);
    color: #999;
    font-size: 16px;
    font-style: italic;
    border-radius: 8px;
}



/* Thumbnail Gallery - Centered under main image */
.thumbnail-gallery {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    padding-top: 4px;
    scrollbar-width: thin;
    scrollbar-color: var(--primary-color) var(--section-bg);
    justify-content: center;  /* Center thumbnails */
    flex-wrap: wrap;  /* Allow wrapping on larger screens */
}

.thumbnail-gallery::-webkit-scrollbar {
    height: 6px;
}

.thumbnail-gallery::-webkit-scrollbar-track {
    background: var(--section-bg);
}

.thumbnail-gallery::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 3px;
}

.thumbnail {
    flex: 0 0 80px;
    width: 80px;
    height: 80px;
    border-radius: 8px;
    border: 2px solid var(--border-color);
    overflow: hidden;
    cursor: pointer;
    background-color: #ffffff;
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    outline: none !important;
}

.thumbnail:hover {
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

/* FIX FOR DOUBLE BORDER: Only one border style for active state */
.thumbnail.active {
    border-color: var(--primary-color);
    border-width: 2px;
}

/* Remove focus outline that could create double border effect */
.thumbnail:focus {
    outline: none !important;
}

/* Alternative focus style using box-shadow instead of outline */
.thumbnail:focus-visible {
    box-shadow: 0 0 0 3px rgba(0, 140, 69, 0.2);
}

.thumbnail img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    display: block;
}

/* Product Info - Now full width below gallery */
.product-info {
    display: flex;
    flex-direction: column;
    max-width: 1400px;            /* <-- Matcha bildcontainerns bredd */
    margin: 0 auto;              /* <-- Centrera för att matcha bilden */
}

.product-title {
    font-size: 22px;  /* Slightly larger for single column */
    font-weight: 600;
    line-height: 1.3;
    color: var(--text-color);
    margin: 0 0 20px 0;
    text-align: center;  /* Center the title */
}

.product-meta-header {
    display: flex;
    flex-wrap: wrap;
    gap: 30px;  /* More spacing */
    padding: 25px;
    background-color: var(--section-bg);
    border-radius: 8px;
    margin-bottom: 30px;
    justify-content: center;  /* Center meta items */
}

.product-meta-header .meta-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
    align-items: center;  /* Center within each item */
}

.meta-label {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.meta-value {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-color);
}

/* Product Description - Better readability with max-width */
.product-description {
    line-height: 1.4;  /* Slightly more line height */
    color: var(--text-color);
    margin-bottom: 30px;
    max-width: 900px;  /* Limit width for readability */
    margin-left: auto;
    margin-right: auto;
}

.product-description p {
    margin-bottom: 12px;
}

.product-description ul,
.product-description ol {
    padding-left: 30px;
    margin-bottom: 18px;
}

.product-description li {
    margin-bottom: 10px;
}

.product-description strong,
.product-description b {
    font-weight: 600;
    color: var(--text-color);
}

.product-description a {
    color: var(--primary-color);
    text-decoration: underline;
}

.product-description img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 20px auto;
    display: block;  /* Center images */
}

/* Video Container */
.video_pub {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
    max-width: 900px;  /* Limit width */
    margin-top: 10px;
    margin-bottom: 10px;
    border-radius: 8px;
}

.video_pub iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
    border-radius: 8px;
}

/* Specifications - Centered and limited width */
.product-specifications {
    /* margin: 30px auto; */
    padding: 15px; 
    max-width: 1200px;
    border-top: 1px solid var(--border-color);
}

.product-specifications h2 {
    font-size: 24px;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 20px;
    text-align: center;
}

.specs-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background-color: var(--card-bg);
    border-radius: 8px;
    overflow: hidden;
    /* box-shadow: var(--shadow-sm); */
}

.specs-table tbody tr {
    border-bottom: 1px solid var(--border-color);
}

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

.specs-table th,
.specs-table td {
    font-size: 14px;
}
.specs-table th {
    width: 35%;  /* Slightly less width for labels */
    color: #373737;
    font-weight: 500;
    /* background-color: var(--section-bg); */
    vertical-align: top;
    text-align: right;
    padding: 1px 10px;    
}

.specs-table td {
    color: var(--text-color);
    vertical-align: top;
    text-align: left;    
    padding: 1px 10px;    
}

/* Product Actions - Centered */
.product-actions {
    margin-top: 40px;
    padding-top: 30px;
    text-align: center;
    border-top: 1px solid var(--border-color);
}

.btn {
    display: inline-block;
    padding: 14px 32px;
    border-radius: 8px;
    font-weight: 500;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    font-size: 16px;
}

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

.btn-primary:hover {
    background-color: #006a33;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* Related Products - Unchanged */
.related-products {
    margin: 60px 0;
}

.related-products h2 {
    font-size: 24px;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 30px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--border-color);
}

.related-products .product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 24px;
}

.related-products .product-title {
    font-size: 16px;
    font-weight: 600;
    margin: 0 0 10px 0;
    line-height: 1.4;
    color: var(--text-color);
    text-align: left;  
}

.related-products .product-description {
    font-size: 14px;
    color: var(--text-light);
    line-height: 1.5;
    margin-bottom: 12px;
    flex-grow: 1;
    max-width: none; 
}

.related-products .product-meta {
    font-size: 12px;
    color: var(--text-light);
    padding-top: 12px;
    border-top: 1px solid var(--border-color);
}
 
.related-products .article-number,
.related-products .manufacturer-number {
    display: block;
    margin-bottom: 4px;
}

/* Responsive Design */

/* Tablet */
@media (max-width: 992px) {
    .main-image {
        padding: 25px;
        /* aspect-ratio: 1 / 1; */
        max-height: 500px;
    }
    
    .thumbnail {
        flex: 0 0 70px;
        width: 70px;
        height: 70px;
    }
    
    .product-title {
        font-size: 28px;
    }
    
    .product-description,
    .product-specifications,
    .video_pub {
        max-width: 100%;  /* Full width on smaller screens */
    }
    
    .related-products .product-grid {
        grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    }
}


/* Mobile */
@media (max-width: 768px) {
    .main-image {
        padding: 20px;
        /* aspect-ratio: 1 / 1; */
        max-height: 400px;
    }
    
    .thumbnail {
        flex: 0 0 60px;
        width: 60px;
        height: 60px;
        padding: 6px;
    }
    
    .related-products .product-image {
        padding: 10px;
    }
    
    .product-title {
        font-size: 24px;
    }
    
    .product-meta-header {
        gap: 20px;
        padding: 20px;
    }
/*       
    .specs-table th,
    .specs-table td {
        padding: 12px;
        font-size: 13px;
    }
    
    .specs-table th {
        width: 40%;
    }
*/    
    .related-products .product-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: 16px;
    }
}

/* Extra Small Mobile */
@media (max-width: 576px) {
    .main-image {
        padding: 15px;
        /* aspect-ratio: 1 / 1; */
        max-height: 320px;
        border-radius: 8px;
    }
    
    .thumbnail {
        flex: 0 0 50px;
        width: 50px;
        height: 50px;
        padding: 5px;
        border-radius: 6px;
    }
    
    .product-title {
        font-size: 22px;
    }
    
    .btn {
        padding: 12px 24px;
        font-size: 14px;
    }
    
    .related-products .product-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
}
@media (prefers-reduced-motion: reduce) {
    * {
        transition: none !important;
    }
}