/* ==========================================================================
   Canela · ajustes del diseño a WordPress, Blocksy y WooCommerce.
   Se carga después de canela.css (el sistema, copiado del prototipo).
   ========================================================================== */

/* 0. Blocksy pinta botones, campos, tablas y enlaces con sus propias variables (de fábrica, azules).
      Aquí reciben la paleta de Canela: así cualquier pieza de Blocksy o de WooCommerce sale de la casa. */
:root{
  --theme-palette-color-1:var(--terracota);
  --theme-palette-color-2:var(--terracota-hondo);
  --theme-palette-color-3:color-mix(in oklab,var(--cacao) 76%,var(--calido));
  --theme-palette-color-4:var(--cacao);
  --theme-palette-color-5:color-mix(in oklab,var(--cacao) 16%,var(--calido));
  --theme-palette-color-6:var(--arena);
  --theme-palette-color-7:var(--calido);
  --theme-palette-color-8:#fff;
  --theme-font-family:var(--sans);
  --theme-button-font-weight:500;
  --theme-button-font-size:.9375rem;
  --theme-button-min-height:48px;
  --theme-button-padding:0 1.6em;
  --theme-button-border-radius:999px;
  --theme-form-field-border-initial-color:color-mix(in oklab,var(--cacao) 58%,var(--calido));
  --theme-form-field-border-focus-color:var(--cacao);
  --theme-form-field-border-radius:12px;
}
/* Cada botón toma los colores del tono de su sección: terracota sobre cálido, cálido sobre cacao.
   :where() no suma especificidad, así cualquier ajuste más preciso (como .cnl-boton--linea) gana. */
:where(.button,.ct-button,.added_to_cart,[type=submit],.wp-element-button,.wp-block-button__link,button[class*=ajax]){
  --theme-button-background-initial-color:var(--boton-fondo);
  --theme-button-background-hover-color:var(--boton-sobre);
  --theme-button-text-initial-color:var(--boton-tinta);
  --theme-button-text-hover-color:var(--boton-tinta);
}

/* 1. Base: Blocksy pone su fondo y su tipografía; mandan las de Canela */
body{background:var(--calido);color:var(--cacao);font-family:var(--sans)}
#main-container{display:flex;flex-direction:column;min-height:100vh;min-height:100svh}
#main-container > main{flex:1 0 auto;padding:0;margin:0}
.cnl-ancla{display:block;height:0;outline:0}
a{color:inherit}
h1,h2,h3,h4{color:inherit}

/* La barra de administración de WordPress (solo con sesión iniciada) empuja la cabecera */
.admin-bar .cnl-cabecera{top:32px}
@media screen and (max-width:782px){.admin-bar .cnl-cabecera{top:46px}}
@media screen and (max-width:600px){.admin-bar .cnl-cabecera{top:0}}

/* 2. Botones: Blocksy les da su forma; aquí vuelven a ser píldoras de Canela */
.button,a.button,button.button,input.button,.single_add_to_cart_button{
  display:inline-flex;align-items:center;justify-content:center;gap:.5em;min-height:48px;padding:0 1.6em;
  border-radius:999px;border:1px solid transparent;background:var(--boton-fondo);color:var(--boton-tinta);
  font:500 .9375rem/1 var(--sans);letter-spacing:.005em;text-transform:none;text-decoration:none;box-shadow:none;
}
.button:hover,a.button:hover,button.button:hover,.single_add_to_cart_button:hover{background:var(--boton-sobre);color:var(--boton-tinta)}
.cnl-boton--linea,a.cnl-boton--linea{
  --theme-button-background-initial-color:transparent;--theme-button-text-initial-color:var(--tinta);
  --theme-button-background-hover-color:var(--tinta);--theme-button-text-hover-color:var(--fondo);
  background:transparent;color:var(--tinta);border-color:var(--linea-fuerte);
}
.cnl-boton--linea:hover,a.cnl-boton--linea:hover{background:var(--tinta);color:var(--fondo);border-color:var(--tinta)}

/* 3. Placas */
li.product .woocommerce-loop-product__title{font:500 1rem/1.25 var(--sans);margin:0;padding:0;color:var(--tinta)}
li.product .price{display:block;margin-top:5px;font-size:.875rem;font-weight:400;color:var(--tinta)}
li.product .price del{opacity:.6;margin-right:.35em}
li.product .price ins{text-decoration:none;background:none}
li.product .cnl-sin-precio{text-decoration:none}
a.cnl-agregar{text-decoration:none}
.cnl-agregar.loading{opacity:.7;pointer-events:none}
li.product .added_to_cart{display:none}      /* WooCommerce agrega «Ver carrito»; la cuenta de la cabecera ya avisa */
@media (max-width:759px){li.product .woocommerce-loop-product__title{font-size:.9375rem}}

/* 4. Tienda: chips que son enlaces, orden de WooCommerce, paginación */
a.cnl-chip{display:inline-flex;align-items:center;text-decoration:none;color:var(--tinta)}
a.cnl-chip[aria-current="true"]{background:var(--cacao);border-color:var(--cacao);color:var(--calido)}
.cnl-orden .woocommerce-ordering{margin:0}
.cnl-orden select.orderby{
  appearance:none;-webkit-appearance:none;min-height:44px;padding:0 2.5em 0 1.1em;border:1px solid var(--linea-fuerte);border-radius:999px;
  font:400 .875rem/1 var(--sans);color:var(--tinta);cursor:pointer;
  background:transparent url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%233A241C' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9.5 6 6 6-6'/%3E%3C/svg%3E") no-repeat right .9em center/15px;
}
.woocommerce-pagination{margin-top:clamp(28px,3vw,44px);display:flex;justify-content:center}
.woocommerce-pagination ul.page-numbers{display:flex;gap:6px;list-style:none;margin:0;padding:0;border:0}
.woocommerce-pagination .page-numbers li{border:0}
.woocommerce-pagination a.page-numbers,.woocommerce-pagination span.page-numbers{
  display:grid;place-items:center;min-width:44px;height:44px;padding:0 .8em;border:1px solid var(--linea-fuerte);border-radius:999px;text-decoration:none;font-size:.875rem;
}
.woocommerce-pagination span.current{background:var(--cacao);border-color:var(--cacao);color:var(--calido)}

/* 5. Migas (las minúsculas las pone el filtro de PHP: el nombre de la pieza y las marcas se respetan) */
.woocommerce-breadcrumb{margin:0}

/* 6. Ficha: el formulario de compra de WooCommerce (y su envoltura de Blocksy) */
.single-product div.product .summary{max-width:31rem}
.single-product div.product .product_title{font:400 clamp(2.25rem,2.3vw + 1.25rem,3.5rem)/1.04 var(--serif);letter-spacing:-.016em;margin:0;color:var(--tinta)}
.single-product div.product .summary > .price{margin:20px 0 0;font-size:1.25rem;color:var(--tinta)}
.single-product div.product .woocommerce-product-details__short-description{margin-top:18px}
.single-product div.product .woocommerce-product-details__short-description p{margin:0}
.single-product div.product form.cart{display:grid;gap:20px;margin:28px 0 0;--theme-button-min-height:54px}
.single-product div.product .ct-cart-actions,
.single-product div.product .woocommerce-variation-add-to-cart{display:grid;grid-template-columns:auto minmax(0,1fr);gap:10px;align-items:stretch}
.single-product div.product .single_add_to_cart_button{min-height:54px;font-size:1rem;width:100%}
.single-product div.product .single_add_to_cart_button.disabled{opacity:.55}
.cnl-compra-zona > .cnl-nota{margin-top:16px}

/* La cantidad: Blocksy dibuja la suya (un campo con − y + encima); se viste como la píldora del prototipo */
div.quantity{
  display:inline-block;border:0;border-radius:0;
  --quantity-width:132px;
  --quantity-initial-color:var(--linea-fuerte);
  --quantity-hover-color:var(--tinta);
  --quantity-arrows-initial-color:var(--tinta);
  --quantity-arrows-hover-color:var(--fondo);
  --theme-form-field-border-radius:999px;
  --theme-form-text-initial-color:var(--tinta);
  --theme-form-text-focus-color:var(--tinta);
}
div.quantity input.qty{border:1px solid var(--linea-fuerte);background:transparent;color:var(--tinta);font-variant-numeric:tabular-nums}
div.quantity input.qty:focus{border-color:var(--tinta)}
.single-product .quantity{margin:0}

table.variations{border:0;margin:0;width:100%}
table.variations tr,table.variations th,table.variations td{display:block;padding:0;border:0;background:none}
table.variations th.label{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%)}
.cnl-colores select{position:absolute;width:1px;height:1px;opacity:0;pointer-events:none}
.cnl-colores__titulo{margin:0 0 10px;font-size:.9375rem;color:var(--tinta-2)}
.cnl-colores__titulo b{font-weight:500;color:var(--tinta)}
.reset_variations,.single_variation_wrap .woocommerce-variation-price{display:none!important}
.single_variation_wrap .woocommerce-variation-availability p{margin:0 0 6px;font-size:.875rem;color:var(--tinta-2)}
.cnl-sin-venta{margin-top:28px;display:grid;gap:8px}
@media (max-width:480px){
  .single-product div.product .ct-cart-actions,
  .single-product div.product .woocommerce-variation-add-to-cart{grid-template-columns:minmax(0,1fr)}
  .single-product .quantity{justify-self:start}
}

/* La tabla comparativa: Blocksy dibuja rejilla en todas las tablas; aquí quedan solo las líneas del prototipo */
.cnl-compara__tabla{--theme-table-border-width:0}

/* 7. Avisos de WooCommerce («se agregó al carrito», errores) */
.woocommerce-notices-wrapper:empty{display:none}
.woocommerce-notices-wrapper{width:auto;max-width:none;margin:0;padding:12px var(--margen) 0}
.woocommerce-message,.woocommerce-info,.woocommerce-error{
  list-style:none;margin:0 0 10px;padding:14px 20px;border:0;border-radius:var(--radio-l);
  background:var(--arena);color:var(--cacao);font-size:.9375rem;display:flex;flex-wrap:wrap;align-items:center;gap:8px 18px;
}
.woocommerce-error{background:var(--nude)}
.woocommerce-message::before,.woocommerce-info::before,.woocommerce-error::before{display:none}
.woocommerce-message .button,.woocommerce-info .button{order:2;margin-left:auto;min-height:40px}
/* WooCommerce les da foco para que el lector de pantalla los anuncie; no son botones, no llevan anillo */
:is(.woocommerce-message,.woocommerce-info,.woocommerce-error):focus{outline:0}

/* 8. Búsqueda */
.cnl-buscar{position:fixed;inset:0 0 auto 0;width:100%;max-width:none;margin:0;padding:22px var(--margen);border:0}
.cnl-buscar::backdrop{background:rgb(var(--sombra)/.45)}
.cnl-buscar[open]{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:12px;align-items:center;animation:cnl-desplegar .45s var(--ease)}
.cnl-buscar__form{margin:0;max-width:40rem}
.cnl-buscar input[type="search"]{flex:1;min-width:0;height:44px;padding:0 0 0 18px;border:0;background:none;outline:0;color:var(--tinta);font:inherit}
.cnl-buscar input[type="search"]::placeholder{color:var(--tinta-2);opacity:1}

/* 9. Carrito y pago: los bloques de WooCommerce con la ropa de Canela.
      Sus estilos llegan al final de la página, por eso estas reglas suben un punto con «body». */
.wc-block-components-button:not(.is-link),.wc-block-cart__submit-button,.wc-block-components-checkout-place-order-button{
  border-radius:999px!important;background:var(--terracota)!important;color:var(--calido)!important;border:0!important;min-height:52px;font-family:var(--sans)!important;
}
.wc-block-components-button:not(.is-link):hover{background:var(--terracota-hondo)!important}
.wp-block-woocommerce-cart,.wp-block-woocommerce-checkout{font-family:var(--sans)}
.wc-block-components-title,.wc-block-cart .wc-block-cart__totals-title{font-family:var(--serif)!important;font-weight:400!important;text-transform:lowercase}
body .wc-block-cart .wc-block-cart__totals-title{font-size:1.5rem;line-height:1.2;letter-spacing:-.01em;text-transform:lowercase;color:var(--tinta)}
body table.wc-block-cart-items .wc-block-cart-items__header{text-transform:lowercase;letter-spacing:0;font-size:.875rem;font-weight:400;color:var(--tinta-2)}
body .wc-block-components-quantity-selector,body .wc-block-components-quantity-selector::after{border-radius:999px}
.wc-block-components-text-input input,.wc-block-components-combobox .wc-block-components-combobox-control input,.wc-blocks-components-select select{border-radius:12px!important}
/* Avisos: Blocksy los pinta con sus variables (el error, en rojo con letra blanca); aquí van arena y nude con letra cacao */
body :is(.woocommerce-message,.woocommerce-info,.woocommerce-error,.wc-block-components-notice-banner){
  --background-color:var(--arena);--theme-text-color:var(--cacao);--theme-link-initial-color:var(--cacao);--theme-link-hover-color:var(--cacao);
}
body :is(.woocommerce-error,.wc-block-components-notice-banner.is-error){
  --background-color:var(--nude);--theme-text-color:var(--cacao);--theme-link-initial-color:var(--cacao);--theme-link-hover-color:var(--cacao);
}
body .wc-block-components-notice-banner{border:0;border-radius:var(--radio-l);color:var(--cacao)}
body .wc-block-components-notice-banner:is(.is-error,.is-info,.is-success,.is-warning) > svg{background-color:var(--cacao);fill:var(--calido)}

/* 10. Páginas sueltas (page.php): carrito, pago, mi cuenta y, más adelante, envíos o términos */
.cnl-pagina__cuerpo{padding:0 var(--margen) var(--seccion)}
.cnl-pagina:not(.cnl-pagina--tienda) .cnl-pagina__cuerpo{max-width:calc(44rem + 2 * var(--margen))}
.cnl-pagina:not(.cnl-pagina--tienda) .cnl-pagina__cuerpo :is(p,ul,ol){margin:0 0 1em;line-height:1.6}
.cnl-pagina:not(.cnl-pagina--tienda) .cnl-pagina__cuerpo :is(h2,h3){margin:1.6em 0 .5em;font-family:var(--serif);font-weight:400;line-height:1.15}
.cnl-pagina:not(.cnl-pagina--tienda) .cnl-pagina__cuerpo h2{font-size:clamp(1.625rem,1.2vw + 1.2rem,2.25rem)}
.cnl-pagina:not(.cnl-pagina--tienda) .cnl-pagina__cuerpo h3{font-size:1.375rem}
.cnl-pagina:not(.cnl-pagina--tienda) .cnl-pagina__cuerpo a{text-decoration:underline;text-underline-offset:.2em}
