/* Custom Theme CSS */
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: #f8f9fa;
    color: #212529;
    overflow-x: hidden; /* Prevent horizontal scrollbar from full-width mega menu */
}

/* Navbar & Header */
.site-header {
    background-color: #fff;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

/* Overlay for Mega Menu */
.body-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5); /* Dimmed effect */
    z-index: 1010; /* Behind navbar (1020), in front of content */
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    pointer-events: none; /* Let clicks pass through when hidden */
}

/* Show Overlay when a dropdown is open (Desktop Hover) */
@media (min-width: 992px) {
    /* If we use CSS hover for menu */
    .navbar:hover ~ .body-overlay,
    .navbar .dropdown:hover ~ .body-overlay {
        /* This selector is tricky because overlay is sibling of header, not navbar. 
           But .body-overlay is before header in markup? No, I put it before header.
           If overlay is sibling of header: header:hover ~ .body-overlay works if overlay is AFTER.
           Let's check markup. Overlay is BEFORE header.
           We can't select previous sibling with CSS.
           We need JS or put overlay AFTER header.
           I will move overlay AFTER header in header.php next step or rely on JS.
           Wait, let's use JS for robustness.
        */
    }
    
    /* Hover Dropdown Logic */
    .navbar .dropdown:hover > .dropdown-menu {
        display: block;
        margin-top: 0;
    }
}

.cart-button-desktop {
    border: 1px solid #e5e5e5;
    padding: 8px 15px;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.cart-button-desktop:hover {
    background-color: #f8f9fa;
    border-color: #ccc;
}

/* Search Field Styling */
.form-control:focus {
    box-shadow: none;
    border-color: #ced4da;
}

.input-group-text {
    background-color: #f8f9fa;
    border-color: #ced4da;
}

/* Search Results General */
.search-results-container {
    border: 1px solid rgba(0,0,0,.15);
    max-height: 600px; /* Increased height for desktop grid */
    overflow-y: auto;
    background-color: #fff;
}

/* Desktop Search Specifics */
#search-results-container-desktop {
    width: 800px !important; /* Wide dropdown */
    right: 0; /* Align right if needed, or adjust via JS/HTML placement */
    left: auto;
}

/* Make sure it doesn't overflow screen on smaller desktops */
@media (max-width: 1200px) {
    #search-results-container-desktop {
        width: 100%;
        left: 0;
    }
}

.search-desktop-wrapper {
    display: flex;
    min-height: 300px;
}

.search-col-left {
    width: 30%;
    background-color: #fff;
    border-right: 1px solid #eee;
    padding: 1rem;
}

.search-col-right {
    width: 70%;
    background-color: #f8f9fa;
    padding: 1rem;
}

.search-product-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
}

.search-product-card {
    background: #fff;
    border-radius: 4px;
    overflow: hidden;
    transition: transform 0.2s;
    text-decoration: none;
    color: inherit;
    height: 100%;
    display: flex;
    flex-direction: column;
    border: 1px solid #eee; /* Added back simple border */
}

.search-product-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.05);
    color: inherit;
}

.search-product-image {
    aspect-ratio: 1 / 1;
    object-fit: cover;
    width: 100%;
    background-color: #eee;
}

.search-product-info {
    padding: 8px;
    text-align: center;
}

.search-product-title {
    font-size: 0.9rem;
    font-weight: 500;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.search-product-price {
    font-size: 0.85rem;
    color: #666;
}

/* Suggestions List */
.suggestion-link {
    display: block;
    padding: 8px 12px;
    color: #333;
    text-decoration: none;
    border-radius: 4px;
    margin-bottom: 2px;
    font-size: 0.95rem;
}

.suggestion-link:hover {
    background-color: #f1f1f1;
    color: #000;
}

/* Navigation */
.navbar-nav .nav-link {
    font-weight: 500;
    color: #333;
    padding-right: 1rem !important;
    padding-left: 1rem !important;
}

.navbar-nav .nav-link:hover {
    color: #0d6efd;
}

/* Mobile Menu Styling */
#mobileMenu .dropdown-menu {
    border: none;
    background: transparent;
    padding-left: 1rem;
}

#mobileMenu .dropdown-menu .dropdown-menu {
    display: block; /* Always show nested levels in mobile */
    position: static;
    margin-top: 0.5rem;
    margin-bottom: 0.5rem;
    border-left: 1px solid #dee2e6;
}

#mobileMenu .nav-link {
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
    font-size: 1.1rem;
}

#mobileMenu .dropdown-item {
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
    white-space: normal; /* Allow wrapping */
}

/* Mega Menu Styling */
@media (min-width: 992px) {
    /* Standard Nested Dropdown Styling (Non-Mega Menu) */
    /* Allow overflow on parent dropdowns so nested ones can be seen */
    .navbar-nav > .dropdown > .dropdown-menu {
        overflow: visible;
    }

    /* Nested Dropdown Items */
    .dropdown-menu .dropdown {
        position: relative;
    }

    /* Position the nested submenu to the right */
    .dropdown-menu .dropdown > .dropdown-menu {
        top: 0;
        left: 100%;
        margin-top: -5px; /* Slight offset to align nicely */
        margin-left: 0;
        display: none;
    }

    /* Show on hover */
    .dropdown-menu .dropdown:hover > .dropdown-menu {
        display: block;
    }

    /* Add arrow indicator to parents */
    .dropdown-menu .dropdown > .dropdown-item {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding-right: 1.5rem; /* Make room for arrow */
    }

    .dropdown-menu .dropdown > .dropdown-item::after {
        content: "";
        border: solid #999;
        border-width: 0 2px 2px 0;
        display: inline-block;
        padding: 3px;
        transform: rotate(-45deg);
        -webkit-transform: rotate(-45deg);
        margin-left: 10px;
    }
    
    .dropdown-menu .dropdown > .dropdown-item:hover::after {
        border-color: #333;
    }

    .dropdown-menu-mega {
        /* Full Viewport Width approach */
        width: 100vw !important;
        left: 50% !important;
        right: auto !important;
        transform: translateX(-50%) !important;
        
        margin-top: 0 !important;
        border-radius: 0 0 4px 4px;
        box-shadow: 0 10px 30px rgba(0,0,0,0.15) !important;
        min-height: 450px; /* Taller menu */
        padding: 0 !important; /* Reset padding to handle inner container */
        background-color: #fff;
    }
    
    .dropdown-menu-mega .container {
        padding-top: 2rem;
        padding-bottom: 2rem;
        height: 100%;
    }
    
    /* Full height row inside mega menu */
    .dropdown-menu-mega .row {
        height: 100%;
    }

    /* Make parent relative/static context correct */
    .navbar .nav-item.position-static {
        position: static !important;
    }
    
    /* Allow dropdown to escape container-fluid if needed, though viewport width handles it */
    .navbar .container-fluid {
        position: relative;
    }

    /* Custom 5-column grid class (20% width) */
    .col-lg-20 {
        flex: 0 0 20%;
        max-width: 20%;
    }
}

/* Mega Menu Promo Card (Gray Box) */
.mega-menu-card {
    background-color: #f0f0f0; /* Kaufmann-style gray */
    padding: 0 !important; /* Full bleed content */
    height: 100%;
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    transition: transform 0.2s ease;
    overflow: hidden;
    margin-top: -2rem; /* Pull up to top edge of container padding */
    margin-bottom: -2rem; /* Pull down to bottom edge */
    /* Adjust margin based on container padding to fill height */
}

/* Adjust wrapper to be simple div inside col */
.mega-menu-card-inner {
    height: 100%;
    position: relative;
    display: flex;
    flex-direction: column;
}

.mega-menu-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Overlay text on image if any */
.mega-menu-card-content {
    position: absolute;
    bottom: 20px;
    left: 20px;
    right: 20px;
    background: rgba(255,255,255,0.9);
    padding: 15px;
    text-align: center;
}

/* Mega Menu Button (Black Button) */
.mega-menu-btn {
    background-color: #000;
    color: #fff !important;
    padding: 10px 20px;
    display: inline-block;
    text-decoration: none;
    text-transform: uppercase;
    font-weight: bold;
    font-size: 0.9rem;
    margin-top: 15px;
    text-align: center;
    transition: background-color 0.2s;
}

.mega-menu-btn:hover {
    background-color: #333;
    color: #fff !important;
}

/* Menu Item styled as button */
.nav-button > a {
    background-color: #000;
    color: #fff !important;
    padding: 8px 16px !important;
    border-radius: 4px;
}

.nav-button > a:hover {
    background-color: #333;
}

/* Hero Section */
.hero-section {
    background-color: #e9ecef; /* Fallback */
    color: #fff;
    /* No global overlay here anymore, handled by content box */
    position: relative;
}

/* Desktop: Content bottom-left */
@media (min-width: 992px) {
    .hero-content-box {
        position: absolute !important;
        left: 1% !important;
        max-width: 615px; /* Lidt smallere for ikke at dække figuren */
        text-align: left !important;
        background-color: rgba(0, 0, 0, 0.75) !important; 
        backdrop-filter: blur(4px);
        border: 1px solid rgba(255,255,255,0.1);
        box-shadow: 0 20px 40px rgba(0,0,0,0.3);
    }
}

/* Mobile: Below Image (No overlap) */
@media (max-width: 991px) {
    .hero-section {
        min-height: 300px !important; /* Reduced height on mobile */
        height: 300px;
        align-items: flex-end;
    }
    
    /* We need to move the content OUT of the section on mobile via JS or flex order, 
       OR simpler: make the section taller and push content down? 
       Actually, simpler approach: Let it flow naturally below.
       But currently it's INSIDE the hero section div. 
       Let's style it to look separate.
    */
    
    .hero-section .container {
        position: absolute;
        bottom: -250px; /* Push it way down below */
        left: 0;
        right: 0;
        padding: 0;
        z-index: 10;
    }
    
    .hero-content-box {
        background-color: #222 !important; /* Solid dark bg */
        color: #fff;
        border-radius: 0 !important;
        margin: 0 !important;
        padding: 2rem !important;
        text-align: center;
        width: 100%;
    }
    
    /* Add margin to next section so it doesn't hide behind pushed content */
    .hero-section + section {
        margin-top: 250px !important;
    }
}

.hero-section h1 {
    font-weight: 800;
    letter-spacing: -1px;
}

/* Cards */
.card {
    border: none;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    border-radius: 8px;
    overflow: hidden;
    /* Flex properties for full height consistency */
    display: flex;
    flex-direction: column;
}

.card-body {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto; /* Take up remaining space */
}

/* Push last button to bottom */
.card-body .btn:last-child,
.card-body a.btn:last-child {
    margin-top: auto !important;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.1) !important;
}

.card-img-top {
    border-bottom: 1px solid #eee;
    /* Project Images on Front Page */
    aspect-ratio: 4 / 3 !important; /* Taller on desktop */
    object-fit: cover;
}

.card-title a {
    color: #333;
    transition: color 0.2s;
}

.card-title a:hover {
    color: #0d6efd;
}

/* Buttons */
.btn-primary,
.single_add_to_cart_button,
.woocommerce button.button,
.woocommerce button.button.alt,
.woocommerce a.button.alt,
.woocommerce a.button,
.woocommerce input.button.alt {
    background-color: #39a513 !important;
    border-color: #39a513 !important;
    color: #fff !important;
}

.btn-primary:hover,
.single_add_to_cart_button:hover,
.woocommerce button.button:hover,
.woocommerce button.button.alt:hover,
.woocommerce a.button.alt:hover,
.woocommerce a.button:hover,
.woocommerce input.button.alt:hover {
    background-color: #2e850f !important;
    border-color: #2e850f !important;
    color: #fff !important;
}

.btn-outline-primary {
    color: #39a513;
    border-color: #39a513;
}

.btn-outline-primary:hover {
    background-color: #39a513;
    color: #fff;
    border-color: #39a513;
}

/* Color Swatches */
.color-swatch {
    border: 2px solid #dee2e6 !important; /* Ensure border is visible for white/light colors */
    transition: transform 0.1s ease, border-color 0.1s ease;
    padding: 0;
}

.color-swatch:hover {
    border-color: #aaa !important;
}

.color-swatch.active {
    border: 3px solid #000 !important;
    transform: scale(1.1);
    box-shadow: 0 0 5px rgba(0,0,0,0.2);
}

/* Single Product */
.product-gallery-image {
    cursor: pointer;
}

/* Project Page */
.main-project-image-wrapper:hover .overlay-icon {
    opacity: 1;
}

.project-gallery-item {
    overflow: hidden;
}

.project-gallery-item img {
    transition: transform 0.3s ease;
}

.project-gallery-item:hover img {
    transform: scale(1.05);
}

/* Video Thumbnail Play Button Overlay */
.project-video-thumb {
    cursor: pointer;
}

.project-video-thumb::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.15);
    border-radius: 0.25rem;
    transition: background 0.3s ease;
    z-index: 1;
}

.project-video-thumb:hover::before {
    background: rgba(0,0,0,0.25);
}

.project-video-thumb .video-play-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
    z-index: 2;
    width: 68px;
    height: 48px;
    transition: all 0.2s ease;
}

.youtube-play-button {
    width: 100%;
    height: 100%;
    filter: drop-shadow(0 4px 8px rgba(0,0,0,0.3));
}

.project-video-thumb:hover .video-play-overlay {
    transform: translate(-50%, -50%) scale(1.2);
}

.project-video-thumb:hover .youtube-play-button {
    filter: drop-shadow(0 6px 12px rgba(0,0,0,0.4));
}

.project-video-thumb:hover .youtube-play-button path:first-child {
    fill-opacity: 0.95;
}

.transition-scale {
    transition: transform 0.3s ease;
}

.product-card:hover .transition-scale {
    transform: scale(1.05);
}

/* Footer */
.site-footer {
    background-color: #222 !important;
    color: #fff !important;
}

.site-footer a {
    color: #ddd;
}

.site-footer a:hover {
    color: #fff;
}

/* Specs Table Styling */
.project-specs-card {
    background-color: #fff !important;
    border: 1px solid #eee !important;
    box-shadow: 0 4px 12px rgba(0,0,0,0.03) !important;
    border-radius: 8px !important;
}

.project-specs-card .card-header {
    border-bottom: 1px solid #f0f0f0 !important;
    padding-bottom: 15px !important;
    margin-bottom: 10px;
}

.project-specs-card table tr {
    border-bottom: 1px solid #f9f9f9;
}

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

.project-specs-card table td {
    padding: 10px 5px !important;
    font-size: 0.95rem;
}

.project-specs-card table td.text-muted {
    color: #6c757d !important;
    font-weight: 500;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
}

/* Added to Cart Modal */
#addedToCartModal .added-product .product-image img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 4px;
}

#addedToCartModal .others-bought .card {
    transition: transform 0.2s ease;
}

#addedToCartModal .others-bought .card:hover {
    transform: translateY(-2px);
}

/* Contact Form 7 Styling */
.wpcf7-form .form-control {
    background-color: #ffffff; /* White background */
    border: 1px solid #ced4da; /* Darker border */
    padding: 12px 15px; /* Comfortable padding */
    border-radius: 6px;
    box-shadow: none; /* Reset standard shadow */
}

.wpcf7-form .form-control:focus {
    background-color: #fff;
    border-color: #ced4da;
    box-shadow: 0 0 0 4px rgba(0,0,0,0.05); /* Soft focus ring */
}

.wpcf7-form textarea.form-control {
    min-height: 150px;
    resize: vertical;
}

.wpcf7-form .wpcf7-submit {
    background-color: #222;
    color: #fff;
    border: none;
    padding: 15px 30px;
    width: 100%;
    border-radius: 50px; /* Pill shape */
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-top: 10px;
}

.wpcf7-form .wpcf7-submit:hover {
    background-color: #000;
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.15);
}

/* --- WOOCOMMERCE ARCHIVE STYLES (BAYMARD OPTIMIZED) --- */

/* Sidebar Category List */
.sidebar-category-list a {
    color: #333;
    display: block;
    padding: 4px 0;
    font-size: 0.95rem;
    transition: color 0.2s;
}

.sidebar-category-list a:hover {
    color: #0d6efd;
}

.sidebar-category-list a.fw-bold {
    color: #000;
}

/* Mobile Horizontal Scroll (Chips) */
.mobile-subcategory-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none; /* Firefox */
}

.mobile-subcategory-scroll::-webkit-scrollbar {
    display: none; /* Chrome/Safari */
}

.mobile-subcategory-scroll .btn {
    white-space: nowrap;
    border-radius: 4px !important; /* Slightly rounded square like example */
    border: 1px solid #000;
    padding: 8px 16px;
    font-weight: 500;
}

.mobile-subcategory-scroll .btn-light {
    border-color: #000; /* Dark border like example */
    background: #fff;
}

/* Filter Bar */
.filter-bar .btn-outline-dark {
    border-radius: 0;
    border: 1px solid #000;
    padding: 8px 16px;
    font-weight: 400;
}
.filter-bar .btn-outline-dark:hover,
.filter-bar .show > .btn-outline-dark {
    background-color: #f8f9fa;
    color: #000;
    border-color: #000;
}

.filter-bar .dropdown-menu {
    border-radius: 0;
    border: 1px solid #eee;
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
}

/* Checkbox styling within dropdowns */
.form-check-input:checked {
    background-color: #000;
    border-color: #000;
}

.form-check-input:focus {
    box-shadow: 0 0 0 0.25rem rgba(0, 0, 0, 0.25);
    border-color: #000;
}

