/*
Theme Name: Enedgia
Theme URI: https://enedgia.com
Author: Enedgia · ONATERMIA S.L.
Description: Tema ligero para enedgia.com. Compatible con WooCommerce, Elementor y Elementor Pro (Theme Builder), y con los plugins que usan los ganchos estándar de WordPress.
Version: 1.0.4
Requires at least: 6.0
Requires PHP: 7.4
License: GNU General Public License v2 or later
Text Domain: enedgia
Tags: e-commerce, woocommerce, elementor, custom-logo, custom-menu, featured-images, threaded-comments
*/

/* Estructura básica del tema. El estilo de tienda va en assets/css/enedgia-global.css */
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif; font-size: 17px; line-height: 1.5; color: #424245; background: #fff; }
img { max-width: 100%; height: auto; }
a { color: #0068cc; }
.screen-reader-text { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link:focus { position: fixed; top: 8px; left: 8px; z-index: 1000; width: auto; height: auto; clip: auto; padding: 10px 16px; background: #1d1d1f; color: #fff; border-radius: 980px; }

.ene-contenedor { width: 100%; max-width: 1240px; margin: 0 auto; padding: 0 20px; }

/* Cabecera */
.ene-cabecera { position: sticky; top: 0; z-index: 100; background: rgba(255,255,255,.92); -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px); border-bottom: 1px solid #e8e8ed; }
.ene-cabecera__fila { display: flex; align-items: center; gap: 20px; min-height: 64px; }
.ene-cabecera .custom-logo { display: block; width: auto; height: 34px; max-height: none; }
/* El logo subido es blanco: se pasa a letras oscuras (el rayo mantiene sus colores) */
.ene-cabecera .custom-logo { filter: invert(1) hue-rotate(180deg); }
.ene-cabecera__nombre { color: #1d1d1f; font-size: 22px; font-weight: 600; text-decoration: none; }
.ene-busqueda { flex: 1; max-width: 520px; }
.ene-busqueda form { position: relative; display: flex; align-items: center; margin: 0; }
.ene-busqueda input[type="search"] { width: 100%; min-height: 44px; padding: 8px 52px 8px 18px; border: 0; border-radius: 980px; background: #f5f5f7; font-size: 16px; }
/* Botón de buscar: una lupa dentro de la píldora */
.ene-busqueda button[type="submit"], .ene-busqueda input[type="submit"] {
  position: absolute; top: 2px; right: 2px; width: 40px; min-width: 40px; height: 40px; min-height: 40px; padding: 0;
  border: 0; border-radius: 50%; background: transparent url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231d1d1f' stroke-width='1.8' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E") no-repeat center / 20px;
  color: transparent; font-size: 0; box-shadow: none;
}
.ene-busqueda button[type="submit"]:hover { background-color: #e8e8ed; }
.ene-acciones { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.ene-acciones a { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-width: 44px; min-height: 44px; padding: 0 10px; color: #1d1d1f; font-size: 14px; text-decoration: none; }
.ene-acciones svg { width: 22px; height: 22px; }
.ene-carrito__numero { display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: #0068cc; color: #fff; font-size: 11px; }
.ene-menu { border-top: 1px solid #f5f5f7; }
/* Barra de categorías con iconos */
.ene-categorias {
  display: flex;
  gap: clamp(4px, 1.4vw, 20px);
  margin: 0;
  padding: 12px 20px 10px;
  overflow-x: auto;
  list-style: none;
  scrollbar-width: none;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 20px, #000 calc(100% - 20px), transparent);
  mask-image: linear-gradient(90deg, transparent, #000 20px, #000 calc(100% - 20px), transparent);
}
.ene-categorias::-webkit-scrollbar { display: none; }
.ene-categorias > li { flex: none; }
.ene-categorias > li:first-child { margin-left: auto; }
.ene-categorias > li:last-child { margin-right: auto; }
.ene-categorias a {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 84px;
  min-height: 44px;
  color: #1d1d1f;
  text-align: center;
  text-decoration: none;
}
.ene-cat-icono {
  width: 36px; height: 36px;
  margin-bottom: 6px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.35;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform .35s cubic-bezier(.28,.11,.32,1), color .2s;
}
.ene-categorias a:hover .ene-cat-icono { transform: translateY(-3px); color: #0068cc; }
.ene-cat-nombre { font-size: 12px; line-height: 1.3; letter-spacing: -.01em; }
.ene-categorias a[aria-current="page"] .ene-cat-icono { color: #0068cc; }
.ene-categorias a[aria-current="page"] .ene-cat-nombre { font-weight: 600; }
.ene-sprite symbol, .ene-acciones svg use { fill: none; stroke: currentColor; }
.ene-menu-boton { display: none; min-width: 44px; min-height: 44px; border: 0; background: transparent; font-size: 22px; }
@media (max-width: 992px) {
  .ene-cabecera__fila { flex-wrap: wrap; gap: 10px; padding: 6px 0; }
  .ene-busqueda { order: 3; flex-basis: 100%; max-width: none; }
  .ene-categorias { padding: 10px 12px 8px; }
  .ene-categorias a { width: 72px; }
  .ene-cat-icono { width: 30px; height: 30px; }
  .ene-acciones__texto { display: none; }
}

/* Contenido */
.ene-principal { padding: 32px 0 64px; }
.ene-con-lateral { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 40px; }
@media (max-width: 992px) { .ene-con-lateral { grid-template-columns: 1fr; } .ene-con-lateral .ene-lateral { order: 2; } }
.ene-lateral .widget { margin-bottom: 28px; }
.ene-lateral .widget-title { margin: 0 0 12px; color: #1d1d1f; font-size: 15px; font-weight: 600; }

/* Pie */
.ene-pie { position: relative; padding: 32px 0 calc(24px + env(safe-area-inset-bottom)); background: #f5f5f7; color: #6e6e73; font-size: 12px; line-height: 1.45; }
.ene-pie::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 2px; background: linear-gradient(90deg, #0090f0, #00d0b0 34%, #f030c0 68%, #f8d808); }
.ene-pie a { color: #424245; text-decoration: none; }
.ene-pie a:hover { color: #0068cc; text-decoration: underline; }
.ene-pie__notas { margin-bottom: 22px; padding-bottom: 18px; border-bottom: 1px solid #d2d2d7; }
.ene-pie__notas p { margin: 0; }
.ene-pie__columnas { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 24px; margin-bottom: 26px; }
.ene-pie__columna summary, .ene-pie .widget-title { margin: 0 0 10px; color: #1d1d1f; font-size: 13px; font-weight: 600; list-style: none; }
.ene-pie__columna summary::-webkit-details-marker { display: none; }
.ene-pie ul { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; font-size: 13px; }
.ene-pie__mas { margin: 0 0 12px; padding-bottom: 16px; border-bottom: 1px solid #d2d2d7; }
.ene-pie__mas a { color: #0068cc; }
.ene-pie__legal { margin: 0; }
@media (min-width: 768px) { .ene-pie__columna summary { pointer-events: none; } }
@media (max-width: 767px) {
  .ene-pie__columnas { grid-template-columns: 1fr; gap: 0; }
  .ene-pie__columna { border-bottom: 1px solid #d2d2d7; }
  .ene-pie__columna summary { display: flex; align-items: center; justify-content: space-between; min-height: 48px; margin: 0; font-size: 14px; cursor: pointer; }
  .ene-pie__columna summary::after { content: ""; width: 7px; height: 7px; margin-right: 4px; border: solid #6e6e73; border-width: 0 1.5px 1.5px 0; transform: rotate(45deg); }
  .ene-pie__columna[open] summary::after { transform: rotate(-135deg); }
  .ene-pie__columna ul { padding: 0 0 16px 12px; font-size: 14px; }
}

/* Portada de Elementor (bloques .ene): mismo azul de acción que el resto de la tienda */
html body .ene { --ene-blue: #0068cc; --ene-cta: #0068cc; --ene-cta-h: #0055a8; }
