/* =====================================================
   APEX AUTO � PRODUCT ARCHIVE HERO
===================================================== */

:root {
  --apex-red: #dc2626;
  --apex-dark: #0f0f0f;
  --apex-border: #222;
  --apex-text-muted: #9ca3af;
}
/* -------------------------------------
   ARCHIVE HERO WRAPPER
------------------------------------- */
.apex-archive-hero {
  max-width: 1400px;
  margin: 40px auto 60px;
  display: grid;
  grid-template-columns: 65% 35%;
  border-radius: 22px;
  overflow: hidden;
  background: var(--apex-dark);
  border: 1px solid var(--apex-border);
}

/* -------------------------------------
   IMAGE SIDE
------------------------------------- */
.apex-archive-visual {
  height: 460px;
  position: relative;
  clip-path: polygon(0 0, 100% 0, 92% 100%, 0 100%);
}

.apex-archive-visual img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* -------------------------------------
   CONTENT SIDE
------------------------------------- */
.apex-archive-content {
  padding: 60px 50px 60px 60px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

/* -------------------------------------
   CATEGORY BADGE
------------------------------------- */
.apex-archive-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  margin-bottom: 20px;
  width: fit-content;

  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1px;
  text-transform: uppercase;

  color: #fff;
  background: rgba(220, 38, 38, 0.12);
  border: 1px solid var(--apex-red);
  border-radius: 4px;
}

/* -------------------------------------
   TITLE
------------------------------------- */
.apex-archive-title {
  font-size: 42px;
  font-weight: 900;
  text-transform: uppercase;
  line-height: 1.1;
  color: #fff;
  margin: 0 0 16px;
}

/* -------------------------------------
   DESCRIPTION
------------------------------------- */
.apex-archive-description {
  font-size: 15px;
  line-height: 1.8;
  color: var(--apex-text-muted);
  max-width: 520px;
}

/* -------------------------------------
   RESPONSIVE
------------------------------------- */
@media (max-width: 1100px) {
  .apex-archive-hero {
    grid-template-columns: 1fr;
  }

  .apex-archive-visual {
    height: 300px;
    clip-path: none;
  }

  .apex-archive-content {
    padding: 40px;
    text-align: center;
    align-items: center;
  }

  .apex-archive-description {
    max-width: 100%;
  }
}

@media (max-width: 600px) {
  .apex-archive-title {
    font-size: 30px;
  }
}

@media (max-width: 768px) {
  .apex-archive-hero {
    display: none !important;
  }

  .wc-subcats {
    margin-top: 10px !important;
  }
}

/* =====================================================
   APEXAUTO FILTERS - COMPLETE WOOCOMMERCE INTEGRATION
===================================================== */

/* Container & Box */
.apex-filters {
    width: 360px;
    padding: 24px;
}

.apex-filter-box {
    background: #fff;
    border-radius: 26px;
    padding: 28px;
    border: 1px solid #eee;
    box-shadow: 0 25px 70px rgba(0,0,0,.08);
    top: 24px;
}

/* Header & Search */
.apex-filter-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 22px;
}

.apex-filter-header i { color: #dc2626; font-size: 18px; }
.apex-filter-header h3 { font-size: 18px; font-weight: 900; margin: 0; }

.filter-search .woocommerce-product-search {
    display: grid;
    grid-template-columns: 1fr 48px;
    gap: 10px;
    margin-bottom: 26px;
}

.filter-search input[type="search"] {
    width: 100%;
    padding: 13px 16px;
    border-radius: 14px;
    border: 1px solid #ddd;
    font-size: 14px;
    outline: none;
}

.filter-search input:focus {
    border-color: #dc2626;
    box-shadow: 0 0 0 4px rgba(220, 38, 38, .1);
}

.filter-search button {
    background: #dc2626;
    border: none;
    color: #fff;
    border-radius: 14px;
    cursor: pointer;
    font-size: 16px;
    transition: 0.3s;
}

/* Accordion Logic */
.filter-section {
    border-top: 1px solid #eee;
    padding-top: 18px;
    margin-top: 18px;
}

.filter-section:first-of-type { border-top: none; padding-top: 0; margin-top: 0; }

.filter-toggle { display: none; }

.filter-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    font-size: 14px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .5px;
}

.filter-title i { font-size: 12px; transition: transform .3s ease; }

.filter-toggle:checked + label i { transform: rotate(180deg); }

.filter-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height .4s cubic-bezier(0.4, 0, 0.2, 1);
}

.filter-toggle:checked ~ .filter-content {
    max-height: 1000px; /* Dovoljno za duge liste */
    margin-top: 16px;
}

/* WooCommerce Lists (Categories & Attributes) */
.filter-content ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.filter-content ul li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    font-size: 14px;
    font-weight: 600;
    color: #111;
}

.filter-content ul li a {
    text-decoration: none;
    color: inherit;
    transition: 0.2s;
}

.filter-content ul li a:hover,
.filter-content ul li.chosen a,
.filter-content ul li.current-cat > a {
    color: #dc2626;
}

/* Subcategories Indent */
.filter-content ul.children {
    padding-left: 15px;
    border-left: 2px solid #f0f0f0;
    margin: 5px 0;
}

/* Count Pills */
.filter-content .count {
    background: #f1f1f1;
    font-size: 11px;
    font-weight: 800;
    padding: 3px 10px;
    border-radius: 20px;
    color: #64748b;
    margin-left: auto;
}

.current-cat > .count, .chosen .count {
    background: #dc2626;
    color: #fff;
}

/* WooCommerce Price Filter Slider */
.price_slider_wrapper .ui-widget-content {
    width: 85% !important;
    background: #eee !important;
    border: none !important;
    height: 6px !important;
    border-radius: 10px;
    margin: 20px 10px !important;
    position: relative !important;
}

.price_slider_wrapper .ui-slider-range {
    background: #dc2626 !important;
    position: absolute !important;
}

.price_slider_wrapper .ui-slider-handle {
    position: absolute !important;
    background: #fff !important;
    border: 3px solid #dc2626 !important;
    top: -6px !important;
    width: 18px !important;
    height: 18px !important;
    border-radius: 50% !important;
    cursor: pointer !important;
    outline: none !important;
    box-shadow: 0 3px 8px rgba(0,0,0,0.15);
}

.price_slider_amount {
    display: flex;
    flex-direction: column;
    gap: 15px;
    font-size: 14px;
    font-weight: 700;
    color: #111;
}

.price_slider_amount .button {
    background: #111 !important;
    color: #fff !important;
    border: none !important;
    padding: 12px !important;
    border-radius: 12px !important;
    font-weight: 800 !important;
    text-transform: uppercase;
    cursor: pointer;
    transition: 0.3s !important;
}

.price_slider_amount .button:hover {
    background: #dc2626 !important;
}

/* Layered Nav Checkboxes (If using "List" type) */
.wc-layered-nav-term {
    position: relative;
    padding-left: 0;
}

@media (min-width: 992px) {
  .apex-filters-close {
    display: none !important;
  }
}

/* Mobile Responsiveness */
@media (max-width: 1024px) {
    .apex-filters {
        width: 100%;
        padding: 15px;
    }

}
/* =====================================================
   FIX: HIJERARHIJA KATEGORIJA
===================================================== */

/* Osnovna (roditeljska) kategorija */
.filter-content ul li {
    flex-wrap: wrap; /* Omogućava da podkategorije idu u novi red */
    padding: 10px 0;
    font-weight: 800; /* Roditelji ostaju boldani radi kontrasta */
}

/* Podkategorije (Children) */
.filter-content ul.children {
    display: block;
    width: 100%; /* Forsira novi red ispod roditelja */
    margin-top: 8px;
    padding-left: 16px; /* Indentacija ulijevo */
    border-left: 1px solid #e2e8f0; /* Suptilna linija za nivoe */
}

.filter-content ul.children li {
    font-weight: 500 !important; /* SKIDA BOLD sa podkategorija */
    font-size: 13px; /* Malo manji font za bolju preglednost */
    padding: 5px 0;
    color: #475569;
}

/* Linkovi unutar podkategorija */
.filter-content ul.children li a {
    color: #475569;
}

.filter-content ul.children li a:hover {
    color: #dc2626;
}

/* Prilagođavanje Count brojača za podkategorije */
.filter-content ul.children .count {
    font-size: 10px;
    padding: 2px 7px;
    background: #f8fafc;
    color: #94a3b8;
}

/* Smanjenje ikone/metka ako ga WC doda */
.filter-content ul li::before {
    display: none !important; /* Brišemo defaultne tačkice */
}
/* =====================================================
   WOOCOMMERCE PAGINATION – CLEAN / BORDERLESS
===================================================== */

.woocommerce-pagination {
    margin: 40px 0 30px;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* LIST */
.woocommerce-pagination .page-numbers {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;

    list-style: none;
    padding: 0;
    margin: 0;
}

/* ITEMS */
.woocommerce-pagination .page-numbers li {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* BUTTON BASE */
.woocommerce-pagination .page-numbers a,
.woocommerce-pagination .page-numbers span {
    width: 42px;
    height: 42px;

    display: flex;
    align-items: center;
    justify-content: center;

    font-size: 16px;
    font-weight: 800;
    text-decoration: none;

    color: #111;
    background: transparent;
    border-radius: 50%;

    transition: all .25s ease;
}

/* HOVER */
.woocommerce-pagination .page-numbers a:hover {
    background: rgba(0,0,0,.06);
}

/* ACTIVE */
.woocommerce-pagination .page-numbers .current {
    background: #dc2626;
    color: #fff;
}

/* ARROWS */
.woocommerce-pagination .page-numbers .prev,
.woocommerce-pagination .page-numbers .next {
    font-size: 22px;
    font-weight: 700;
}

/* =====================================================
   MOBILE – SAME LOOK, SLIGHTLY SMALLER
===================================================== */
@media (max-width: 768px) {

    .woocommerce-pagination {
        margin: 28px 0 20px;
    }

    .woocommerce-pagination .page-numbers {
        gap: 10px;
    }

    .woocommerce-pagination .page-numbers a,
    .woocommerce-pagination .page-numbers span {
        width: 36px;
        height: 36px;
        font-size: 14px;
    }

    .woocommerce-pagination .page-numbers .prev,
    .woocommerce-pagination .page-numbers .next {
        font-size: 20px;
    }
}

/* =====================================================
   APEXAUTO MOBILE FILTER SYSTEM
   Works with existing apex-filters CSS
===================================================== */
@media (max-width: 1024px) {

    /* ===============================
       OVERLAY WRAPPER
    ================================ */
    .apex-filters {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,.65);
        z-index: 9998;
        padding: 0;
        margin: 0;
    }

    .apex-filters.active {
        display: block;
    }

    /* ===============================
       SLIDE-IN PANEL
    ================================ */
    .apex-filter-box {
        position: absolute;
        top: 0;
        right: 0;
        width: 90%;
        max-width: 420px;
        height: 100%;
        background: #fff;
        border-radius: 26px 0 0 26px;
        overflow-y: auto;
        box-shadow: -25px 0 70px rgba(0,0,0,.25);
        padding-bottom: 100px;
        animation: apexFiltersSlideIn .35s ease;
    }

    @keyframes apexFiltersSlideIn {
        from { transform: translateX(100%); }
        to   { transform: translateX(0); }
    }

    /* ===============================
       CLOSE BUTTON
    ================================ */
    .apex-filters-close {
        position: sticky;
        top: 0;
        background: #fff;
        border: none;
        width: 100%;
        padding: 16px 18px;
        font-size: 22px;
        text-align: right;
        cursor: pointer;
        z-index: 10;
    }

    .apex-filters-close i {
        color: #dc2626;
    }

    /* ===============================
       HEADER FIX
    ================================ */
    .apex-filter-header {
        margin-top: 10px;
    }

    /* ===============================
       FILTER SECTIONS
    ================================ */
    .filter-section {
        padding-top: 18px;
        margin-top: 18px;
    }

    /* ===============================
       MOBILE FILTER BUTTON
    ================================ */
    .apex-mobile-filters {
        display: flex;
        position: fixed;
        bottom: 18px;
        left: 50%;
        transform: translateX(-50%);
        z-index: 9999;
    }

    .mf-btn {
        background: #0b0b0b;
        color: #fff;
        border: 2px solid #dc2626;
        border-radius: 40px;
        padding: 14px 26px;
        display: flex;
        align-items: center;
        gap: 10px;
        font-weight: 800;
        letter-spacing: .4px;
        cursor: pointer;
        box-shadow: 0 15px 45px rgba(0,0,0,.45);
    }

    .mf-btn i {
        font-size: 18px;
        color: #dc2626;
    }

    /* ===============================
       BODY LOCK WHEN OPEN
    ================================ */
    body.apex-filters-open {
        overflow: hidden;
    }

}
/* When there are only 2 items, center them in columns 2–3 (desktop only) */
@media (min-width: 769px) {
  .wc-subcats > .wc-subcat:first-child:nth-last-child(2) {
    grid-column: 2;
  }
}

/* second item naturally goes to column 3 */



/* =====================================================
   MOBILE SUBCATEGORIES – 2 COLUMN GRID
===================================================== */
@media (max-width: 768px) {

    /* GRID WRAPPER */
    .wc-subcats {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 14px;
        margin: 0 0 24px;
        padding: 0;
    }

    /* CARD */
    .wc-subcat {
        display: flex;
        flex-direction: column;
        background: #fff;
        border-radius: 16px;
        text-decoration: none;
        color: #111;
        border: 1px solid #eee;
        overflow: hidden;
        box-shadow: 0 8px 22px rgba(0,0,0,.08);
        transition: .25s ease;
    }

    /* ACTIVE */
    .wc-subcat.active {
        border-color: #dc2626;
        box-shadow: 0 10px 26px rgba(220,38,38,.25);
    }

    /* IMAGE */
    .wc-subcat__img {
        width: 100%;
        height: 120px;
        background: #f6f6f6;
        overflow: hidden;
    }

    .wc-subcat__img img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        display: block;
    }

    /* META */
    .wc-subcat__meta {
        padding: 12px 10px;
        text-align: center;
    }

    .wc-subcat__meta h3 {
        font-size: 13px;
        font-weight: 900;
        margin: 0 0 6px;
        line-height: 1.25;
    }

    .wc-subcat__meta span {
        font-size: 11px;
        font-weight: 700;
        color: #64748b;
    }

    /* TOUCH FEEDBACK */
    .wc-subcat:active {
        transform: scale(.97);
    }

}
/* =====================================================
   MOBILE – PRODUCTS (APEX CARD)
   ONE PRODUCT PER ROW – FINAL FIX
===================================================== */
@media (max-width: 768px) {

    .wc-subcat-more {
        width: 40%!important;
    }

    .wc-products-area {
        width: calc(100vw - 24px) !important;
        max-width: calc(100vw - 24px) !important;
        margin: 0 auto !important;
        padding-left: 12px !important;
        padding-right: 12px !important;
        box-sizing: border-box !important;
        overflow-x: hidden !important;
    }

    #apex-products {
        width: calc(100vw - 24px) !important;
        max-width: calc(100vw - 24px) !important;
        margin-left: auto !important;
        margin-right: auto !important;
        overflow-x: hidden !important;
    }

    .wc-products-area .wc-topbar {
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 auto 12px !important;
        padding: 0 !important;
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        justify-content: center !important;
        gap: 8px !important;
        text-align: center !important;
    }

    .wc-products-area .wc-topbar > div {
        width: 100% !important;
        text-align: center !important;
    }

    .wc-products-area .wc-topbar .woocommerce-ordering {
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 !important;
    }

    .wc-products-area .wc-topbar .woocommerce-ordering .orderby {
        display: block !important;
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        box-sizing: border-box !important;
        margin: 0 !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
    }

    .apex-woo.wc-cat-page {
        padding-left: 10px;
        padding-right: 10px;
        box-sizing: border-box;
    }

    /* =====================================
       FORCE SINGLE COLUMN EVERYWHERE
    ====================================== */
    .wc-products-area .products,
    .wc-subcat-products .products,
    .products {
        display: grid !important;
        grid-template-columns: 1fr !important;
        gap: 16px !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    /* KILL WC FLOATS / WIDTHS */
    .products > *,
    .products li,
    .products li.product {
        float: none !important;
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 !important;
    }

    /* =====================================
       APEX PRODUCT CARD
    ====================================== */
    .apex-card {
        position: relative;
        width: 100% !important;
        max-width: 100% !important;
        display: block;
        background: #fff;
        border-radius: 16px;
        overflow: hidden;
        border: 1px solid #e5e5e5;
        box-shadow: 0 8px 22px rgba(0,0,0,.08);
        padding-bottom: 24px;
    }

    /* IMAGE */
    .apex-card .thumb img {
        width: 100%;
        height: auto;
        display: block;
        border-radius: 16px 16px 0 0;
    }

    /* BODY */
    .apex-card .body {
        padding: 14px 16px 10px;
    }

    .apex-card .body .name {
        display: block;
        font-size: 15px;
        font-weight: 800;
        line-height: 1.3;
        margin-bottom: 6px;
        color: #111;
        text-decoration: none;
    }

    .apex-card .body .price {
        font-size: 16px;
        font-weight: 900;
    }

}
.apex-filter-search {
	display: flex;
	gap: 8px;
}

.apex-filter-search input {
	flex: 1;
	padding: 10px 14px;
	border-radius: 10px;
	border: 1px solid #ddd;
}

.apex-filter-search button {
	background: #dc2626;
	color: #fff;
	border: none;
	border-radius: 10px;
	padding: 0 14px;
	cursor: pointer;
}

#wc-products-area.is-loading {
	opacity: 0.5;
	pointer-events: none;
}
