/**
 * Interactive Wine Map - Kowine Theme Styling
 * v11.3 - Met Style 6 product template support
 * 
 * Color Scheme:
 * - Theme accent: #c0a483 (golden/beige)
 * - Text color: #868686
 * - Dark/headings: #000000
 * - Border: #dadada
 */

/* =====================================================
   LAYOUT - Main Container
   ===================================================== */
.iwm-container {
    display: flex;
    gap: 20px;
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
    font-family: 'Open Sans', sans-serif;
    font-size: 14px;
    color: #868686;
    line-height: 1.75;
}

@media (max-width: 991px) {
    .iwm-container {
        flex-direction: column;
    }
}

/* =====================================================
   MAP SECTION
   ===================================================== */
.iwm-map-section {
    flex: 1;
    min-width: 0;
}

#iwm-map {
    width: 100%;
    height: 500px;
    border: 1px solid #dadada;
    background: #f5f5f5;
    z-index: 1;
    position: relative;
}

/* Zoom Controls */
.iwm-zoom-controls {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 0;
    background: #fff;
    border-radius: 4px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
    overflow: hidden;
}

.iwm-zoom-btn {
    width: 32px;
    height: 32px;
    background: #fff;
    border: none;
    cursor: pointer;
    font-size: 18px;
    font-weight: 300;
    color: #333;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.iwm-zoom-btn:hover {
    background: #f0f0f0;
}

.iwm-zoom-btn:active {
    background: #e0e0e0;
}

.iwm-zoom-in {
    border-bottom: 1px solid #e0e0e0;
}

/* Leaflet overrides */
.leaflet-container {
    font-family: 'Open Sans', sans-serif;
}

.leaflet-popup-content-wrapper {
    border-radius: 0;
    font-family: 'Open Sans', sans-serif;
}

.leaflet-popup-content {
    margin: 10px 12px;
    font-size: 13px;
    color: #000;
}

/* =====================================================
   NAVIGATION - Above Map
   ===================================================== */
.iwm-navigation {
    margin-bottom: 10px;
}

.iwm-nav-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    padding: 8px 0;
}

.iwm-nav-main {
    border-bottom: 1px solid #dadada;
}

/* Breadcrumb path */
.iwm-nav-path {
    background: #fff;
    padding: 6px 12px;
    border: 1px solid #c0a483;
    border-top: none;
    gap: 5px;
}

.iwm-nav-path .iwm-path-btn {
    background: transparent;
    border: none;
    color: #c0a483;
    padding: 0 10px;
    height: auto;
    line-height: 1.5;
}

.iwm-nav-path .iwm-path-btn:hover {
    background: transparent;
    color: #000;
    text-decoration: underline;
}

.iwm-nav-path .iwm-path-sep {
    color: #dadada;
    font-size: 14px;
}

.iwm-nav-path .iwm-path-current {
    font-family: 'Marcellus', serif;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #000;
    font-weight: 600;
}

/* Sub navigation */
.iwm-nav-sub {
    background: #f9f9f9;
    padding: 8px 12px;
    border: 1px solid #dadada;
    border-top: none;
}

.iwm-nav-continents {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-left: 12px;
    padding-left: 12px;
    border-left: 1px solid #dadada;
}

.iwm-nav-label {
    font-size: 10px;
    font-family: 'Marcellus', serif;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #868686;
    margin-right: 8px;
    white-space: nowrap;
}

/* =====================================================
   NAVIGATION BUTTONS
   ===================================================== */
.iwm-nav-btn {
    display: inline-block;
    padding: 0 12px;
    height: 28px;
    line-height: 26px;
    font-size: 11px;
    font-weight: 400;
    font-family: 'Marcellus', serif;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #000;
    background: #fff;
    border: 1px solid #dadada;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.iwm-nav-btn:hover {
    background: #c0a483;
    border-color: #c0a483;
    color: #fff;
}

.iwm-nav-btn.active {
    background: #000;
    border-color: #000;
    color: #fff;
}

.iwm-nav-world {
    padding: 0 25px;
    font-weight: 600;
}

.iwm-nav-world.active {
    background: #c0a483;
    border-color: #c0a483;
}

.iwm-count {
    font-size: 10px;
    font-weight: 400;
    opacity: 0.7;
    margin-left: 3px;
}

.iwm-nav-btn.active .iwm-count {
    opacity: 1;
}

.iwm-no-data {
    color: #868686;
    font-style: italic;
    padding: 10px;
}

/* =====================================================
   REGION INFO PANEL
   ===================================================== */
.iwm-region-info {
    background: #fff;
    border: 1px solid #dadada;
    border-radius: 4px;
    padding: 15px;
    margin-top: 15px;
}

.iwm-region-info h3 {
    font-family: 'Marcellus', serif;
    font-size: 22px;
    color: #000;
    margin: 0 0 10px 0;
}

.iwm-region-info p {
    margin: 8px 0;
    font-size: 13px;
    line-height: 1.6;
}

.iwm-wine-count {
    color: #c0a483;
    font-size: 14px !important;
}

.iwm-climate,
.iwm-soils {
    color: #666;
}

.iwm-region-desc {
    font-style: italic;
    color: #555;
    padding: 10px 0;
    border-bottom: 1px solid #eee;
}

/* Appellation Info Card */
.iwm-appellation-info {
    background: linear-gradient(135deg, #f9f7f4 0%, #f5f0ea 100%);
    border-left: 4px solid #8b0000;
    padding: 15px;
    margin-top: 15px;
    border-radius: 0 8px 8px 0;
}

.iwm-appellation-info h4 {
    font-family: 'Marcellus', serif;
    font-size: 18px;
    color: #000;
    margin: 0 0 8px 0;
}

.iwm-classification {
    display: inline-block;
    background: #8b0000;
    color: #fff;
    padding: 3px 10px;
    border-radius: 3px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
}

.iwm-grapes {
    color: #333;
}

.iwm-grapes strong {
    color: #8b0000;
}

.iwm-style {
    color: #555;
    background: rgba(192, 164, 131, 0.15);
    padding: 8px 12px;
    border-radius: 4px;
    margin: 10px 0 !important;
}

.iwm-style strong {
    color: #c0a483;
}

.iwm-app-desc {
    font-style: italic;
    color: #666;
    padding-top: 10px;
    border-top: 1px dashed #ddd;
    margin-top: 10px !important;
}

.iwm-aging {
    color: #888;
    font-size: 12px !important;
}

.iwm-aging strong {
    color: #666;
}

/* Classification colors */
.iwm-classification.docg,
.iwm-classification.aoc {
    background: linear-gradient(135deg, #722f37 0%, #8b4049 100%);
}

.iwm-classification.doc,
.iwm-classification.do {
    background: linear-gradient(135deg, #a0522d 0%, #cd853f 100%);
}

.iwm-classification.doca {
    background: linear-gradient(135deg, #5d1e0f 0%, #8b0000 100%);
}

.iwm-classification.igt,
.iwm-classification.igp {
    background: #b8860b;
}

.iwm-classification.ava,
.iwm-classification.gi,
.iwm-classification.wo {
    background: #4a6fa5;
}

/* =====================================================
   PRODUCTS SECTION
   ===================================================== */
.iwm-products-section {
    flex: 0 0 420px;
    max-width: 420px;
    min-width: 0;
}

.iwm-products-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 15px;
    padding-bottom: 12px;
    border-bottom: 1px solid #dadada;
}

.iwm-products-header h3 {
    font-family: 'Marcellus', serif;
    font-size: 16px;
    font-weight: 400;
    color: #000;
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.iwm-products-count {
    font-size: 13px;
    color: #868686;
}

/* Load More Button */
.iwm-load-more {
    display: inline-block;
    padding: 6px 16px;
    background: #000;
    color: #fff;
    border: none;
    font-size: 11px;
    font-family: 'Marcellus', serif;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-left: auto;
}

.iwm-load-more:hover {
    background: #c0a483;
}

.iwm-load-more:disabled {
    background: #ccc;
    cursor: wait;
}

/* Shop Link */
.iwm-shop-link {
    display: inline-block;
    padding: 6px 12px;
    background: transparent;
    color: #c0a483 !important;
    text-decoration: none !important;
    font-size: 11px;
    font-family: 'Marcellus', serif;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.iwm-shop-link:hover {
    color: #000 !important;
    text-decoration: underline !important;
}

/* =====================================================
   PRODUCTS GRID - Style 6 Template Styling
   ===================================================== */
.iwm-products {
    max-height: 580px;
    overflow-y: auto;
}

/* Custom scrollbar */
.iwm-products::-webkit-scrollbar {
    width: 6px;
}

.iwm-products::-webkit-scrollbar-track {
    background: #f5f5f5;
}

.iwm-products::-webkit-scrollbar-thumb {
    background: #dadada;
    border-radius: 3px;
}

.iwm-products::-webkit-scrollbar-thumb:hover {
    background: #c0a483;
}

/* Grid voor child theme template producten */
.iwm-products ul.products {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    list-style: none;
    padding: 0;
    margin: 0;
}

/* Reset WooCommerce default widths */
.iwm-products ul.products li.product {
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    float: none !important;
}

/* =====================================================
   STYLE 6 PRODUCT OVERRIDES - Compacte versie
   ===================================================== */

/* Product wrapper compacter */
.iwm-products .product-wapper {
    padding: 8px;
}

/* Kleinere product titels */
.iwm-products .product-title,
.iwm-products h3.product-title,
.iwm-products .woocommerce-loop-product__title {
    font-size: 11px !important;
    line-height: 1.3 !important;
    margin: 4px 0 !important;
    min-height: auto !important;
    max-height: 28px;
    overflow: hidden;
}

.iwm-products .product-title a {
    font-size: 11px !important;
}

/* Kleinere afbeeldingen */
.iwm-products .products-thumb {
    margin-bottom: 8px;
}

/* Prijs compacter */
.iwm-products .price {
    font-size: 12px !important;
    margin: 4px 0 !important;
}

/* Quick View subtiel */
.iwm-products .quick-view,
.iwm-products .yith-wcqv-button {
    font-size: 10px !important;
    padding: 2px 0 !important;
}

/* Quantity + Cart wrapper compacter */
.iwm-products .quantity-cart-wrapper,
.iwm-products .button-atc-quantity {
    gap: 4px !important;
    margin-top: 6px !important;
}

/* Kleinere quantity controls */
.iwm-products .quantity {
    height: 30px !important;
    min-width: auto !important;
}

.iwm-products .quantity button,
.iwm-products .quantity .minus,
.iwm-products .quantity .plus {
    width: 24px !important;
    height: 30px !important;
    font-size: 12px !important;
    min-width: 24px !important;
}

.iwm-products .quantity input.qty {
    width: 28px !important;
    height: 30px !important;
    font-size: 11px !important;
    min-width: 28px !important;
}

/* Kleinere add to cart button */
.iwm-products .add_to_cart_button,
.iwm-products .button,
.iwm-products .btn-atc {
    height: 30px !important;
    line-height: 28px !important;
    padding: 0 10px !important;
    font-size: 9px !important;
    min-width: auto !important;
}

/* Wishlist icon kleiner */
.iwm-products .wishlist-btn,
.iwm-products .tinvwl_add_to_wishlist_button,
.iwm-products .yith-wcwl-add-to-wishlist {
    width: 30px !important;
    height: 30px !important;
    min-width: 30px !important;
    font-size: 12px !important;
}

.iwm-products .wishlist-btn span,
.iwm-products .tinvwl_add_to_wishlist_button span {
    font-size: 12px !important;
}

/* Stock status compacter */
.iwm-products .stock-status-badge {
    font-size: 9px !important;
    padding: 2px 6px !important;
}

/* Sale badge kleiner */
.iwm-products .onsale {
    font-size: 9px !important;
    padding: 2px 6px !important;
}

/* =====================================================
   LOADING & EMPTY STATES
   ===================================================== */
.iwm-loading {
    text-align: center;
    padding: 60px 20px;
    color: #868686;
}

.iwm-loading::before {
    content: "";
    display: block;
    width: 40px;
    height: 40px;
    margin: 0 auto 15px;
    border: 3px solid #dadada;
    border-top-color: #c0a483;
    border-radius: 50%;
    animation: iwm-spin 1s linear infinite;
}

@keyframes iwm-spin {
    to { transform: rotate(360deg); }
}

.iwm-empty {
    text-align: center;
    padding: 40px 20px;
    color: #868686;
    font-size: 14px;
}

.iwm-empty p {
    margin: 0;
}

/* =====================================================
   LEAFLET STYLES
   ===================================================== */
.leaflet-tooltip {
    background: rgba(0, 0, 0, 0.85) !important;
    border: none !important;
    color: #fff !important;
    font-family: 'Open Sans', sans-serif !important;
    font-size: 12px !important;
    padding: 6px 10px !important;
    border-radius: 4px !important;
    box-shadow: 0 3px 10px rgba(0,0,0,0.3) !important;
}

.leaflet-tooltip-top:before {
    border-top-color: rgba(0, 0, 0, 0.85) !important;
}

/* =====================================================
   VERTICAL LAYOUT
   ===================================================== */
.iwm-container.layout-vertical {
    flex-direction: column;
}

.iwm-container.layout-vertical .iwm-products-section {
    flex: none;
    max-width: 100%;
}

.iwm-container.layout-vertical .iwm-products {
    max-height: none;
}

.iwm-container.layout-vertical .iwm-products ul.products {
    grid-template-columns: repeat(4, 1fr);
}

@media (max-width: 991px) {
    .iwm-container.layout-vertical .iwm-products ul.products {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* =====================================================
   RESPONSIVE
   ===================================================== */
@media (max-width: 991px) {
    .iwm-products-section {
        flex: none;
        max-width: 100%;
    }
}

@media (max-width: 767px) {
    .iwm-container {
        padding: 15px;
    }
    
    #iwm-map {
        height: 250px;
    }
    
    .iwm-zoom-controls {
        top: 8px;
        right: 8px;
    }
    
    .iwm-zoom-btn {
        width: 28px;
        height: 28px;
        font-size: 16px;
    }
    
    .iwm-nav-continents {
        margin-left: 0;
        padding-left: 0;
        border-left: none;
        margin-top: 8px;
        width: 100%;
    }
    
    .iwm-nav-main {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .iwm-nav-btn {
        padding: 0 8px;
        height: 26px;
        line-height: 24px;
        font-size: 10px;
    }
    
    .iwm-region-info {
        padding: 12px;
    }
    
    .iwm-region-info h3 {
        font-size: 18px;
    }
    
    .iwm-appellation-info {
        padding: 12px;
    }
    
    .iwm-appellation-info h4 {
        font-size: 16px;
    }
    
    .iwm-products ul.products {
        grid-template-columns: 1fr;
    }
    
    .iwm-products-section {
        max-width: 100%;
    }
    
    .iwm-shop-link {
        width: 100%;
        text-align: center;
        order: 3;
        padding: 10px 16px;
    }
    
    .iwm-container.layout-vertical .iwm-products ul.products {
        grid-template-columns: 1fr;
    }
}