/* APEX Child Theme - Custom Styles */
/* This file is for custom CSS overrides */

/* Hunter Style Color Scheme (Brown-Green / Forest Style) */
:root {
    --hunter-green: #4a5d23;
    --hunter-green-dark: #334215;
    --hunter-brown: #6b4c2a;
    --hunter-brown-dark: #4a331a;
    --hunter-gray: #3a3a3a;
    --hunter-gray-light: #5a5a5a;
    --hunter-accent: #8b6b3d;
    
    /* Override Bootstrap primary color */
    --bs-primary: #4a5d23;
    --bs-primary-rgb: 74, 93, 35;
}

/* Global Primary Color Override */
.btn-primary,
.bg-primary,
.badge-primary,
.alert-primary,
.text-primary,
a.text-primary {
    background-color: var(--hunter-green) !important;
    border-color: var(--hunter-green) !important;
    color: white !important;
}

.btn-primary:hover,
.btn-primary:focus,
.btn-primary:active {
    background-color: var(--hunter-green-dark) !important;
    border-color: var(--hunter-green-dark) !important;
    color: white !important;
}

.btn-outline-primary {
    color: var(--hunter-green) !important;
    border-color: var(--hunter-green) !important;
    background-color: transparent !important;
}

.btn-outline-primary:hover,
.btn-outline-primary:focus,
.btn-outline-primary:active {
    background-color: var(--hunter-green) !important;
    border-color: var(--hunter-green) !important;
    color: white !important;
}

.text-primary,
a.text-primary:hover,
a.text-primary:focus {
    color: var(--hunter-green) !important;
}

.border-primary {
    border-color: var(--hunter-green) !important;
}

/* Links */
a {
    color: var(--hunter-green);
}

a:hover,
a:focus {
    color: var(--hunter-green-dark);
}

/* Form Controls Focus */
.form-control:focus,
.form-select:focus,
input:focus,
textarea:focus,
select:focus {
    border-color: var(--hunter-green) !important;
    box-shadow: 0 0 0 0.25rem rgba(74, 93, 35, 0.25) !important;
}

/* Checkboxes and Radio Buttons */
.form-check-input:checked {
    background-color: var(--hunter-green) !important;
    border-color: var(--hunter-green) !important;
}

/* Pagination */
.pagination .page-link {
    color: var(--hunter-green);
}

.pagination .page-item.active .page-link {
    background-color: var(--hunter-green) !important;
    border-color: var(--hunter-green) !important;
}

.pagination .page-link:hover {
    color: var(--hunter-green-dark);
}

/* Progress Bars */
.progress-bar {
    background-color: var(--hunter-green) !important;
}

/* Badges */
.badge.bg-primary {
    background-color: var(--hunter-green) !important;
}

/* Alerts */
.alert-primary {
    background-color: rgba(74, 93, 35, 0.1) !important;
    border-color: var(--hunter-green) !important;
    color: var(--hunter-green-dark) !important;
}

/* Page Width Limitation */
body {
    max-width: 1700px;
    margin: 0 auto;
    background-color: #f5f5f2; /* Leichter Erdton-Hintergrund */
}

.wrapper {
    box-shadow: 0 0 20px rgba(0,0,0,0.05);
    background-color: #fff;
    min-height: auto;
}

/* Content Container Width Adjustments */
.container-fluid,
.container-xxl,
.container-xl,
.container-lg,
.container-md,
.container-sm,
.container {
    max-width: 1600px;
}

/* Navigation Overrides */
.navbar-dark .navbar-nav .nav-link {
    color: rgba(255,255,255,0.9);
}

.navbar-dark .navbar-nav .nav-link:hover,
.navbar-dark .navbar-nav .nav-link:focus {
    color: #fff;
    background-color: rgba(255,255,255,0.1);
}

/* Category Navigation */
.category-nav {
    background-color: var(--hunter-green);
}

.category-nav .nav-link {
    color: #fff;
    font-weight: 500;
    padding: 1rem 1.5rem;
}

.category-nav .nav-link:hover {
    background-color: var(--hunter-green-dark);
}

/* Product Cards */
.product-box {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    border: 1px solid #e9ecef;
}

.product-box:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.08);
}

.product-title {
    color: var(--hunter-gray);
    font-weight: 600;
}

.price {
    color: var(--hunter-green);
    font-weight: 700;
}

/* Footer Adjustments */
.footer {
    background-color: var(--hunter-green-dark);
    color: #fff;
}

.footer a {
    color: rgba(255,255,255,0.8);
}

.footer a:hover {
    color: #fff;
    text-decoration: underline;
}

/* Vendor Grid/List Specific Styles */
.vendor-box {
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.3s ease;
    height: 100%;
}

.vendor-box:hover {
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    border-color: var(--hunter-green);
}

.vendor-box a {
    color: inherit;
}

.vendor-box .card-body {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.vendor-image {
    max-width: 120px;
    margin: 0 auto 15px;
    display: block;
}

.vendor-title {
    font-weight: 600;
    text-align: center;
    margin: 0;
    color: var(--hunter-green);
}

/* Responsive adjustments */
@media (max-width: 576px) {
    .vendor-box .card-body {
        min-height: 120px;
    }
    
    .vendor-image {
        max-width: 80px;
    }
}

/* ============================================
   SIDEBAR CATEGORY NAVIGATION
   ============================================ */

/* Layout with sidebar */
.wrapper.sidebar-left-always {
    display: flex;
    flex-direction: row;
}

.sidebar-container {
    width: 280px;
    min-width: 280px;
    background: #f8f9fa;
    border-right: 1px solid #e0e0e0;
    min-height: calc(100vh - 200px);
}

.wrapper.sidebar-left-always .content {
    flex: 1;
    min-width: 0;
}

/* Sidebar Navigation */
.sidebar-nav {
    background: white;
    border-radius: 0px;
    margin: 0 15px 0 0;  
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    overflow: hidden;
}

.sidebar-nav-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: var(--hunter-brown); /* Braun für Menü-Header */
    color: white;
}

.sidebar-nav-title {
    font-weight: 600;
    font-size: 1.1rem;
}

.sidebar-nav-close {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    padding: 5px;
}

.sidebar-nav-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.sidebar-nav-item {
    border-bottom: 1px solid #f0f0f0;
}

.sidebar-nav-item:last-child {
    border-bottom: none;
}

.sidebar-nav-link-wrapper {
    display: flex;
    align-items: center;
}

.sidebar-nav-link {
    flex: 1;
    padding: 12px 15px;
    color: #333;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s ease;
}

.sidebar-nav-link:hover {
    background-color: #f8f9fa;
    color: var(--hunter-brown);
    text-decoration: none;
}

.sidebar-nav-item.active > .sidebar-nav-link-wrapper > .sidebar-nav-link {
    color: var(--hunter-brown);
    font-weight: 600;
}

.sidebar-nav-toggle {
    background: none;
    border: none;
    padding: 12px 15px;
    cursor: pointer;
    color: #666;
    transition: all 0.2s ease;
}

.sidebar-nav-toggle:hover {
    color: var(--hunter-brown);
}

.sidebar-nav-toggle .toggle-icon {
    transition: transform 0.3s ease;
}

.sidebar-nav-item.open > .sidebar-nav-link-wrapper > .sidebar-nav-toggle .toggle-icon {
    transform: rotate(180deg);
}

/* Subcategory List */
.sidebar-nav-sublist {
    list-style: none;
    margin: 0;
    padding: 0;
    background: #f8f9fa;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.sidebar-nav-sublist.show {
    max-height: 500px;
}

.sidebar-nav-subitem {
    border-top: 1px solid #eee;
}

.sidebar-nav-sublink {
    display: block;
    padding: 10px 15px 10px 30px;
    color: #555;
    text-decoration: none;
    font-size: 0.95rem;
    transition: all 0.2s ease;
}

.sidebar-nav-sublink:hover {
    background-color: #fff;
    color: var(--hunter-brown);
    padding-left: 35px;
    text-decoration: none;
}

.sidebar-nav-subitem.active > .sidebar-nav-sublink {
    color: var(--hunter-brown);
    font-weight: 600;
    background: #e8f0e3;
}

/* Mobile Navigation Toggle Button */
.mobile-nav-toggle {
    display: none;
    position: fixed;
    bottom: 20px;
    left: 20px;
    z-index: 1000;
    background: var(--hunter-brown);
    color: white;
    border: none;
    border-radius: 50px;
    padding: 12px 20px;
    font-weight: 600;
    box-shadow: 0 4px 15px rgba(107, 76, 42, 0.4);
    cursor: pointer;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
}

.mobile-nav-toggle:hover {
    background: var(--hunter-brown-dark);
    transform: translateY(-2px);
}

.mobile-nav-toggle svg {
    flex-shrink: 0;
}

/* Mobile Navigation Overlay */
.mobile-nav-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1040;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.mobile-nav-overlay.active {
    opacity: 1;
}

/* Mobile Responsive */
@media (max-width: 991px) {
    .wrapper.sidebar-left-always {
        flex-direction: column;
    }
    
    .sidebar-container {
        position: fixed;
        top: 0;
        left: -300px;
        width: 280px;
        min-width: 280px;
        height: 100vh;
        z-index: 1050;
        background: white;
        transition: left 0.3s ease;
        overflow-y: auto;
    }
    
    .sidebar-container.open {
        left: 0;
    }
    
    .mobile-nav-toggle {
        display: flex;
    }
    
    .mobile-nav-overlay.active {
        display: block;
    }
    
    .sidebar-nav {
        margin: 0;
        border-radius: 0;
        box-shadow: none;
    }
    
    .sidebar-nav-header {
        position: sticky;
        top: 0;
        z-index: 10;
    }
}

/* Desktop: Hide mobile elements */
@media (min-width: 992px) {
    .sidebar-nav-close {
        display: none;
    }
    
    .mobile-nav-toggle {
        display: none !important;
    }
    
    .mobile-nav-overlay {
        display: none !important;
    }
}

/* ============================================
   PRODUCT LIST STYLES
   ============================================ */

/* Vendor Badge in Product Listings */
.product-vendor-badge {
    margin-bottom: 8px;
}

.product-vendor-badge .vendor-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    background: var(--hunter-green);
    color: white;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s ease;
}

.product-vendor-badge .vendor-link:hover {
    background: var(--hunter-brown);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(107, 76, 42, 0.3);
    color: white;
    text-decoration: none;
}

.product-vendor-badge .vendor-icon {
    flex-shrink: 0;
}

.product-vendor-badge .vendor-name {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 150px;
}

/* Price on Request */
.price-on-request {
    color: var(--hunter-brown) !important;
    font-style: italic;
    font-weight: 600;
}

/* ============================================
   CATEGORY TILES (replacing placeholder images)
   ============================================ */

.cat-tile {
    width: 100%;
    height: 120px;
    background: var(--hunter-green);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 15px;
    position: relative;
    overflow: hidden;
}

.cat-tile::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url("data:image/svg+xml,%3Csvg width='40' height='40' viewBox='0 0 40 40' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='%23ffffff' fill-opacity='0.05'%3E%3Cpath d='M20 20l-10-10v20l10-10zm0 0l10-10v20l-10-10z'/%3E%3C/g%3E%3C/svg%3E");
    opacity: 0.3;
}

.cat-tile-title {
    position: relative;
    z-index: 1;
    color: white;
    font-weight: 600;
    font-size: 1rem;
    text-align: center;
    line-height: 1.3;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.cat-list-item:hover .cat-tile {
    transform: scale(1.02);
    box-shadow: 0 4px 15px rgba(74, 93, 35, 0.3);
}

.cat-list-item .cat-tile {
    transition: all 0.3s ease;
}

/* Hide duplicate title when using tile */
.cat-list-item:has(.cat-tile) .cat-list-item-name {
    display: none;
}

.badge {
    background: #6b4c2a;
    font-size: 10px;
    border-radius: 1px;
}

.partnersidebar {
    padding: 0 15px 0 0;
}

/* Override Highlight Button Color (Turquoise -> Green/Brown) */
.btn-highlight {
    --bs-btn-color: #fff;
    --bs-btn-bg: #4a5d23;
    --bs-btn-border-color: #4a5d23;
    --bs-btn-hover-color: #fff;
    --bs-btn-hover-bg: #3d4d1d;
    --bs-btn-hover-border-color: #3d4d1d;
    --bs-btn-focus-shadow-rgb: 74, 93, 35;
    --bs-btn-active-color: #fff;
    --bs-btn-active-bg: #354319;
    --bs-btn-active-border-color: #354319;
    --bs-btn-disabled-color: #fff;
    --bs-btn-disabled-bg: #4a5d23;
    --bs-btn-disabled-border-color: #4a5d23;
}

/* Override Global Highlight Color Variables */
:root {
    --bs-highlight: #4a5d23;
    --bs-highlight-rgb: 74, 93, 35;
}

.text-highlight {
    color: var(--bs-highlight) !important;
}

.bg-highlight {
    background-color: var(--bs-highlight) !important;
}

/* Fix any remaining turquoise/teal colors (#487C84 / #487c84) */
a {
    color: var(--bs-primary);
}

a:hover {
    color: #3d4d1d;
}

.text-teal,
.text-info {
    color: var(--bs-primary) !important;
}

.bg-teal,
.bg-info {
    background-color: var(--bs-primary) !important;
}

.border-teal,
.border-info {
    border-color: var(--bs-primary) !important;
}

.details-top {
    padding-top: 10px !important;
}
.details-top .gallery {
    margin-bottom: 20px !important;
}


/* Article Details Page Image Spacing */
.details-top {
    padding-top: 10px !important;
}
.details-top .gallery {
    margin-bottom: 20px !important;
}

.details-top {
    padding-top: 0 !important;
    margin-top: 0 !important;
}

.details-top .gallery, 
.details-top .zoom-container {
    margin-bottom: 10px !important;
}

/* Limit product image height */
.gallery .wrap {
    max-height: 700px !important;
}

/* Remove top margin for accordeon container */
.row-spacer.accordeon {
    margin-top: 0px !important;
}


@media (min-width: 768px) {
    .gallery .carousel {
        display: -webkit-box;
        display: -ms-flexbox;
        display: flex;
        -webkit-box-orient: horizontal;
        -webkit-box-direction: normal;
        -ms-flex-direction: row;
        flex-direction: row;
        position: relative;
        height: 70vh;
        width: 100%;
        max-height: 700px !important;
    }
}

/* Center logo on mobile and fix overlap */
@media (max-width: 991px) {
    .header-container {
        display: flex;
        flex-direction: column;
        align-items: center;
        text-align: center;
        padding-bottom: 15px;
    }
    .logo-link {
        justify-content: center;
        margin-bottom: 15px;
    }
    /* Hide floating brown toggle button */
    .mobile-nav-toggle {
        display: none !important;
    }
}

@media (max-width: 991px) {
    .header-box {
        height: auto !important;
        min-height: auto !important;
        padding-bottom: 10px;
    }
    .logo-link {
        display: flex !important;
        justify-content: center !important;
        width: 100% !important;
        margin: 10px auto !important;
    }
    .logo-img {
        max-width: 90% !important;
        max-height: 100px !important;
        height: auto !important;
        object-fit: contain;
    }
    #header {
        height: auto !important;
    }
}
