/*
 Theme Name: Hello Elementor Child
 Theme URI: https://setrufma.es
 Description: Tema hijo de Hello Elementor con personalizaciones de WooCommerce y diseño propio.
 Author: Albert Sas
 Template: hello-elementor
 Version: 1.0.0
 Text Domain: hello-elementor-child
*/

/* ==== Grid de categorías “tarjeta” elegante (shortcode oficial [product_categories]) ==== */
.woocommerce ul.products li.product.product-category {
  list-style: none;
  border-radius: 14px;
  overflow: hidden;
  background: #fff;
  border: 1px solid #e8e8e8;
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}

/* Enlace como contenedor visual */
.woocommerce ul.products li.product.product-category a {
  display: block;
  position: relative;
  aspect-ratio: 16 / 11; /* altura consistente de las tarjetas */
  overflow: hidden;
}

/* Imagen con zoom suave */
.woocommerce ul.products li.product.product-category a img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.02);
  transition: transform .35s ease, filter .35s ease;
  filter: brightness(.88); /* oscurece ligeramente para leer texto */
}

/* Capa oscura + degradado inferior */
.woocommerce ul.products li.product.product-category a::before{
  content:"";
  position:absolute; inset:0;
  background: linear-gradient(to top, rgba(0,0,0,.45), rgba(0,0,0,.05));
  pointer-events:none;
}

/* Título centrado */
.woocommerce ul.products li.product.product-category .woocommerce-loop-category__title{
  position: absolute;
  left: 50%; bottom: 14px;
  transform: translateX(-50%);
  margin: 0;
  padding: 8px 12px;
  background: rgba(0,0,0,.55);
  color: #fff;
  font-weight: 800;
  letter-spacing: .6px;
  text-transform: uppercase;
  border-radius: 10px;
  line-height: 1;
  font-size: clamp(13px, 2.2vw, 16px);
}

/* Hover con elevación y zoom de imagen */
.woocommerce ul.products li.product.product-category:hover{
  transform: translateY(-4px);
  border-color:#ddd;
  box-shadow: 0 12px 26px rgba(0,0,0,.08);
}
.woocommerce ul.products li.product.product-category:hover a img{
  transform: scale(1.06);
  filter: brightness(.95);
}

/* Espaciado consistente del grid */
.woocommerce ul.products{ gap: 22px; }

/* =========================
   Ajustes del diseño
   ========================= */
/* Ocultar la categoría "Sin categorizar" */
.woocommerce ul.products li.product.product-category.product_cat-uncategorized,
.woocommerce ul.products li.product.product-category.product_cat-sin-categorizar,
.woocommerce ul.products li.product.product-category[class*="product_cat-uncategorized"],
.woocommerce ul.products li.product.product-category[class*="product_cat-sin-categorizar"]{
  display:none !important;
}

/* Mostrar el número de productos */
.woocommerce ul.products li.product.product-category
  .woocommerce-loop-category__title .count{
  display:inline-block !important;
  background: rgba(0,0,0,.55);
  color:#fff !important;
  padding: 2px 8px;
  margin-left: 6px;
  border-radius: 999px;
  font-weight: 700;
  line-height: 1.2;
}

/* Responsive grid estándar */
@media (max-width: 992px){
  .woocommerce ul.products{ gap: 16px; }
}

/* =========================================================
   Tarjetas personalizadas del shortcode [setrufma_cats]
   ========================================================= */
:root{
  --brand:#c7a046;
  --text:#1f1f1f;
  --muted:#7c7c7c;
  --line:#e8e8e8;
  --radius:16px;
}

/* Grid personalizado */
.sf-catgrid{
  display:grid;
  gap:22px;
}
.sf-catgrid.sf-cols-2{ grid-template-columns: repeat(2,1fr); }
.sf-catgrid.sf-cols-3{ grid-template-columns: repeat(3,1fr); }
.sf-catgrid.sf-cols-4{ grid-template-columns: repeat(4,1fr); }
.sf-catgrid.sf-cols-5{ grid-template-columns: repeat(5,1fr); }
.sf-catgrid.sf-cols-6{ grid-template-columns: repeat(6,1fr); }

@media (max-width: 1024px){
  .sf-catgrid.sf-cols-5, .sf-catgrid.sf-cols-6{ grid-template-columns: repeat(4,1fr); }
}
/* ===== Fix responsive para shortcode [setrufma_cats] ===== */
@media (max-width: 768px) {
  .sf-catgrid {
    grid-template-columns: 1fr !important; /* siempre 1 por fila en móvil */
    gap: 20px;
  }
}


/* Tarjeta personalizada */
.sf-catcard{
  position:relative;
  display:block;
  border:1px solid var(--line);
  border-radius: var(--radius);
  overflow:hidden;
  background:#fff;
  text-decoration:none;
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.sf-catcard:hover{
  transform: translateY(-4px);
  border-color:#ddd;
  box-shadow: 0 12px 26px rgba(0,0,0,.08);
}

/* Imagen */
.sf-catcard__img{
  aspect-ratio: 16 / 11;
  background-size: cover;
  background-position: center;
  filter: brightness(.9);
  transition: transform .35s ease, filter .35s ease;
}
.sf-catcard:hover .sf-catcard__img{
  transform: scale(1.06);
  filter: brightness(.95);
}

/* Overlay */
.sf-catcard__overlay{
  position:absolute; inset:0; pointer-events:none;
  background: linear-gradient(to top, rgba(0,0,0,.48), rgba(0,0,0,.08));
}

/* Título + contador */
.sf-catcard__title{
  position:absolute; left:50%; bottom:12px; transform:translateX(-50%);
  display:flex; align-items:center; gap:8px;
  background: rgba(0,0,0,.55);
  color:#fff;
  padding:8px 12px;
  border-radius: 12px;
  font-weight:800;
  letter-spacing:.4px;
  text-transform: uppercase;
  line-height:1;
  font-size: clamp(12px, 1.9vw, 15px);
}
.sf-catcard__count{
  display:inline-block;
  padding: 2px 8px;
  border-radius:999px;
  background:#fff;
  color:#000;
  font-weight:700;
  font-size:.85em;
}

/* =========================================================
   LISTADO DE PRODUCTOS (archive-product)
   ========================================================= */

/* Tarjeta */
.woocommerce ul.products li.product{
  background:#fff;
  border:1px solid var(--line);
  border-radius:14px;
  overflow:hidden;
  padding:0 0 14px;
  transition:transform .25s ease, box-shadow .25s ease, border-color .25s ease;
  position: relative;
}
.woocommerce ul.products li.product:hover{
  transform:translateY(-4px);
  box-shadow:0 12px 24px rgba(0,0,0,.08);
  border-color:#ddd;
}

/* Imagen */
.woocommerce ul.products li.product a img{
  width:100%;
  height:auto;
  border-bottom:1px solid #eee;
  border-radius:14px 14px 0 0;
  transition:transform .35s ease, filter .35s ease;
}
.woocommerce ul.products li.product:hover a img{
  transform:scale(1.03);
  filter:brightness(.98);
}

/* Título */
.woocommerce ul.products li.product .woocommerce-loop-product__title{
  font-size:16px;
  line-height:1.3;
  margin:0;
  padding:12px 14px 4px;
  text-align:center;
  color:var(--text);
  min-height:auto;
}

/* Precio */
.woocommerce ul.products li.product .price{
  display:block;
  text-align:center;
  color:var(--text);
  font-weight:700;
  margin-bottom:10px;
}

/* Botón añadir al carrito */
.woocommerce ul.products li.product .button{
  display:block;
  margin:0 14px;
  padding:10px 14px;
  text-align:center;
  border:none;
  border-radius:10px;
  background:var(--brand);
  color:#fff;
  font-weight:600;
  transition:background .2s ease, transform .2s ease;
}
.woocommerce ul.products li.product .button:hover{
  background:#9f7f2f;
  transform:translateY(-1px);
}

/* Badge oferta */
.woocommerce span.onsale{
  background:var(--brand);
  color:#fff;
  border-radius:999px;
  padding:6px 10px;
  min-width:auto; min-height:auto;
  line-height:1;
  top:10px; left:10px;
  font-size:12px;
}

/* Paginación */
.woocommerce nav.woocommerce-pagination ul{ border:none; }
.woocommerce nav.woocommerce-pagination ul li{ border:none; margin:0 4px; }
.woocommerce nav.woocommerce-pagination ul li a,
.woocommerce nav.woocommerce-pagination ul li span{
  border:1px solid var(--line);
  border-radius:8px;
  padding:8px 12px;
}
.woocommerce nav.woocommerce-pagination ul li span.current,
.woocommerce nav.woocommerce-pagination ul li a:hover{
  background:var(--brand); color:#fff; border-color:var(--brand);
}

/* Barra superior */
.woocommerce .woocommerce-ordering select{
  padding:8px 10px;
  border:1px solid var(--line);
  border-radius:10px;
}
.woocommerce .woocommerce-result-count{
  color:var(--muted);
}

/* Responsive spacing */
@media (max-width: 992px){
  .woocommerce ul.products{ gap:16px; }
}

/* =========================================================
   Badge Setrufma en todas las tarjetas
   ========================================================= */
.woocommerce ul.products li.product {
  position: relative;
}
.woocommerce ul.products li.product::before {
  content: "Setrufma";
  position: absolute;
  top: 12px;
  left: 12px;
  background: var(--brand);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .5px;
  padding: 4px 10px;
  border-radius: 999px;
  box-shadow: 0 2px 6px rgba(0,0,0,.15);
  z-index: 5;
  text-transform: uppercase;
}

/* =========================================================
   FIX DURO – Galería y miniaturas en el single product
   ========================================================= */
.single-product div.product div.images .woocommerce-product-gallery{
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
}
.single-product div.product div.images .woocommerce-product-gallery__image img{
  max-height: 480px !important;
  width: auto !important;
  object-fit: contain !important;
  margin: 0 auto !important;
}
@media (max-width: 992px){
  .single-product div.product div.images .woocommerce-product-gallery__image img{
    max-height: 320px !important;
  }
}
.single-product div.product div.images .woocommerce-product-gallery .flex-control-nav.flex-control-thumbs{
  float: none !important;
  width: 100% !important;
  max-width: 600px !important;
  display: grid !important;
  grid-template-columns: repeat(4, 1fr) !important;
  gap: 12px !important;
  margin: 16px auto 0 !important;
  padding: 0 !important;
}
@media (max-width: 992px){
  .single-product div.product div.images .woocommerce-product-gallery .flex-control-nav.flex-control-thumbs{
    grid-template-columns: repeat(3, 1fr) !important;
  }
}
.single-product div.product div.images .woocommerce-product-gallery .flex-control-thumbs li{
  list-style: none !important;
  float: none !important;
  width: auto !important;
  margin: 0 !important;
}
.single-product div.product div.images .woocommerce-product-gallery .flex-control-thumbs img{
  width: 100% !important;
  height: 92px !important;
  object-fit: cover !important;
  border: 1px solid #e8e8e8 !important;
  border-radius: 12px !important;
  display: block !important;
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease, filter .2s ease !important;
  filter: brightness(.98) !important;
}
.single-product div.product div.images .woocommerce-product-gallery .flex-control-thumbs img:hover{
  transform: translateY(-2px) !important;
  box-shadow: 0 8px 18px rgba(0,0,0,.07) !important;
  border-color: #d9d9d9 !important;
  filter: brightness(1) !important;
}
.single-product div.product div.images .woocommerce-product-gallery .flex-control-thumbs .flex-active{
  border-color: var(--brand) !important;
  box-shadow: 0 0 0 2px rgba(199,160,70,.25) !important;
}
.single-product div.product div.images .flex-direction-nav{ display: none !important; }

/* Botón añadir al carrito */
.single-product .single_add_to_cart_button,
.woocommerce button.single_add_to_cart_button{
  background-color: var(--brand) !important;
  color: #fff !important;
  border: none !important;
  border-radius: 12px !important;
  padding: 12px 18px !important;
  font-weight: 700 !important;
  text-transform: uppercase;
}
.single-product .single_add_to_cart_button:hover,
.woocommerce button.single_add_to_cart_button:hover{
  background-color: #9f7f2f !important;
  color: #fff !important;
}

/* Categorías como chips */
.single-product .product_meta{
  margin-top: 16px;
  font-size: 14px;
  color: var(--muted);
}
.single-product .product_meta a{
  display: inline-block;
  margin: 4px 6px 0 0;
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  text-decoration: none;
  color: var(--text);
  background: #fafafa;
  transition: .2s ease;
}
.single-product .product_meta a:hover{
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}

/* =========================================================
   Carrito WooCommerce - Setrufma
   ========================================================= */
.woocommerce-cart table.shop_table {
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 6px 18px rgba(0,0,0,.05);
}
.woocommerce-cart table.shop_table thead th {
  background: #fafafa;
  color: var(--brand);
  font-weight: 700;
  text-transform: uppercase;
  font-size: 14px;
  letter-spacing: .5px;
  padding: 14px;
}
.woocommerce-cart table.shop_table td {
  padding: 16px;
  border-top: 1px solid #eee;
  vertical-align: middle;
}
.woocommerce-cart table.shop_table td.product-thumbnail img {
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0,0,0,.06);
  max-width: 80px;
}
.woocommerce-cart table.shop_table td.product-name a {
  color: var(--text);
  font-weight: 600;
  text-decoration: none;
}
.woocommerce-cart table.shop_table td.product-name a:hover { color: var(--brand); }

.woocommerce-cart .coupon #coupon_code {
  min-width: 260px;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid var(--line);
}
.woocommerce-cart .coupon .button {
  padding: 12px 16px;
  font-size: 15px;
  border-radius: 10px;
  margin-left: 6px;
  background: var(--brand);
  color: #fff;
  font-weight: 600;
  border: none;
  transition: background .25s ease, transform .2s ease;
}
.woocommerce-cart .coupon .button:hover {
  background: #9f7f2f;
  transform: translateY(-2px);
}
.woocommerce-cart .actions .button {
  background: var(--brand);
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 10px 16px;
  font-weight: 600;
  transition: background .25s ease, transform .2s ease;
}
.woocommerce-cart .actions .button:hover {
  background: #9f7f2f;
  transform: translateY(-2px);
}

.woocommerce-cart .cart_totals {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 20px;
  background: #fff;
  box-shadow: 0 6px 18px rgba(0,0,0,.05);
  margin-top: 30px;
  margin-bottom: 60px;
}
.woocommerce-cart .cart_totals h2 {
  font-size: 18px;
  font-weight: 700;
  color: var(--brand);
  margin-bottom: 16px;
  border-bottom: 2px solid var(--brand);
  display: inline-block;
  padding-bottom: 4px;
}
.woocommerce-cart .wc-proceed-to-checkout a.checkout-button {
  background: var(--brand) !important;
  color: #fff !important;
  border-radius: 12px;
  font-weight: 700;
  padding: 14px 20px;
  transition: background .25s ease, transform .2s ease;
}
.woocommerce-cart .wc-proceed-to-checkout a.checkout-button:hover {
  background: #9f7f2f !important;
  transform: translateY(-2px);
}
.woocommerce-cart, .woocommerce-checkout { margin-bottom: 80px; }

/* =========================================================
   Checkout WooCommerce - Setrufma
   ========================================================= */
.woocommerce-checkout form.checkout {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
}
.woocommerce-checkout .col2-set {
  display: flex !important;
  flex-wrap: nowrap !important;
  gap: 24px !important;
}
.woocommerce-checkout .col2-set .col-1,
.woocommerce-checkout .col2-set .col-2 {
  flex: 1 1 50% !important;
  max-width: 50% !important;
  margin: 0 !important;
  float: none !important;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 6px 18px rgba(0,0,0,.05);
  box-sizing: border-box !important;
}
@media (max-width: 768px) {
  .woocommerce-checkout .col2-set { flex-direction: column !important; }
  .woocommerce-checkout .col2-set .col-1,
  .woocommerce-checkout .col2-set .col-2 {
    max-width: 100% !important;
    flex: 1 1 100% !important;
  }
}
.woocommerce-checkout h3 {
  font-size: 18px;
  font-weight: 700;
  color: var(--brand);
  margin-bottom: 18px;
  border-bottom: 2px solid var(--brand);
  display: inline-block;
  padding-bottom: 4px;
}
.woocommerce-checkout input.input-text,
.woocommerce-checkout textarea,
.woocommerce-checkout select {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  font-size: 15px;
  margin-bottom: 14px;
  transition: border-color .2s ease, box-shadow .2s ease;
  background: #fafafa;
}
.woocommerce-checkout input.input-text:focus,
.woocommerce-checkout textarea:focus,
.woocommerce-checkout select:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 2px rgba(199,160,70,.25);
  outline: none;
  background: #fff;
}
.woocommerce-checkout-review-order-table {
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 6px 18px rgba(0,0,0,.05);
}
.woocommerce-checkout-review-order-table th {
  background: #fafafa;
  color: var(--brand);
  font-weight: 700;
  text-transform: uppercase;
  font-size: 14px;
}
.woocommerce-checkout-review-order-table th,
.woocommerce-checkout-review-order-table td {
  padding: 16px 22px !important;
  vertical-align: middle;
}
.woocommerce-checkout-review-order-table td.product-name { line-height: 1.5 !important; }
.woocommerce-checkout-review-order-table td.product-name dl.variation {
  margin-top: 8px !important;
  font-size: 14px !important;
  color: var(--muted) !important;
}
.woocommerce-checkout #payment {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 20px;
  box-shadow: 0 6px 18px rgba(0,0,0,.05);
  margin-top: 20px;
}
.woocommerce-checkout #payment ul.payment_methods { padding: 0; }
.woocommerce-checkout #payment div.payment_box {
  background: #fafafa;
  border: 1px solid #eee;
  border-radius: 12px;
  padding: 14px;
  margin-top: 12px;
}
.woocommerce-checkout #payment #place_order {
  background: var(--brand);
  color: #fff;
  border: none;
  border-radius: 12px;
  font-weight: 700;
  text-transform: uppercase;
  padding: 14px 20px;
  margin-top: 18px;
  transition: background .25s ease, transform .2s ease;
  width: 100%;
}
.woocommerce-checkout #payment #place_order:hover {
  background: #9f7f2f;
  transform: translateY(-2px);
}
.woocommerce-checkout { margin-bottom: 100px; }

/* =========================================================
   Avisos WooCommerce - Setrufma
   ========================================================= */
.woocommerce-info,
.woocommerce-message,
.woocommerce-error {
  border-top: 3px solid var(--brand) !important;
  background: #fff !important;
  border-radius: 12px !important;
  padding: 14px 18px !important;
  margin-bottom: 22px !important;
  box-shadow: 0 4px 12px rgba(0,0,0,.05) !important;
  color: var(--text) !important;
  font-size: 15px !important;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 8px;
  position: relative;
}
/* Quitar pseudo-icono azul */
.woocommerce-info::before,
.woocommerce-message::before,
.woocommerce-error::before {
  display: none !important;
  content: none !important;
}
.woocommerce-info p,
.woocommerce-message p,
.woocommerce-error li {
  margin: 0 !important;
  color: var(--text) !important;
  font-size: 15px !important;
}
.woocommerce-info a,
.woocommerce-message a,
.woocommerce-error a {
  color: var(--brand) !important;
  font-weight: 600;
  text-decoration: none !important;
  border-bottom: 1px solid transparent;
  transition: color .2s ease, border-color .2s ease;
}
.woocommerce-info a:hover,
.woocommerce-message a:hover,
.woocommerce-error a:hover {
  color: #9f7f2f !important;
  border-color: #9f7f2f !important;
}
/* Checkbox custom */
.woocommerce-info input[type="checkbox"],
.woocommerce-message input[type="checkbox"],
.woocommerce-error input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  border: 2px solid var(--brand);
  border-radius: 4px;
  position: relative;
  cursor: pointer;
  transition: all .2s ease;
  outline: none !important;
  box-shadow: none !important;
}
.woocommerce-info input[type="checkbox"]:checked,
.woocommerce-message input[type="checkbox"]:checked,
.woocommerce-error input[type="checkbox"]:checked {
  background: var(--brand);
  border-color: var(--brand);
}
.woocommerce-info input[type="checkbox"]:checked::after,
.woocommerce-message input[type="checkbox"]:checked::after,
.woocommerce-error input[type="checkbox"]:checked::after {
  content: "✔";
  color: #fff;
  font-size: 12px;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -55%);
}
.woocommerce-info input[type="checkbox"]:hover,
.woocommerce-message input[type="checkbox"]:hover,
.woocommerce-error input[type="checkbox"]:hover {
  border-color: #9f7f2f;
}
.woocommerce-info input[type="checkbox"]:focus-visible,
.woocommerce-message input[type="checkbox"]:focus-visible,
.woocommerce-error input[type="checkbox"]:focus-visible {
  outline: 2px solid rgba(199,160,70,.5);
  outline-offset: 2px;
}
