/* ============================================================
 * Uniclima Child Theme — Shop Sidebar + Cart Drawer + Polish
 * ------------------------------------------------------------
 * Origen: Astra Custom Layouts hook 461154
 *         "Customizer Additional CSS (Cleaned)"
 *         (action: wp_head, priority: 3000, location: basic-global)
 *
 * Migracion local (2026-04-29):
 *   - Eliminados duplicados ya cubiertos por header.css
 *     (.ucn-search-pill__field, .ucn-action-btn, .ucn-cart-badge,
 *      .ucn-navbar__inner, .ucn-logo*, .ucn-search__mobile-trigger,
 *      .ucn-nav-desktop, .ucn-actions, .ucn-action-btn--user/--menu).
 *   - Eliminados duplicados internos: 3 redefiniciones consecutivas
 *     de .widget-area.secondary y .widget_layered_nav ul li.
 *   - Conservado: redisenio sidebar shop (filtros), drawer carrito,
 *     header mobile compact, badge AGOTADO, polish checkout.
 *
 * Bytes originales (POST_CONTENT): 30.917
 * Bytes esta version: ~12 KB (sin duplicados)
 *
 * Destino sugerido en functions.php:
 *   Enqueue condicional para shop / single product / cart / checkout
 *   (ver 461154-report.md > Plan de enqueue).
 *
 * NOTA: muchas reglas conservan !important porque luchan especificidad
 * contra Astra Pro / WooCommerce defaults. Mantener salvo limpieza
 * mas profunda en una segunda iteracion.
 * ============================================================ */

/* ─── Animacion compartida (search predictive, etc.) ─── */
@keyframes ucn-pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.15); } }


/* ============================================================
 * SHOP SIDEBAR — Card-style filter widgets (2026-04-16)
 * Aplicable: post-type-archive-product, woocommerce-shop, tax-product_cat
 * ============================================================ */

/* Widget container card */
.ast-woo-sidebar-widget.widget {
  background: #fff !important;
  padding: 20px !important;
  border-radius: 12px !important;
  border: 1px solid #e5e7eb !important;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04) !important;
  margin-bottom: 16px !important;
}

.ast-woo-sidebar-widget.widget .widgettitle,
.ast-woo-sidebar-widget.widget .widget-title {
  font-size: 16px !important;
  font-weight: 600 !important;
  color: #1a1a1a !important;
  margin: 0 0 14px 0 !important;
  padding: 0 0 12px 0 !important;
  border-bottom: 1px solid #f3f4f6 !important;
  letter-spacing: -0.01em !important;
  text-transform: none !important;
}

/* ── Brand filter (layered nav) ── */
.widget_layered_nav ul,
.widget_layered_nav ul.woocommerce-widget-layered-nav-list {
  list-style: none !important;
  margin: 0 !important;
  padding: 0 !important;
}

.widget_layered_nav ul li,
.widget_layered_nav ul.woocommerce-widget-layered-nav-list li {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  padding: 8px 10px !important;
  border-radius: 6px !important;
  margin: 2px 0 !important;
  border: none !important;
  list-style: none !important;
  transition: background 150ms !important;
}

.widget_layered_nav ul li:hover {
  background: #f9fafb !important;
}

.widget_layered_nav ul li a {
  display: flex !important;
  align-items: center !important;
  flex: 1 1 auto !important;
  min-width: 0 !important;
  padding: 0 !important;
  background: transparent !important;
  color: #374151 !important;
  text-decoration: none !important;
  font-size: 14px !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
  transition: color 150ms !important;
}

.widget_layered_nav ul li:hover a {
  color: #cc0000 !important;
}

.widget_layered_nav ul li.chosen {
  background: #fef2f2 !important;
}

.widget_layered_nav ul li.chosen a {
  color: #cc0000 !important;
  font-weight: 500 !important;
}

.widget_layered_nav ul li .count,
.widget_layered_nav ul li span.count {
  color: #6b7280 !important;
  font-size: 12px !important;
  font-weight: 500 !important;
  background: #f3f4f6 !important;
  padding: 2px 8px !important;
  border-radius: 999px !important;
  margin-left: 8px !important;
  flex-shrink: 0 !important;
}

/* ── Active filters chip list ── */
.widget_layered_nav_filters ul {
  list-style: none !important;
  margin: 0 !important;
  padding: 0 !important;
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 6px !important;
}

.widget_layered_nav_filters ul li a {
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
  background: #fef2f2 !important;
  color: #cc0000 !important;
  padding: 4px 10px !important;
  border-radius: 999px !important;
  font-size: 12px !important;
  font-weight: 500 !important;
  text-decoration: none !important;
}

/* ── Price slider (jQuery UI) ── */
.widget_price_filter .price_slider_wrapper .price_slider,
.widget_price_filter .price_slider {
  background: #e5e7eb !important;
  height: 4px !important;
  border-radius: 4px !important;
  margin: 20px 4px !important;
  border: none !important;
}

.widget_price_filter .ui-slider-range {
  background: #cc0000 !important;
  border-radius: 4px !important;
  height: 4px !important;
  border: none !important;
}

.widget_price_filter .ui-slider-handle {
  background: #cc0000 !important;
  border: 2px solid #fff !important;
  border-radius: 50% !important;
  width: 18px !important;
  height: 18px !important;
  top: -7px !important;
  margin-left: -9px !important;
  box-shadow: 0 2px 6px rgba(204, 0, 0, 0.3) !important;
  cursor: pointer !important;
}

.widget_price_filter .price_slider_amount {
  display: flex !important;
  justify-content: space-between !important;
  align-items: center !important;
  flex-wrap: wrap !important;
  gap: 10px !important;
  margin-top: 14px !important;
}

.widget_price_filter .price_slider_amount .price_label {
  font-size: 13px !important;
  color: #374151 !important;
  flex: 1 1 auto !important;
  font-weight: 500 !important;
}

.widget_price_filter .price_slider_amount .price_label .from,
.widget_price_filter .price_slider_amount .price_label .to {
  color: #cc0000 !important;
  font-weight: 600 !important;
}

.widget_price_filter .price_slider_amount button.button {
  background: #cc0000 !important;
  color: #fff !important;
  padding: 8px 18px !important;
  border-radius: 8px !important;
  border: none !important;
  font-size: 13px !important;
  font-weight: 500 !important;
  text-transform: none !important;
  letter-spacing: 0 !important;
  cursor: pointer !important;
  transition: background 150ms !important;
}

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

/* ── Product Categories widget — same look as brand filter ── */
.widget_product_categories ul,
.widget_product_categories ul.product-categories {
  list-style: none !important;
  margin: 0 !important;
  padding: 0 !important;
}

.widget_product_categories ul li,
.widget_product_categories ul.product-categories li.cat-item {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  padding: 8px 10px !important;
  border-radius: 6px !important;
  margin: 2px 0 !important;
  list-style: none !important;
  border: none !important;
  transition: background 150ms !important;
}

.widget_product_categories ul li:hover,
.widget_product_categories ul.product-categories li.cat-item:hover {
  background: #f9fafb !important;
}

.widget_product_categories ul li a,
.widget_product_categories ul.product-categories li.cat-item a {
  display: flex !important;
  align-items: center !important;
  flex: 1 1 auto !important;
  min-width: 0 !important;
  padding: 0 !important;
  background: transparent !important;
  color: #374151 !important;
  text-decoration: none !important;
  font-size: 14px !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
  transition: color 150ms !important;
}

.widget_product_categories ul li:hover a,
.widget_product_categories ul.product-categories li.cat-item:hover a {
  color: #cc0000 !important;
}

.widget_product_categories ul li.current-cat {
  background: #fef2f2 !important;
}

.widget_product_categories ul li.current-cat a {
  color: #cc0000 !important;
  font-weight: 500 !important;
}

/* ── Custom checkbox visual on filter items ── */
.widget_layered_nav ul li a::before,
.widget_product_categories ul li.cat-item a::before {
  content: "" !important;
  display: inline-block !important;
  width: 16px !important;
  height: 16px !important;
  border: 2px solid #d1d5db !important;
  border-radius: 4px !important;
  margin-right: 10px !important;
  vertical-align: middle !important;
  flex-shrink: 0 !important;
  background: #fff !important;
  box-sizing: border-box !important;
  transition: all 150ms !important;
}

.widget_layered_nav ul li:hover a::before,
.widget_product_categories ul li.cat-item:hover a::before {
  border-color: #cc0000 !important;
}

.widget_layered_nav ul li.chosen a::before,
.widget_product_categories ul li.current-cat a::before {
  background: #cc0000 !important;
  border-color: #cc0000 !important;
}


/* ============================================================
 * SHOP LAYOUT — Container width + sticky sidebar
 * ============================================================ */
body.post-type-archive-product .site-content,
body.woocommerce-shop .site-content,
body.tax-product_cat .site-content {
  max-width: 1320px !important;
  margin-left: auto !important;
  margin-right: auto !important;
  padding-left: 24px !important;
  padding-right: 24px !important;
  box-sizing: border-box !important;
}

body.post-type-archive-product .widget-area.secondary,
body.woocommerce-shop .widget-area.secondary,
body.tax-product_cat .widget-area.secondary {
  position: sticky !important;
  top: 100px !important;
  align-self: flex-start !important;
  padding-left: 0 !important;
  padding-right: 32px !important;
  max-height: calc(100vh - 120px) !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  scrollbar-width: thin !important;
  scrollbar-color: #d1d5db transparent !important;
}

body.post-type-archive-product .widget-area.secondary::-webkit-scrollbar,
body.woocommerce-shop .widget-area.secondary::-webkit-scrollbar,
body.tax-product_cat .widget-area.secondary::-webkit-scrollbar { width: 6px !important; }

body.post-type-archive-product .widget-area.secondary::-webkit-scrollbar-thumb,
body.woocommerce-shop .widget-area.secondary::-webkit-scrollbar-thumb,
body.tax-product_cat .widget-area.secondary::-webkit-scrollbar-thumb {
  background: #e5e7eb !important;
  border-radius: 3px !important;
}


/* ============================================================
 * COLLAPSIBLE WIDGET TITLES (chevron + JS toggles .ucn-collapsed)
 * ============================================================ */
.ast-woo-sidebar-widget.widget .widgettitle,
.ast-woo-sidebar-widget.widget .widget-title {
  cursor: pointer !important;
  user-select: none !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 8px !important;
}

.ast-woo-sidebar-widget.widget .widgettitle::after,
.ast-woo-sidebar-widget.widget .widget-title::after {
  content: "" !important;
  width: 10px !important;
  height: 10px !important;
  border-right: 2px solid #6b7280 !important;
  border-bottom: 2px solid #6b7280 !important;
  transform: rotate(45deg) !important;
  transition: transform 200ms !important;
  margin-bottom: 3px !important;
  flex-shrink: 0 !important;
}

.ast-woo-sidebar-widget.widget.ucn-collapsed .widgettitle::after,
.ast-woo-sidebar-widget.widget.ucn-collapsed .widget-title::after {
  transform: rotate(-45deg) !important;
  margin-bottom: 0 !important;
  margin-top: 3px !important;
}

.ast-woo-sidebar-widget.widget.ucn-collapsed > ul,
.ast-woo-sidebar-widget.widget.ucn-collapsed > .price_slider_wrapper,
.ast-woo-sidebar-widget.widget.ucn-collapsed > .price_slider_amount,
.ast-woo-sidebar-widget.widget.ucn-collapsed > form {
  display: none !important;
}


/* ============================================================
 * SHOP SIDEBAR — Responsive (tablet + mobile)
 * ============================================================ */
@media (max-width: 1024px) {
  body.post-type-archive-product .widget-area.secondary,
  body.woocommerce-shop .widget-area.secondary,
  body.tax-product_cat .widget-area.secondary {
    position: static !important;
    top: auto !important;
    max-height: none !important;
    overflow: visible !important;
    width: 100% !important;
    padding: 0 16px !important;
    margin: 0 0 24px 0 !important;
  }

  body.post-type-archive-product .ast-woocommerce-container,
  body.woocommerce-shop .ast-woocommerce-container,
  body.tax-product_cat .ast-woocommerce-container {
    display: flex !important;
    flex-direction: column !important;
  }

  body.post-type-archive-product #secondary,
  body.woocommerce-shop #secondary,
  body.tax-product_cat #secondary { order: -1 !important; }

  body.post-type-archive-product .ast-container,
  body.woocommerce-shop .ast-container,
  body.tax-product_cat .ast-container {
    flex-direction: column !important;
  }

  .ast-woo-sidebar-widget.widget {
    padding: 14px 16px !important;
    margin-bottom: 10px !important;
  }

  .ast-woo-sidebar-widget.widget .widgettitle,
  .ast-woo-sidebar-widget.widget .widget-title {
    font-size: 15px !important;
    margin: 0 !important;
    padding: 0 !important;
    border-bottom: none !important;
  }

  .ast-woo-sidebar-widget.widget:not(.ucn-collapsed) .widgettitle,
  .ast-woo-sidebar-widget.widget:not(.ucn-collapsed) .widget-title {
    margin: 0 0 12px 0 !important;
    padding: 0 0 10px 0 !important;
    border-bottom: 1px solid #f3f4f6 !important;
  }
}

@media (max-width: 768px) {
  body.post-type-archive-product .site-content,
  body.woocommerce-shop .site-content,
  body.tax-product_cat .site-content {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }

  body.post-type-archive-product .widget-area.secondary,
  body.woocommerce-shop .widget-area.secondary,
  body.tax-product_cat .widget-area.secondary { padding: 0 !important; }

  .ast-woo-sidebar-widget.widget {
    padding: 12px 14px !important;
    border-radius: 10px !important;
  }

  .widget_layered_nav ul li a,
  .widget_product_categories ul li a { font-size: 13px !important; }

  .widget_layered_nav ul li .count,
  .widget_product_categories ul li .count { font-size: 11px !important; }
}

@media (max-width: 480px) {
  .ast-woo-sidebar-widget.widget { padding: 10px 12px !important; }

  .ast-woo-sidebar-widget.widget .widgettitle,
  .ast-woo-sidebar-widget.widget .widget-title { font-size: 14px !important; }
}


/* ============================================================
 * AGOTADO badge sobre miniaturas en grid (out-of-stock)
 * ============================================================ */
.woocommerce ul.products li.product .ast-shop-product-out-of-stock,
.woocommerce ul.products li.product .onsale + .ast-shop-product-out-of-stock {
  display: none !important;
}

.woocommerce ul.products li.product.outofstock .astra-shop-thumbnail-wrap {
  position: relative !important;
  display: block !important;
}

.woocommerce ul.products li.product.outofstock .astra-shop-thumbnail-wrap img {
  opacity: 0.45 !important;
  filter: grayscale(0.2) !important;
  transition: opacity 150ms ease !important;
}

.woocommerce ul.products li.product.outofstock .astra-shop-thumbnail-wrap::after {
  content: 'AGOTADO' !important;
  position: absolute !important;
  top: 50% !important;
  left: 50% !important;
  transform: translate(-50%, -50%) !important;
  background: rgba(17, 17, 17, 0.82) !important;
  color: #fff !important;
  padding: 7px 18px !important;
  font-weight: 700 !important;
  font-size: 13px !important;
  letter-spacing: 0.12em !important;
  border-radius: 4px !important;
  z-index: 3 !important;
  pointer-events: none !important;
  font-family: inherit !important;
}


/* ============================================================
 * SIDE CART DRAWER (2026-04-17)
 * ============================================================ */
.ucn-cart-drawer {
  position: fixed !important;
  inset: 0 !important;
  z-index: 100000 !important;
  pointer-events: none !important;
  visibility: hidden !important;
}

.ucn-cart-drawer[aria-hidden="false"] {
  pointer-events: auto !important;
  visibility: visible !important;
}

.ucn-cart-drawer__backdrop {
  position: absolute !important;
  inset: 0 !important;
  background: rgba(0, 0, 0, 0.4) !important;
  opacity: 0 !important;
  transition: opacity 250ms !important;
}

.ucn-cart-drawer[aria-hidden="false"] .ucn-cart-drawer__backdrop { opacity: 1 !important; }

.ucn-cart-drawer__panel {
  position: absolute !important;
  top: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  width: 420px !important;
  max-width: 92vw !important;
  background: #fff !important;
  display: flex !important;
  flex-direction: column !important;
  transform: translateX(100%) !important;
  transition: transform 280ms cubic-bezier(.4, 0, .2, 1) !important;
  box-shadow: -8px 0 40px rgba(0, 0, 0, 0.12) !important;
}

.ucn-cart-drawer[aria-hidden="false"] .ucn-cart-drawer__panel { transform: translateX(0) !important; }

.ucn-cart-drawer__head {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  padding: 20px 24px !important;
  border-bottom: 1px solid #f3f4f6 !important;
  flex-shrink: 0 !important;
}

.ucn-cart-drawer__title {
  margin: 0 !important;
  font-size: 18px !important;
  font-weight: 600 !important;
  color: #1a1a1a !important;
}

.ucn-cart-drawer__close {
  background: transparent !important;
  border: 0 !important;
  color: #6b7280 !important;
  font-size: 28px !important;
  line-height: 1 !important;
  cursor: pointer !important;
  width: 32px !important;
  height: 32px !important;
  border-radius: 6px !important;
  transition: background 150ms !important;
}

.ucn-cart-drawer__close:hover {
  background: #f3f4f6 !important;
  color: #cc0000 !important;
}

.ucn-cart-drawer__body {
  flex: 1 1 auto !important;
  overflow-y: auto !important;
  padding: 16px 20px !important;
}

.ucn-cart-drawer__loading,
.ucn-cart-drawer__empty {
  text-align: center !important;
  padding: 40px 16px !important;
  color: #6b7280 !important;
  font-size: 14px !important;
}

.ucn-cart-drawer__items {
  list-style: none !important;
  margin: 0 !important;
  padding: 0 !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 14px !important;
}

.ucn-cart-drawer__item {
  display: flex !important;
  align-items: center !important;
  gap: 12px !important;
  padding: 12px !important;
  border: 1px solid #f3f4f6 !important;
  border-radius: 10px !important;
}

.ucn-cart-drawer__thumb {
  width: 56px !important;
  height: 56px !important;
  object-fit: contain !important;
  background: #f9fafb !important;
  border-radius: 6px !important;
  flex-shrink: 0 !important;
}

.ucn-cart-drawer__info {
  flex: 1 1 auto !important;
  min-width: 0 !important;
}

.ucn-cart-drawer__name {
  font-size: 13px !important;
  font-weight: 500 !important;
  color: #1a1a1a !important;
  line-height: 1.3 !important;
  display: -webkit-box !important;
  -webkit-line-clamp: 2 !important;
  -webkit-box-orient: vertical !important;
  overflow: hidden !important;
}

.ucn-cart-drawer__qty {
  font-size: 12px !important;
  color: #6b7280 !important;
  margin-top: 2px !important;
}

.ucn-cart-drawer__subt {
  font-size: 14px !important;
  font-weight: 600 !important;
  color: #cc0000 !important;
  flex-shrink: 0 !important;
}

.ucn-cart-drawer__foot {
  flex-shrink: 0 !important;
  padding: 16px 20px 20px !important;
  border-top: 1px solid #f3f4f6 !important;
  background: #fafafa !important;
}

.ucn-cart-drawer__total {
  font-size: 14px !important;
  color: #6b7280 !important;
  margin-bottom: 12px !important;
  display: flex !important;
  justify-content: space-between !important;
  align-items: baseline !important;
}

.ucn-cart-drawer__total strong {
  color: #1a1a1a !important;
  font-size: 18px !important;
  font-weight: 700 !important;
}

.ucn-cart-drawer__actions {
  display: flex !important;
  flex-direction: column !important;
  gap: 8px !important;
}

.ucn-cart-drawer__btn {
  display: block !important;
  text-align: center !important;
  padding: 12px 16px !important;
  border-radius: 10px !important;
  text-decoration: none !important;
  font-size: 14px !important;
  font-weight: 600 !important;
  border: 0 !important;
  cursor: pointer !important;
  transition: all 150ms !important;
}

.ucn-cart-drawer__btn--primary {
  background: #cc0000 !important;
  color: #fff !important;
}

.ucn-cart-drawer__btn--primary:hover { background: #a00000 !important; }

.ucn-cart-drawer__btn--secondary {
  background: #fff !important;
  color: #1a1a1a !important;
  border: 1px solid #e5e7eb !important;
}

.ucn-cart-drawer__btn--secondary:hover {
  background: #f9fafb !important;
  border-color: #cc0000 !important;
  color: #cc0000 !important;
}

@media (max-width: 768px) {
  .ucn-cart-drawer__panel {
    width: 86vw !important;
    max-width: 360px !important;
  }
}

@media (max-width: 640px) {
  .ucn-cart-drawer__panel {
    width: 320px !important;
    max-width: 85vw !important;
  }
}

@media (max-width: 480px) {
  .ucn-cart-drawer__panel {
    width: 85vw !important;
    max-width: 320px !important;
  }
}


/* ============================================================
 * CHECKOUT POLISH — Order review table (2026-04-17)
 * ============================================================ */
body.woocommerce-checkout ul.woocommerce-SavedPaymentMethods {
  list-style: none !important;
  padding: 0 !important;
  margin: 0 0 12px 0 !important;
}

body.woocommerce-checkout ul.woocommerce-SavedPaymentMethods li {
  list-style: none !important;
  padding: 6px 0 !important;
}

body.woocommerce-checkout h3#order_review_heading {
  font-size: 20px !important;
  font-weight: 700 !important;
  border-bottom: 2px solid #1a1a1a !important;
  padding-bottom: 10px !important;
  margin-bottom: 14px !important;
}

body.woocommerce-checkout table.woocommerce-checkout-review-order-table {
  width: 100% !important;
  border-collapse: collapse !important;
}

body.woocommerce-checkout .woocommerce-checkout-review-order-table thead { display: none !important; }

body.woocommerce-checkout .woocommerce-checkout-review-order-table tbody td,
body.woocommerce-checkout .woocommerce-checkout-review-order-table tbody th {
  background: transparent !important;
  border-bottom: 1px solid #eee !important;
  padding: 10px 0 !important;
}

body.woocommerce-checkout .woocommerce-checkout-review-order-table tfoot tr:not(.order-total) th,
body.woocommerce-checkout .woocommerce-checkout-review-order-table tfoot tr:not(.order-total) td {
  background: transparent !important;
  color: #555 !important;
  padding: 6px 0 !important;
  border: 0 !important;
}

body.woocommerce-checkout .woocommerce-checkout-review-order-table tfoot .order-total th,
body.woocommerce-checkout .woocommerce-checkout-review-order-table tfoot .order-total td {
  background: #f5f5f5 !important;
  border-radius: 6px !important;
  padding: 12px !important;
  font-weight: 700 !important;
  border: 0 !important;
}

body.woocommerce-checkout .woocommerce-checkout-review-order-table tfoot .order-total .woocommerce-Price-amount {
  color: #cc0000 !important;
}

/* === FIN === */
