/* Tabide CSS UX Builder jaoks */
.sidebar-tabs {
  width: 100%;
}
.tab-header-imgs {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  gap:  27px;
  margin-bottom: 16px;
  padding-left: 20px;
  padding-right: 0;
  width: 100%;
}
.tab-header-imgs .tab-img {
  width: 88px;
  height: 88px;
  object-fit: cover;
  border-radius: 1px;
  border: 1px solid #ececec;
  background: #fff;
  box-shadow: 0 1px 6px rgba(60,60,60,0.07);
  opacity: 0.5;
  transition: border-color 0.17s, opacity 0.2s, box-shadow 0.2s;
  display: block;
  cursor: pointer;
  margin: 0;
}
.tab-header-imgs .tab-img.active,
.tab-header-imgs .tab-img:hover {
  opacity: 1;
  border-color: #005baa;
  box-shadow: 0 0 0 2px #005baa;
  z-index: 1;
}
.tab-pane { display: none; }
.tab-pane.active { display: block; }

/* Velgede tab spetsiifiline stiil */
#tab-veljed .products {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 20px;
  margin-top: 20px;
}

#tab-veljed .woocommerce-result-count {
  margin-bottom: 10px;
  font-size: 14px;
  color: #666;
}

/* Latakko car selector stiilid tabide sees */
#tab-veljed #latakko-brand-select,
#tab-veljed #latakko-model-select {
  width: 100%;
  margin-bottom: 10px;
  padding: 8px;
  font-size: 16px;
}

#latakko-reset-btn {
    display: block;
    width: 90%;
    box-sizing: border-box;
    border: 0pt solid #333;
    border-radius: 2px;
    background: #f5f5f5;
    color: #222;
    font-size: 1.0em;
    font-weight: bold;
    margin: 15px 0 5px 0; /* 10px space above and below */
    padding: 10px 0 10px 0;
    cursor: pointer;
    transition: background 0.2s, color 0.2s, border-color 0.2s;

#tab-veljed #latakko-reset-btn:hover {
  background: #e0e0e0;
}

#tab-veljed #latakko-selection-preview {
  margin: 10px 0;
}

/* Diameetri filtrid */
#latakko-diameter-filters .latakko-diameter-checkboxes {
  margin-bottom: 18px;
  display: flex;
  gap: 18px;
  align-items: center;
  flex-wrap: wrap;
}

#latakko-diameter-filters .latakko-diameter-checkboxes strong {
  margin-right: 10px;
  font-weight: bold;
}

#latakko-diameter-filters .latakko-diameter-checkboxes label {
  margin-right: 18px;
  display: flex;
  align-items: center;
  cursor: pointer;
}

#latakko-diameter-filters .latakko-diameter-checkboxes input {
  margin-right: 6px;
}

#vehicle-plate-shortcode { margin: 16px 0 0 0; }

/* Loading spinner */
.loading-spinner {
    text-align: center;
    padding: 40px 20px;
    font-size: 16px;
    color: #666;
}

.loading-spinner p {
    margin: 0;
    animation: pulse 1.5s ease-in-out infinite alternate;
}

@keyframes pulse {
    from { opacity: 0.6; }
    to { opacity: 1; }
}

/* WooCommerce filtreerimise nupu punane stiil */
.woocommerce-ordering,
.woocommerce .woocommerce-ordering select,
.woocommerce-result-count {
    color: #e74c3c !important; /* Punane tekst */
}

/* Filtreerimise ikoon ja nupp */
.woocommerce-ordering::before,
.widget_layered_nav_filters .chosen::before {
    color: #e74c3c !important; /* Punane ikoon */
}

/* Dropdown arrow punane */
.woocommerce-ordering select {
    border-color: #e74c3c !important;
    background-image: url("data:image/svg+xml;charset=US-ASCII,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 4 5'><path fill='%23e74c3c' d='M2 0L0 2h4zM2 5L0 3h4z'/></svg>") !important;
}

/* Konkreetsem CSS filtreerimise jaoks */
.woocommerce .woocommerce-ordering select,
.woocommerce select.orderby,
form.woocommerce-ordering select {
    color: #e74c3c !important;
    border: 1px solid #e74c3c !important;
}

/* Filtreerimise tekst */
.woocommerce-result-count,
.woocommerce p.woocommerce-result-count {
    color: #e74c3c !important;
}

/* Kui on filtreerimise nupp (teemast sõltuvalt) */
button[type="submit"]:contains("FILTREERI"),
input[type="submit"][value*="filter"],
.button.filter,
.woocommerce .button.filter {
    background-color: #e74c3c !important;
    border-color: #e74c3c !important;
    color: white !important;
}

/* Hide pagination when wheels tab is active */
.wheels-tab-active .woocommerce-pagination {
    display: none !important;
}

.wheels-tab-active .woocommerce-result-count {
    /* Optionally hide result count too */
}

/* Mobile sidebar auto-close functionality */
@media (max-width: 1024px) {
    /* When conditions are met, force sidebar closed */
    .latakko-mobile-sidebar-closed .sidebar,
    .latakko-mobile-sidebar-closed .shop-sidebar,
    .latakko-mobile-sidebar-closed .woocommerce-sidebar,
    .latakko-mobile-sidebar-closed .primary-sidebar,
    .latakko-mobile-sidebar-closed .secondary-sidebar,
    .latakko-mobile-sidebar-closed .left-sidebar,
    .latakko-mobile-sidebar-closed .widget-area {
        transform: translateX(-100%) !important;
        visibility: hidden !important;
        opacity: 0 !important;
        width: 0 !important;
        margin: 0 !important;
        padding: 0 !important;
    }
    
    /* Hide sidebar backdrop/overlay when auto-closed */
    .latakko-mobile-sidebar-closed .sidebar-backdrop,
    .latakko-mobile-sidebar-closed .sidebar-overlay,
    .latakko-mobile-sidebar-closed .mobile-sidebar-overlay {
        display: none !important;
    }
    
    /* Ensure main content takes full width when sidebar is auto-closed */
    .latakko-mobile-sidebar-closed .main-content,
    .latakko-mobile-sidebar-closed .shop-content,
    .latakko-mobile-sidebar-closed .woocommerce-content,
    .latakko-mobile-sidebar-closed .content-area,
    .latakko-mobile-sidebar-closed .site-main {
        width: 100% !important;
        margin-left: 0 !important;
        max-width: 100% !important;
    }
    
    /* Additional theme-specific selectors */
    .latakko-mobile-sidebar-closed .site-content .content-area,
    .latakko-mobile-sidebar-closed .container .row .col-md-9,
    .latakko-mobile-sidebar-closed .container .row .col-lg-9 {
        width: 100% !important;
        flex: 0 0 100% !important;
        max-width: 100% !important;
    }
    
    /* Force products container to full width */
    .latakko-mobile-sidebar-closed .products,
    .latakko-mobile-sidebar-closed .woocommerce .products {
        width: 100% !important;
        max-width: 100% !important;
    }
}

/* Tablet specific adjustments */
@media (max-width: 1024px) and (min-width: 768px) {
    .latakko-mobile-sidebar-closed .sidebar {
        transform: translateX(-100%) !important;
        position: absolute !important;
        z-index: -1 !important;
    }
}

/* Phone specific adjustments */
@media (max-width: 767px) {
    .latakko-mobile-sidebar-closed .sidebar {
        transform: translateX(-100%) !important;
        position: fixed !important;
        z-index: -1 !important;
    }
    
    /* Make sure products display properly on mobile */
    .latakko-mobile-sidebar-closed .products {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)) !important;
        gap: 10px !important;
    }
}


