/* ============================================
   VILCHES - Product Listing customizations
   Minimal changes, scoped selectors
   ============================================ */

/* --- Hide sidebar (moved into drawer via JS) --- */
#category #left-column,
#search #left-column,
#prices-drop #left-column,
#new-products #left-column,
#best-sales #left-column,
#manufacturer #left-column,
#supplier #left-column {
  display: none;
}

/* --- Full width: container, row, content --- */
#category #wrapper > .container,
#search #wrapper > .container,
#prices-drop #wrapper > .container,
#new-products #wrapper > .container,
#best-sales #wrapper > .container,
#manufacturer #wrapper > .container,
#supplier #wrapper > .container {
  width: 100% !important;
  max-width: 100% !important;
  padding-left: 15px;
  padding-right: 15px;
}

/* --- Hide grid/list toggle --- */
#category .display,
#search .display,
#prices-drop .display,
#new-products .display,
#best-sales .display,
#manufacturer .display,
#supplier .display {
  display: none !important;
}

#category #wrapper > .container > .row,
#search #wrapper > .container > .row,
#prices-drop #wrapper > .container > .row,
#new-products #wrapper > .container > .row,
#best-sales #wrapper > .container > .row,
#manufacturer #wrapper > .container > .row,
#supplier #wrapper > .container > .row {
  margin-left: 0;
  margin-right: 0;
}

#category #content-wrapper,
#search #content-wrapper,
#prices-drop #content-wrapper,
#new-products #content-wrapper,
#best-sales #content-wrapper,
#manufacturer #content-wrapper,
#supplier #content-wrapper {
  width: 100% !important;
  max-width: 100% !important;
  flex: 0 0 100% !important;
  padding-left: 0;
  padding-right: 0;
}

/* --- Sidebar visible inside drawer --- */
.vilches-drawer-body #left-column {
  display: block !important;
  width: 100% !important;
  padding: 0 !important;
  position: static !important;
  float: none !important;
}

.vilches-drawer-body #search_filters > p.text-uppercase {
  display: none !important;
}

.vilches-drawer-body .hidden-sm-down,
.vilches-drawer-body .facet .hidden-sm-down {
  display: block !important;
}

.vilches-drawer-body .hidden-md-up,
.vilches-drawer-body .facet .hidden-md-up {
  display: none !important;
}

.vilches-drawer-body .collapse,
.vilches-drawer-body .facet .collapse {
  display: block !important;
  height: auto !important;
}

/* --- Filter button --- */
.vilches-filter-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 14px;
  border: 1px solid #ccc;
  border-radius: 20px;
  background: #fff;
  font-size: 13px;
  color: #333;
  cursor: pointer;
  transition: all 0.2s;
  margin-right: 10px;
}

.vilches-filter-btn:hover { border-color: #333; }
.vilches-filter-btn .material-icons { font-size: 16px; }

/* ===========================================
   FILTER DRAWER
   =========================================== */
.vilches-drawer-overlay {
  display: none;
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0,0,0,0.4);
  z-index: 9998;
}

.vilches-drawer-overlay.open { display: block; }

.vilches-drawer {
  position: fixed;
  top: 0;
  left: -360px;
  width: 340px;
  height: 100%;
  background: #fff;
  z-index: 9999;
  box-shadow: 2px 0 12px rgba(0,0,0,0.15);
  transition: left 0.3s ease;
  display: flex;
  flex-direction: column;
}

.vilches-drawer.open { left: 0; }

.vilches-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid #e5e5e5;
  flex-shrink: 0;
}

.vilches-drawer-title {
  font-size: 15px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.vilches-drawer-close {
  width: 32px; height: 32px;
  border: none; background: none;
  cursor: pointer; color: #666;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
}

.vilches-drawer-close:hover { background: #f0f0f0; }

.vilches-drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 15px 20px;
}

/* --- Product grid: tighter gutters --- */
#category #js-product-list .product_list .row,
#search #js-product-list .product_list .row,
#prices-drop #js-product-list .product_list .row,
#new-products #js-product-list .product_list .row,
#best-sales #js-product-list .product_list .row,
#manufacturer #js-product-list .product_list .row,
#supplier #js-product-list .product_list .row,
.parfois-related .products .row,
.featured-products .products .row,
.product-accessories .products .row {
  margin-left: 0;
  margin-right: 0;
}

#category #js-product-list .product_list .ajax_block_product[class*="col-"],
#search #js-product-list .product_list .ajax_block_product[class*="col-"],
#prices-drop #js-product-list .product_list .ajax_block_product[class*="col-"],
#new-products #js-product-list .product_list .ajax_block_product[class*="col-"],
#best-sales #js-product-list .product_list .ajax_block_product[class*="col-"],
#manufacturer #js-product-list .product_list .ajax_block_product[class*="col-"],
#supplier #js-product-list .product_list .ajax_block_product[class*="col-"],
.parfois-related .products [class*="col-"],
.featured-products .products [class*="col-"],
.product-accessories .products [class*="col-"] {
  padding-left: 1px;
  padding-right: 1px;
  margin-bottom: 2px;
}

/* ===========================================
   PRODUCT CARD - .vilches-product-card only
   =========================================== */
.vilches-product-card .product-image {
  position: relative;
  overflow: hidden;
  background: #fff;
  aspect-ratio: 3 / 4;
}

.vilches-product-card .product-image .product-thumbnail {
  display: block;
  width: 100%;
  height: 100%;
}

/* Imagen entera, sin recorte lateral: las miniaturas son 4:5 con fondo
   blanco, el contenedor se mantiene 3:4 (misma altura de tarjeta) y
   object-fit:contain deja bandas blancas invisibles arriba/abajo. */
.vilches-product-card .product-image img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  display: block;
  transition: transform 0.4s ease;
}

.vilches-product-card:hover .product-image img {
  transform: scale(1.03);
}

/* theme.css trae ".thumbnail-container a.product-thumbnail img" con
   object-fit:cover y especificidad (0,2,2), que gana a la regla de arriba
   (0,2,1) en TODAS las tarjetas (listados y carruseles del home): la imagen
   4:5 se recortaba ~3% por cada lado dentro de la ventana 3:4. También
   anulamos el padding-bottom:125% del ancla para que la caja del enlace
   coincida con .product-image (la imagen es position:absolute respecto a
   ella). Mayor especificidad (0,3,1)/(0,3,2), sin tocar theme.css y sin
   cambiar la altura de la tarjeta. */
.vilches-product-card .product-image a.product-thumbnail {
  padding-bottom: 0;
  height: 100%;
}

.vilches-product-card .product-image a.product-thumbnail img {
  object-fit: contain;
  object-position: center;
  width: 100%;
  height: 100%;
  min-width: 0;
  background: #fff;
}

.vilches-product-card .product-flags { display: none !important; }
.vilches-product-card .product-description-short { display: none !important; }

/* Hide ALL pro3-btn buttons (quickview, cart, compare, original wishlist) */
.vilches-product-card .pro3-btn {
  display: none !important;
}

/* Title row: title on left, bookmark wishlist on right */
.vilches-product-card .vilches-title-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
  width: 100%;
}

.vilches-product-card .vilches-title-row .product-title {
  flex: 1 1 auto;
  min-width: 0;
  margin: 0;
  padding-right: 8px;
  overflow: hidden;
}

/* Bookmark wishlist next to title — Parfois-style */
.vilches-product-card .vilches-card-wishlist {
  flex: 0 0 auto;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  width: 24px;
  min-width: 24px;
  height: 24px;
  margin-top: 2px;
}

.vilches-product-card .vilches-card-wishlist .wishlist {
  display: inline-block;
  margin: 0;
}

.vilches-product-card .vilches-card-wishlist .leo-wishlist-button,
.vilches-product-card .vilches-card-wishlist .leo-wishlist-button.btn,
.vilches-product-card .vilches-card-wishlist .leo-wishlist-button.btn-product {
  width: auto !important;
  height: auto !important;
  min-width: auto;
  min-height: auto;
  padding: 0 !important;
  margin: 0 !important;
  border: none !important;
  background: none !important;
  border-radius: 0 !important;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  box-shadow: none !important;
  line-height: 1;
  opacity: 1 !important;
  visibility: visible !important;
  filter: none !important;
  transition: color 0.2s ease;
}

.vilches-product-card .vilches-card-wishlist .leo-wishlist-button:hover {
  background: none !important;
}

.vilches-product-card .vilches-card-wishlist .leo-wishlist-bt-loading {
  display: none !important;
}

.vilches-product-card .vilches-card-wishlist .name-btn-product {
  display: none !important;
}

/* Replace heart icon with bookmark_border (Material Icons E866) */
.vilches-product-card .vilches-card-wishlist .icon-wishlist {
  font-size: 0 !important;
  line-height: 1 !important;
  margin: 0 !important;
  padding: 0 !important;
  color: #1a1a1a !important;
  display: inline-block !important;
}

.vilches-product-card .vilches-card-wishlist .icon-wishlist:before {
  content: "\e867" !important; /* bookmark_border (outline) */
  font-family: "Material Icons" !important;
  font-size: 20px !important;
  line-height: 1 !important;
  color: inherit;
  display: inline-block !important;
}

.vilches-product-card .vilches-card-wishlist .leo-wishlist-button:hover .icon-wishlist {
  color: #555 !important;
}

/* Filled bookmark when added */
.vilches-product-card .vilches-card-wishlist .leo-wishlist-button.added .icon-wishlist:before {
  content: "\e866" !important; /* bookmark (filled) */
  color: #1a1a1a;
}

/* Product meta */
.vilches-product-meta {
  padding: 3px 4px 4px;
  text-align: left !important;
}

.vilches-flag {
  display: inline-block;
  font-size: 10px;
  color: #666;
  text-transform: capitalize;
}

.vilches-flag-new { color: #333; }
.vilches-flag-discount { color: #c00; }

.vilches-product-meta .product-title {
  font-size: 11px;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  text-align: left !important;
}

.vilches-product-meta .product-title a {
  color: #333;
  text-decoration: none;
}

.vilches-product-meta .product-price-and-shipping {
  font-size: 12px;
  text-align: left !important;
}

.vilches-product-meta .regular-price {
  font-size: 11px;
  color: #999;
}

.vilches-product-meta .discount-percentage {
  font-size: 10px;
  color: #c00;
}

/* ===========================================
   OWL-CAROUSEL product sections — clean look
   =========================================== */
.category-products .products-section-title,
.product-accessories .products-section-title,
.parfois-related__title {
  font-size: 16px;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  text-align: center;
  color: #1a1a1a;
  margin-bottom: 24px;
  padding-bottom: 12px;
}

.category-products .products-section-title span,
.product-accessories .products-section-title span {
  display: none;
}

/* Owl navigation arrows — minimal */
.category-products .owl-controls,
.product-accessories .owl-controls,
.parfois-related .owl-controls {
  margin-top: 12px;
  text-align: center;
}

.category-products .owl-buttons .owl-prev,
.category-products .owl-buttons .owl-next,
.product-accessories .owl-buttons .owl-prev,
.product-accessories .owl-buttons .owl-next,
.parfois-related .owl-buttons .owl-prev,
.parfois-related .owl-buttons .owl-next {
  background: none !important;
  color: #999;
  font-size: 24px;
  padding: 4px 10px;
  border: 1px solid #ddd;
  border-radius: 0;
  transition: all 0.2s;
}

.category-products .owl-buttons .owl-prev:hover,
.category-products .owl-buttons .owl-next:hover,
.product-accessories .owl-buttons .owl-prev:hover,
.product-accessories .owl-buttons .owl-next:hover,
.parfois-related .owl-buttons .owl-prev:hover,
.parfois-related .owl-buttons .owl-next:hover {
  border-color: #1a1a1a;
  color: #1a1a1a;
}

/* Owl item spacing */
.category-products .owl-carousel .owl-item,
.product-accessories .owl-carousel .owl-item,
.parfois-related .owl-carousel .owl-item {
  padding: 0 1px;
}

/* ===========================================
   RESPONSIVE
   =========================================== */
@media (max-width: 767px) {
  .vilches-drawer {
    width: 85vw;
    left: -85vw;
  }
}


/* ===========================================
   VILCHES - Swatches de color en miniaturas (estilo Parfois)
   =========================================== */
.product-miniature .product-title,
.product-miniature .product-title a {
  text-transform: uppercase;
}

.vilches-colors {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
  margin-top: 5px;
}

.vilches-color-swatch {
  display: inline-block;
  width: 14px;
  height: 14px;
  border-radius: 2px;
  border: 1px solid #ddd;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  cursor: pointer;
  transition: border-color .15s ease, transform .15s ease;
}

.vilches-color-swatch:hover {
  border-color: #1a1a1a;
  transform: scale(1.12);
}

.vilches-color-more {
  font-size: 10px;
  color: #888;
  line-height: 1;
  margin-left: 2px;
}
