/**
 * Single Product Page Styles
 *
 * @package LightSolutions
 */

/* Product Layout */
.product-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: start;
}

.product-images {
    position: sticky;
    top: 2rem;
}

.main-image {
    margin-bottom: 1rem;
    position: relative;
}

.product-main-image {
    width: 100%;
    height: auto;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    transition: opacity 0.3s ease;
}

/* Gallery navigation arrows */
.gallery-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0,0,0,0.6);
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 1.5rem;
    cursor: pointer;
    z-index: 10;
    transition: all 0.3s;
    opacity: 0;
}

.main-image:hover .gallery-nav {
    opacity: 1;
}

.gallery-nav:hover {
    background: rgba(0,0,0,0.8);
    transform: translateY(-50%) scale(1.1);
}

.prev-btn {
    left: 10px;
}

.next-btn {
    right: 10px;
}

.image-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 0.5rem;
}

.gallery-thumb {
    cursor: pointer;
    border-radius: var(--radius-sm);
    overflow: hidden;
    transition: all var(--transition-fast);
    border: 2px solid transparent;
}

.gallery-thumb:hover {
    transform: scale(1.05);
}

.gallery-thumb.active {
    border: 3px solid var(--primary-orange);
    transform: scale(1.05);
}

.gallery-image {
    width: 100%;
    height: 80px;
    object-fit: cover;
}

.product-info {
    padding: 1rem 0;
}

.product-header {
    margin-bottom: 2rem;
}

.product-header .product-title {
    font-size: 2rem;
    font-weight: var(--font-weight-bold);
    color: var(--dark-gray);
    margin-bottom: 1rem;
    line-height: 1.2;
}

.product-sku {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
    padding: 0.75rem;
    background-color: var(--light-gray);
    border-radius: var(--radius-md);
    font-family: monospace;
}

.sku-label {
    font-weight: var(--font-weight-semibold);
    color: var(--medium-gray);
}

.sku-value {
    font-weight: var(--font-weight-bold);
    color: var(--dark-gray);
}

.single-product .copy-sku-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.25rem;
    border-radius: var(--radius-sm);
    transition: background-color var(--transition-fast);
}

.single-product .copy-sku-btn:hover {
    background-color: var(--primary-orange);
}

.product-categories {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.category-tag {
    background-color: var(--primary-orange);
    color: var(--white);
    padding: 0.5rem 1rem;
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    font-weight: var(--font-weight-semibold);
    text-decoration: none;
    transition: background-color var(--transition-fast);
}

.category-tag:hover {
    background-color: var(--primary-orange-dark);
    color: var(--white);
}

.single-product .product-price {
    margin-bottom: 2rem;
}

.price-value {
    font-size: 2rem;
    font-weight: var(--font-weight-bold);
    color: var(--primary-orange);
}

.product-description {
    margin-bottom: 2rem;
}

.product-description h3 {
    margin-bottom: 1rem;
    color: var(--dark-gray);
}

.description-content {
    color: var(--medium-gray);
    line-height: 1.6;
}

.key-specifications {
    margin-bottom: 2rem;
}

.key-specifications h3 {
    margin-bottom: 1rem;
    color: var(--dark-gray);
}

.specs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.single-product .spec-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    background-color: var(--light-gray);
    border-radius: var(--radius-md);
}

.single-product .spec-label {
    font-weight: var(--font-weight-semibold);
    color: var(--medium-gray);
}

.single-product .spec-value {
    font-weight: var(--font-weight-bold);
    color: var(--dark-gray);
}

.product-actions {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 2rem;
}

.product-actions .btn {
    text-align: center;
    justify-content: center;
    width: 100%;
}

.product-actions .btn.btn-secondary {
    background-color: transparent;
    color: var(--primary-orange);
    border: 2px solid var(--primary-orange);
}

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

/* Specifications Table */
.specifications-table {
    max-width: 800px;
    margin: 0 auto;
    background-color: var(--white);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-md);
}

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

.specifications-table tr:nth-child(even) {
    background-color: var(--light-gray);
}

.specifications-table td {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.specifications-table .spec-label {
    font-weight: var(--font-weight-semibold);
    color: var(--medium-gray);
    width: 40%;
}

.specifications-table .spec-value {
    font-weight: var(--font-weight-medium);
    color: var(--dark-gray);
}

@media (max-width: 768px) {
    .specifications-table td {
        display: block;
        width: 100%;
        padding: 0.5rem 1.5rem;
    }
    .specifications-table .spec-label {
        width: 100%;
        padding-bottom: 0.25rem;
        border-bottom: none;
    }
    .specifications-table .spec-value {
        padding-top: 0;
        border-bottom: 1px solid rgba(0, 0, 0, 0.1);
        padding-bottom: 1rem;
    }
    .specifications-table tr:nth-child(even) {
        background-color: transparent;
    }
}

/* Related Products */
.related-products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .product-layout {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .product-images {
        position: static;
    }

    .product-header .product-title {
        font-size: 1.75rem;
    }

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

    .product-actions {
        margin-top: 1rem;
    }

    .product-actions .btn {
        display: flex !important;
        width: 100% !important;
        justify-content: center;
        box-sizing: border-box;
    }

    /* Sticky CTA full width on mobile */
    .product-sticky-cta .container {
        flex-wrap: wrap;
    }

    .product-sticky-cta .btn {
        flex: 1;
        min-width: 0;
    }

    .gallery-nav {
        width: 35px;
        height: 35px;
        font-size: 1.2rem;
    }
}

/* Enhanced Spec Table */
.specs-section table {
    border-collapse: separate;
    border-spacing: 0;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    width: 100%;
}

.specs-section table tr:nth-child(even) {
    background-color: var(--light-gray);
}

.specs-section table tr:hover {
    background-color: rgba(255, 107, 53, 0.04);
}

.specs-section table td {
    padding: 0.875rem 1.25rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.specs-section table td:first-child {
    font-weight: 600;
    color: var(--dark-gray);
    width: 40%;
}

/* Sticky Contact CTA on scroll */
.product-sticky-cta {
    position: sticky;
    bottom: 0;
    background: white;
    padding: 1rem 0;
    box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.08);
    z-index: 50;
    display: none;
}

.product-sticky-cta .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.product-sticky-cta .sticky-product-name {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--dark-gray);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.product-sticky-cta .sticky-price {
    color: var(--primary-orange);
    font-weight: 700;
    font-size: 1.1rem;
    white-space: nowrap;
}

.product-sticky-cta .btn {
    white-space: nowrap;
}

@media (max-width: 768px) {
    .product-sticky-cta .sticky-product-name {
        display: none;
    }
}


/* ==========================================================================
   "Buy here" box (template-parts/buy-box.php)
   Every country × tab list is in the HTML; only the one matching the box's
   data-c / data-k is shown.
   ========================================================================== */
.buybox {
    margin: 0 0 1rem;
}

.buybox-toggle {
    display: block;
    width: 100%;
    text-align: center;
    list-style: none;
}

.buybox-toggle::-webkit-details-marker {
    display: none;
}

.buybox-toggle::after {
    content: " ▾";
}

.buybox[open] .buybox-toggle::after {
    content: " ▴";
}

.buybox-panel {
    margin-top: 0.75rem;
    padding: 1.25rem;
    border: 1px solid var(--hair);
    border-radius: var(--radius-lg);
    background: var(--paper);
}

.buybox-title {
    margin: 0 0 0.75rem;
    font-weight: var(--font-weight-semibold);
    color: var(--ink);
}

.buybox-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.buybox-tab {
    padding: 0.6rem 0.5rem;
    border: 1px solid var(--hair);
    border-radius: var(--radius-md);
    background: var(--light-gray);
    color: var(--ink-2);
    font: inherit;
    font-size: 0.875rem;
    line-height: 1.25;
    cursor: pointer;
}

.buybox[data-k="pro"] .buybox-tab[data-k="pro"],
.buybox[data-k="private"] .buybox-tab[data-k="private"] {
    border-color: var(--orange);
    background: var(--orange-faint);
    color: var(--ink);
    font-weight: var(--font-weight-semibold);
}

.buybox[data-c=""] .buybox-tabs {
    display: none;
}

.bx-list {
    display: none;
}

.buybox[data-c="dk"][data-k="pro"] .bx-list[data-c="dk"][data-k="pro"],
.buybox[data-c="dk"][data-k="private"] .bx-list[data-c="dk"][data-k="private"],
.buybox[data-c="se"][data-k="pro"] .bx-list[data-c="se"][data-k="pro"],
.buybox[data-c="se"][data-k="private"] .bx-list[data-c="se"][data-k="private"],
.buybox[data-c="no"][data-k="pro"] .bx-list[data-c="no"][data-k="pro"],
.buybox[data-c="no"][data-k="private"] .bx-list[data-c="no"][data-k="private"],
.buybox[data-c="fi"][data-k="pro"] .bx-list[data-c="fi"][data-k="pro"],
.buybox[data-c="fi"][data-k="private"] .bx-list[data-c="fi"][data-k="private"],
.buybox[data-c="de"][data-k="pro"] .bx-list[data-c="de"][data-k="pro"],
.buybox[data-c="de"][data-k="private"] .bx-list[data-c="de"][data-k="private"],
.buybox[data-c="nl"][data-k="pro"] .bx-list[data-c="nl"][data-k="pro"],
.buybox[data-c="nl"][data-k="private"] .bx-list[data-c="nl"][data-k="private"],
.buybox[data-c=""] .bx-nocountry {
    display: block;
}

.bx-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.5rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.bx-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    height: 100%;
    padding: 0.75rem 0.5rem;
    border: 1px solid var(--hair);
    border-radius: var(--radius-md);
    color: var(--ink);
    text-decoration: none;
    text-align: center;
    transition: border-color var(--transition-fast);
}

.bx-item:hover {
    border-color: var(--orange);
}

.bx-item img {
    max-width: 100%;
    max-height: 40px;
    width: auto;
    height: 40px;
    object-fit: contain;
}

.bx-name {
    font-size: 0.8125rem;
    overflow-wrap: anywhere;
}

.bx-empty {
    margin: 0;
    font-size: 0.9rem;
    color: var(--ink-2);
    overflow-wrap: anywhere;
}

.bx-countries {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-top: 1rem;
}

.bx-flag {
    padding: 0.25rem 0.5rem;
    border: 1px solid var(--hair);
    border-radius: var(--radius-sm);
    background: var(--paper);
    font-size: 1.25rem;
    line-height: 1;
    cursor: pointer;
}

.buybox[data-c="dk"] .bx-flag[data-c="dk"],
.buybox[data-c="se"] .bx-flag[data-c="se"],
.buybox[data-c="no"] .bx-flag[data-c="no"],
.buybox[data-c="fi"] .bx-flag[data-c="fi"],
.buybox[data-c="de"] .bx-flag[data-c="de"],
.buybox[data-c="nl"] .bx-flag[data-c="nl"] {
    border-color: var(--orange);
    background: var(--orange-faint);
}

.bx-note {
    margin: 0.75rem 0 0;
    font-size: 0.8125rem;
    color: var(--muted);
}
