/* ══════════════════════════════════════════
   VORTEX SHOP — WooCommerce CSS Overrides
   Birobox.hr | 2026
══════════════════════════════════════════ */

/* ── Product Loop Grid — columns driven by Customizer CSS var ── */
:root { --catalog-cols: 5; --img-ratio: 1/1; }

.woocommerce ul.products,
.woocommerce-page ul.products {
  display: grid !important;
  grid-template-columns: repeat(var(--catalog-cols), 1fr) !important;
  gap: 12px !important;
  margin: 0 !important;
  padding: 0 !important;
  align-items: start !important;
}

/* ── Kill ALL clearfix pseudo-elements on the grid container ──
   WooCommerce's woocommerce-general.css adds ::before/::after with content:''
   and display:table for float clearfix. In CSS Grid these become real grid cells
   → first slot is always empty. Nuke them. */
.woocommerce ul.products::before,
.woocommerce ul.products::after,
.woocommerce-page ul.products::before,
.woocommerce-page ul.products::after,
ul.products::before,
ul.products::after {
  display: none !important;
  content: none !important;
}

/* ── Kill .clear float-break li elements ── */
.woocommerce ul.products li.clear,
.woocommerce ul.products li.products__item.clear,
.woocommerce ul.products > li:empty,
.woocommerce-page ul.products li.clear,
.woocommerce-page ul.products > li:empty,
ul.products li.clear,
ul.products > li:empty {
  display: none !important;
  width: 0 !important;
  height: 0 !important;
  padding: 0 !important;
  margin: 0 !important;
  border: 0 !important;
  overflow: hidden !important;
}

/* ══════════════════════════════════════════
   CATALOG LAYOUT — Sidebar + Grid
══════════════════════════════════════════ */
.catalog-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 24px;
  align-items: start;
  margin-top: 16px;
}

/* ── Sidebar ── */
.catalog-sidebar {
  position: sticky;
  top: 110px; /* below sticky header */
  max-height: calc(100vh - 130px);
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: #ddd #f5f5f5;
  background: #fff;
  border: 1px solid #ebebeb;
  border-radius: 6px;
}
.catalog-sidebar::-webkit-scrollbar { width: 4px; }
.catalog-sidebar::-webkit-scrollbar-thumb { background: #ddd; border-radius: 4px; }

.sb-section {
  padding: 16px 18px;
  border-bottom: 1px solid #f0f0f0;
}
.sb-section:last-child { border-bottom: none; }

.sb-title {
  font-size: 15px;
  font-weight: 700;
  color: #1a1a1a;
  margin-bottom: 4px;
}
.sb-cat-desc { font-size: 11.5px; color: #888; line-height: 1.5; }

.sb-heading {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .8px;
  text-transform: uppercase;
  color: #888;
  margin-bottom: 10px;
}
.sb-parent-link {
  font-size: 11.5px;
  color: #003da5;
  text-decoration: none;
  font-weight: 700;
}
.sb-parent-link:hover { color: #cc0000; }

.sb-cat-list { padding: 0; margin: 0; }
.sb-cat-list li { margin: 0; }
.sb-cat-list li a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 0;
  font-size: 13px;
  color: #444;
  text-decoration: none;
  border-bottom: 1px solid #f8f8f8;
  transition: color .12s;
}
.sb-cat-list li a:hover, .sb-cat-list li.active a {
  color: #cc0000;
  font-weight: 600;
}
.sb-count {
  font-size: 10.5px;
  color: #bbb;
  background: #f5f5f5;
  border-radius: 10px;
  padding: 1px 6px;
  flex-shrink: 0;
}
.sb-cat-list li.active .sb-count { background: #fff0f0; color: #cc0000; }

.sb-price-row {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}
.sb-price-row label {
  font-size: 12px;
  color: #555;
  display: flex;
  align-items: center;
  gap: 5px;
}
.sb-price-row input {
  width: 70px;
  border: 1px solid #ddd;
  border-radius: 3px;
  padding: 5px 7px;
  font-size: 12px;
  font-family: inherit;
  outline: none;
}
.sb-price-row input:focus { border-color: #003da5; }
.sb-filter-btn {
  width: 100%;
  padding: 9px;
  background: #003da5;
  color: #fff;
  border: none;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  transition: background .15s;
}
.sb-filter-btn:hover { background: #cc0000; }

/* Mobile filter toggle */
.filter-toggle {
  display: none;
  align-items: center;
  gap: 6px;
  background: #f5f5f5;
  border: 1px solid #ddd;
  border-radius: 4px;
  padding: 7px 12px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  color: #333;
  transition: background .15s;
}
.filter-toggle:hover { background: #ebebeb; }
.sidebar-close { display: none; }

/* ── Catalog Main ── */
.catalog-main { min-width: 0; }

.catalog-header {
  margin-bottom: 16px;
}
.catalog-title {
  font-size: 20px;
  font-weight: 700;
  color: #1a1a1a;
  margin-bottom: 10px;
}
.catalog-controls {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

/* ── Load More ── */
.load-more-wrap {
  margin-top: 32px;
  text-align: center;
  padding: 0 0 16px;
}
.load-more-progress {
  margin-bottom: 16px;
}
.load-more-bar {
  height: 4px;
  background: #f0f0f0;
  border-radius: 100px;
  overflow: hidden;
  margin-bottom: 8px;
}
.load-more-fill {
  height: 100%;
  background: linear-gradient(90deg, #003da5, #cc0000);
  border-radius: 100px;
  transition: width .4s ease;
}
.load-more-label {
  font-size: 12px;
  color: #888;
}
.load-more-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #fff;
  border: 2px solid #003da5;
  color: #003da5;
  padding: 11px 32px;
  border-radius: 4px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  transition: all .18s;
}
.load-more-btn:hover {
  background: #003da5;
  color: #fff;
}
.load-more-btn:disabled {
  opacity: .5;
  cursor: not-allowed;
}
.load-more-btn.loading::after {
  content: '';
  width: 14px;
  height: 14px;
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin .6s linear infinite;
  display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }
.load-more-end {
  font-size: 12px;
  color: #bbb;
  padding: 12px 0;
}

/* Product card = .pcard styling */
.woocommerce ul.products li.product,
.woocommerce-page ul.products li.product {
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  padding: 14px 12px 12px;
  display: flex !important;
  flex-direction: column;
  gap: 6px;
  cursor: pointer;
  transition: box-shadow .18s, border-color .18s, transform .18s;
  margin: 0 !important;
  float: none !important;
  width: auto !important;
  position: relative;
}

.woocommerce ul.products li.product:hover,
.woocommerce-page ul.products li.product:hover {
  box-shadow: 0 4px 16px rgba(0,0,0,.11);
  border-color: #bbb;
  transform: translateY(-3px);
}

/* Product image — aspect ratio from Customizer */
.woocommerce ul.products li.product a img,
.woocommerce-page ul.products li.product a img {
  width: 100%;
  aspect-ratio: var(--img-ratio);
  object-fit: contain;
  background: #f8f8f8;
  border-radius: 5px;
  margin-bottom: 6px;
  transition: transform .18s;
  padding: 8px;
  display: block;
}

.woocommerce ul.products li.product:hover a img {
  transform: scale(1.03);
}

/* Product title */
.woocommerce ul.products li.product .woocommerce-loop-product__title,
.woocommerce ul.products li.product h2 {
  font-size: 12px !important;
  font-weight: 400 !important;
  color: #444;
  line-height: 1.4;
  padding: 0 !important;
  margin: 0 !important;
  flex: 1;
}

/* Price */
.woocommerce ul.products li.product .price {
  font-size: 14.5px !important;
  font-weight: 700 !important;
  color: #cc0000 !important;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.woocommerce ul.products li.product .price del {
  font-size: 11.5px !important;
  color: #aaa !important;
  font-weight: 400 !important;
}

.woocommerce ul.products li.product .price ins {
  text-decoration: none;
  font-weight: 700;
  color: #cc0000;
}

/* On sale badge */
.woocommerce ul.products li.product .onsale {
  background: #cc0000;
  color: #fff;
  font-size: 9.5px;
  font-weight: 700;
  text-transform: uppercase;
  padding: 2px 6px;
  border-radius: 2px;
  letter-spacing: .4px;
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 1;
  margin: 0;
  min-height: auto;
  min-width: auto;
  line-height: 1.4;
}

/* Star ratings */
.woocommerce .star-rating {
  color: #f5a623 !important;
  font-size: 11px;
  letter-spacing: .5px;
  width: auto !important;
}

.woocommerce .star-rating::before {
  color: #f5a623 !important;
}

.woocommerce .star-rating span::before {
  color: #f5a623 !important;
}

/* Add to cart button in loop */
.woocommerce ul.products li.product .button,
.woocommerce ul.products li.product a.button {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #003da5;
  color: #fff;
  border: none;
  font-size: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  margin-left: auto;
  flex-shrink: 0;
  transition: background .15s, transform .15s;
  padding: 0;
  text-decoration: none;
}

.woocommerce ul.products li.product .button::after,
.woocommerce ul.products li.product a.button::after {
  content: '+';
  font-size: 18px;
  font-weight: 400;
  line-height: 1;
}

.woocommerce ul.products li.product .button:hover,
.woocommerce ul.products li.product a.button:hover {
  background: #cc0000;
  transform: scale(1.12);
}

/* Added to cart state */
.woocommerce ul.products li.product .added_to_cart {
  display: none !important;
}

/* Sorting / results count bar */
.woocommerce-products-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
  flex-wrap: wrap;
  gap: 10px;
}

.woocommerce-result-count {
  font-size: 13px;
  color: #666;
  margin: 0;
}

.woocommerce-ordering select {
  border: 1px solid #ddd;
  border-radius: 3px;
  padding: 6px 10px;
  font-size: 12px;
  font-family: inherit;
  outline: none;
  background: #fff;
  cursor: pointer;
}

/* ── Single Product ── */
.single-product div.product {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  margin-bottom: 40px;
}

.single-product div.product .woocommerce-product-gallery {
  position: relative;
}

.single-product div.product .woocommerce-product-gallery__image img {
  border-radius: 8px;
  border: 1px solid #e0e0e0;
  width: 100%;
  height: auto;
  object-fit: contain;
}

.single-product div.product .summary {
  padding: 0;
}

.single-product div.product .summary h1.product_title {
  font-size: 22px;
  font-weight: 700;
  color: #1a1a1a;
  margin-bottom: 10px;
  line-height: 1.3;
}

.single-product div.product .summary .price {
  font-size: 26px;
  font-weight: 800;
  color: #cc0000;
  margin-bottom: 14px;
}

.single-product div.product .summary .price del {
  font-size: 16px;
  color: #aaa;
  font-weight: 400;
}

.single-product div.product .summary .quantity input {
  border: 1px solid #ddd;
  border-radius: 3px;
  padding: 8px 12px;
  font-size: 14px;
  width: 70px;
  text-align: center;
  font-family: inherit;
}

.single-product div.product .summary .single_add_to_cart_button {
  background: #cc0000;
  color: #fff;
  border: none;
  padding: 12px 28px;
  border-radius: 3px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: background .15s, transform .12s;
  font-family: inherit;
  margin-left: 8px;
}

.single-product div.product .summary .single_add_to_cart_button:hover {
  background: #aa0000;
  transform: translateY(-1px);
}

/* Product tabs */
.woocommerce-tabs {
  margin-top: 24px;
}

.woocommerce-tabs ul.tabs {
  list-style: none;
  display: flex;
  border-bottom: 2px solid #e0e0e0;
  gap: 0;
  margin-bottom: 0;
  padding: 0;
}

.woocommerce-tabs ul.tabs li {
  padding: 0;
  margin: 0;
  background: none;
  border: none;
}

.woocommerce-tabs ul.tabs li a {
  display: block;
  padding: 10px 20px;
  font-size: 13px;
  font-weight: 600;
  color: #555;
  text-decoration: none;
  border-bottom: 2.5px solid transparent;
  transition: color .15s, border-color .15s;
  margin-bottom: -2px;
}

.woocommerce-tabs ul.tabs li.active a,
.woocommerce-tabs ul.tabs li a:hover {
  color: #cc0000;
  border-bottom-color: #cc0000;
}

.woocommerce-tabs .panel {
  padding: 20px 0;
  font-size: 14px;
  line-height: 1.7;
  color: #444;
}

/* ── Cart ── */
.woocommerce table.cart {
  width: 100%;
  border-collapse: collapse;
}

.woocommerce table.cart td,
.woocommerce table.cart th {
  padding: 12px 16px;
  border-bottom: 1px solid #f0f0f0;
  font-size: 13px;
  vertical-align: middle;
}

.woocommerce table.cart th {
  font-weight: 700;
  color: #1a1a1a;
  background: #f8f8f8;
}

.woocommerce table.cart .product-thumbnail img {
  width: 60px;
  height: 60px;
  object-fit: contain;
  border-radius: 4px;
  border: 1px solid #e0e0e0;
}

.woocommerce table.cart .product-name a {
  color: #1a1a1a;
  font-weight: 600;
  text-decoration: none;
}

.woocommerce table.cart .product-name a:hover {
  color: #cc0000;
}

.woocommerce table.cart .product-price,
.woocommerce table.cart .product-subtotal {
  color: #cc0000;
  font-weight: 700;
}

.woocommerce table.cart .quantity input {
  width: 60px;
  border: 1px solid #ddd;
  border-radius: 3px;
  padding: 6px;
  text-align: center;
  font-family: inherit;
  font-size: 13px;
}

.woocommerce .cart-collaterals {
  margin-top: 24px;
}

.woocommerce .cart_totals h2 {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 14px;
}

.woocommerce .cart_totals table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.woocommerce .cart_totals table td,
.woocommerce .cart_totals table th {
  padding: 8px 0;
  border-bottom: 1px solid #f0f0f0;
}

.woocommerce a.checkout-button,
.woocommerce .wc-proceed-to-checkout a.checkout-button {
  background: #cc0000;
  color: #fff;
  padding: 14px 28px;
  border-radius: 3px;
  font-size: 14px;
  font-weight: 700;
  display: block;
  text-align: center;
  text-decoration: none;
  margin-top: 16px;
  transition: background .15s;
}

.woocommerce a.checkout-button:hover {
  background: #aa0000;
}

/* ── Checkout ── */
.woocommerce form .form-row label {
  font-size: 13px;
  font-weight: 600;
  color: #1a1a1a;
  margin-bottom: 4px;
  display: block;
}

.woocommerce form .form-row input.input-text,
.woocommerce form .form-row select,
.woocommerce form .form-row textarea {
  border: 1px solid #ddd;
  border-radius: 3px;
  padding: 10px 12px;
  font-size: 13px;
  font-family: inherit;
  width: 100%;
  outline: none;
  transition: border-color .15s;
}

.woocommerce form .form-row input.input-text:focus,
.woocommerce form .form-row select:focus,
.woocommerce form .form-row textarea:focus {
  border-color: #003da5;
  box-shadow: 0 0 0 3px rgba(0,61,165,.1);
}

#place_order {
  background: #cc0000 !important;
  color: #fff !important;
  border: none !important;
  padding: 14px 32px !important;
  border-radius: 3px !important;
  font-size: 15px !important;
  font-weight: 700 !important;
  cursor: pointer !important;
  font-family: inherit !important;
  width: 100% !important;
  transition: background .15s !important;
}

#place_order:hover {
  background: #aa0000 !important;
}

/* ── My Account ── */
.woocommerce-MyAccount-navigation ul {
  list-style: none;
  padding: 0;
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  overflow: hidden;
}

.woocommerce-MyAccount-navigation ul li a {
  display: block;
  padding: 12px 16px;
  font-size: 13px;
  color: #333;
  text-decoration: none;
  border-bottom: 1px solid #f0f0f0;
  transition: background .15s, color .15s;
}

.woocommerce-MyAccount-navigation ul li.is-active a,
.woocommerce-MyAccount-navigation ul li a:hover {
  background: #f5f5f5;
  color: #cc0000;
}

/* Notices */
.woocommerce-message,
.woocommerce-info,
.woocommerce-error {
  border-radius: 4px;
  padding: 12px 16px;
  font-size: 13px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.woocommerce-message { background: #e6f4ed; border-left: 4px solid #007a33; color: #007a33; }
.woocommerce-info    { background: #eef3ff; border-left: 4px solid #003da5; color: #003da5; }
.woocommerce-error   { background: #fff0f0; border-left: 4px solid #cc0000; color: #cc0000; }

/* ── Responsive ── */
@media(max-width:1200px){
  .catalog-layout { grid-template-columns: 200px 1fr; gap: 16px; }
  .woocommerce ul.products,
  .woocommerce-page ul.products {
    grid-template-columns: repeat(4, 1fr) !important;
  }
}
@media(max-width:960px){
  /* Sidebar becomes slide-in overlay on tablet/mobile */
  .catalog-layout { grid-template-columns: 1fr; }
  .catalog-sidebar {
    position: fixed;
    top: 0; left: -280px;
    width: 280px; height: 100vh;
    max-height: 100vh;
    z-index: 9999;
    box-shadow: 4px 0 24px rgba(0,0,0,.18);
    transition: left .28s ease;
    border-radius: 0;
    border: none;
  }
  .catalog-sidebar.open { left: 0; }
  .sidebar-close {
    display: flex;
    position: absolute; top: 12px; right: 12px;
    background: none; border: none;
    font-size: 18px; color: #888; cursor: pointer;
    width: 32px; height: 32px;
    align-items: center; justify-content: center;
    border-radius: 50%;
  }
  .sidebar-close:hover { background: #f5f5f5; }
  .filter-toggle { display: flex; }
  .woocommerce ul.products,
  .woocommerce-page ul.products {
    grid-template-columns: repeat(3, 1fr) !important;
  }
  .single-product div.product { grid-template-columns: 1fr; gap: 24px; }
}
@media(max-width:640px){
  .woocommerce ul.products,
  .woocommerce-page ul.products {
    grid-template-columns: repeat(2, 1fr) !important;
  }
}
@media(max-width:380px){
  .woocommerce ul.products,
  .woocommerce-page ul.products {
    grid-template-columns: 1fr !important;
  }
}
