/*
Theme Name: CBD León Code (Definitivo PRO)
Theme URI: https://cbdleon.com/
Author: CBD León
Description: Tema a medida. Header fijo, Móvil arreglado, Bordes verdes unificados.
Version: 3.0.3
*/

/* =========================================================
   1. VARIABLES (COLORES Y MEDIDAS)
========================================================= */
:root {
  /* FONDOS */
  --bg-body: #050a08;
  --bg-card: #0d1411;
  --bg-card-hover: #121c17;
  --bg-trans: rgba(255, 255, 255, 0.03);

  /* ACENTOS */
  --primary: #16a34a;       
  --primary-glow: #22c55e;  /* Verde Neón */
  --primary-dim: rgba(34, 197, 94, 0.15); 

  /* BORDES (UNIFICADOS) */
  --border-light: rgba(255, 255, 255, 0.10);
  --border-green: rgba(34, 197, 94, 0.45); 
  --border-green-hover: rgba(34, 197, 94, 0.8);

  /* TEXTO */
  --text-main: rgba(255, 255, 255, 0.92);
  --text-muted: rgba(255, 255, 255, 0.65);

  --radius: 20px;
  --max-width: 1200px;
}

/* =========================================================
   2. BASE
========================================================= */
*, *::before, *::after { box-sizing: border-box; }

body { 
  margin: 0; 
  font-family: system-ui, -apple-system, sans-serif; 
  background-color: var(--bg-body); 
  color: var(--text-main); 
  line-height: 1.6; 
}

img { max-width: 100%; height: auto; display: block; }
a { text-decoration: none; color: inherit; transition: 0.2s; }
ul, ol { padding: 0; margin: 0; list-style: none; }

.cbd-highlight { color: var(--primary-glow); font-weight: inherit; }
.cbd-container { width: 92%; max-width: var(--max-width); margin: 0 auto; }

/* =========================================================
   3. HEADER (CABECERA FIJA Y ORGANIZADA)
========================================================= */
.cbd-site-header {
  position: sticky;
  top: 0;
  z-index: 99999; /* Siempre encima */
  background: rgba(5, 10, 8, 0.98); /* Fondo sólido */
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(255,255,255,0.1);
  padding: 0.8rem 0;
  transition: 0.3s;
}

.cbd-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative; 
}

/* Marca (Logo + Eslogan) */
.cbd-brand-group {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  line-height: 1.1;
}
.cbd-brand-link {
  font-size: 1.6rem;
  font-weight: 900;
  letter-spacing: -0.02em;
  color: #fff;
  text-decoration: none;
  margin-bottom: 2px;
}
.cbd-brand-tagline {
  font-size: 0.75rem;
  color: var(--primary-glow);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Menú Escritorio */
.cbd-header-nav {
  margin-left: auto;
  margin-right: 2rem;
}
.cbd-menu-list {
  display: flex;
  gap: 1.5rem;
  list-style: none;
  margin: 0; padding: 0;
}
.cbd-menu-list li { margin: 0; }
.cbd-menu-list a {
  font-weight: 700;
  font-size: 0.9rem;
  color: rgba(255,255,255,0.7);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  text-decoration: none;
}
.cbd-menu-list a:hover { color: var(--primary-glow); }

/* Acciones (Carrito) */
.cbd-header-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}
.cbd-icon-btn {
  position: relative;
  display: flex; align-items: center; justify-content: center;
  color: #fff;
  width: 40px; height: 40px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.2);
  transition: 0.2s;
}
.cbd-icon-btn:hover { background: var(--primary); border-color: var(--primary); }

.cbd-cart-count {
  position: absolute;
  top: -5px; right: -5px;
  background: var(--primary-glow);
  color: #000;
  font-size: 0.7rem;
  font-weight: 900;
  width: 18px; height: 18px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
}

/* Botón Hamburguesa (Por defecto oculto) */
.cbd-menu-toggle { display: none; background: none; border: none; color: #fff; cursor: pointer; }

/* =========================================================
   4. HERO (PORTADA)
========================================================= */
.cbd-hero { 
  position: relative; 
  padding: 5rem 0 4rem; 
  text-align: center; 
  overflow: hidden; 
  border-bottom: 1px solid var(--border-light); 
}
.cbd-hero__bg { 
  position: absolute; inset: 0; opacity: 0.2; pointer-events: none; z-index: -1; 
}
.cbd-pill { 
  display: inline-flex; padding: 0.4rem 1rem; border-radius: 50px; 
  background: var(--bg-trans); border: 1px solid var(--border-light); 
  font-size: 0.85rem; font-weight: 700; color: var(--primary-glow); margin-bottom: 1.5rem; 
}
.cbd-hero__title { 
  font-size: clamp(2.5rem, 5vw, 4rem); 
  font-weight: 900; line-height: 1.1; margin: 0 0 1rem; color: var(--text-main); 
}
.cbd-hero__subtitle { 
  font-size: 1.15rem; color: var(--text-muted); max-width: 700px; margin: 0 auto 2rem; 
}
.cbd-hero__actions { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }

.cbd-btn { 
  display: inline-flex; align-items: center; justify-content: center; 
  padding: 0.8rem 1.5rem; border-radius: 50px; font-weight: 800; font-size: 1rem; 
  cursor: pointer; border: 1px solid transparent; 
}
.cbd-btn--primary { 
  background: var(--primary); color: #fff; 
  box-shadow: 0 4px 15px rgba(22, 163, 74, 0.4); 
}
.cbd-btn--primary:hover { background: var(--primary-glow); transform: translateY(-2px); }
.cbd-btn--ghost { 
  background: transparent; border: 1px solid var(--border-light); color: var(--text-main); 
}
.cbd-btn--ghost:hover { 
  background: rgba(255,255,255,0.05); border-color: var(--text-main); 
}

/* =========================================================
   5. TARJETAS Y SECCIONES
========================================================= */
.cbd-section { padding: 4rem 0; }
.cbd-section--tight { padding: 2rem 0; }
.cbd-section__head { text-align: center; margin-bottom: 3rem; }
.cbd-h2 { font-size: 2.5rem; font-weight: 800; margin: 0 0 0.5rem; }
.cbd-lead { color: var(--text-muted); font-size: 1.1rem; max-width: 600px; margin: 0 auto; }

.cbd-grid { display: grid; gap: 1.5rem; }
.cbd-grid--2 { grid-template-columns: 1fr; }
.cbd-grid--3 { grid-template-columns: 1fr; }
.cbd-grid--4 { grid-template-columns: 1fr; }

/* Estilo Tarjeta Genérica */
.cbd-card {
  background: var(--bg-card);
  border: 1px solid var(--border-green); /* VERDE UNIFICADO */
  border-radius: var(--radius);
  padding: 2rem; transition: 0.3s ease; height: 100%; display: flex; flex-direction: column;
}
.cbd-card:hover { 
  border-color: var(--border-green-hover); 
  background: var(--bg-card-hover); 
  transform: translateY(-3px); 
  box-shadow: 0 10px 30px rgba(0,0,0,0.3); 
}

.cbd-card--link { padding: 0; overflow: hidden; cursor: pointer; }
.cbd-card__body { padding: 1.5rem; display: flex; flex-direction: column; height: 100%; }
.cbd-text-center { text-align: center; align-items: center; }

.cbd-card__media img { width: 100%; height: 200px; object-fit: cover; }

.cbd-h3 { font-size: 1.3rem; font-weight: 800; margin: 0 0 0.5rem; color: var(--text-main); }
.cbd-text { font-size: 0.95rem; color: var(--text-muted); margin-bottom: 1rem; }
.cbd-link { color: var(--primary-glow); font-weight: 700; margin-top: auto; }

/* Pasos */
.cbd-step-num { 
  display: flex; align-items: center; justify-content: center; width: 40px; height: 40px; 
  border-radius: 50%; background: var(--primary-dim); color: var(--primary-glow); 
  font-weight: 900; margin-bottom: 1rem; border: 1px solid var(--border-green); 
}
.cbd-card--highlight { background: var(--primary-dim); border-color: var(--border-green); }
.cbd-icon { font-size: 2rem; margin-bottom: 1rem; }

/* Tienda Hero */
.cbd-hero--shop {
  background: linear-gradient(45deg, var(--bg-card), #062b1b);
  border-radius: var(--radius);
  border: 1px solid var(--border-green); /* VERDE UNIFICADO */
  padding: 4rem 2rem; margin: 2rem 0;
}

/* Mini Cards */
.cbd-card--mini {
  padding: 1.5rem; background: var(--bg-trans); text-align: center; justify-content: center;
  border: 1px solid var(--border-green); /* VERDE UNIFICADO */
}
.cbd-minihead { font-weight: 800; margin-bottom: 0.5rem; color: var(--primary-glow); }
.cbd-minitext { font-size: 0.9rem; color: var(--text-muted); }

/* =========================================================
   6. FOOTER (3 COLUMNAS SEPARADAS)
========================================================= */
.cbd-site-footer {
  margin-top: 3rem; background: #020403; padding: 4rem 0 2rem; border-top: 1px solid var(--border-light);
}
.cbd-footer-grid {
  display: grid;
  grid-template-columns: 1fr; /* Móvil: 1 columna */
  gap: 3rem;
}
.cbd-footer-title {
  color: var(--text-main); font-weight: 800; margin-bottom: 1.2rem; font-size: 1.1rem;
  text-transform: uppercase; letter-spacing: 0.05em;
}
.cbd-footer-text { font-size: 0.9rem; color: var(--text-muted); margin-bottom: 0.5rem; line-height: 1.5; }

.cbd-footer-menu { padding: 0; margin: 0; list-style: none; }
.cbd-footer-menu li { margin-bottom: 0.6rem; }
.cbd-footer-menu a { display: block; color: var(--text-muted); font-size: 0.95rem; transition: 0.2s; }
.cbd-footer-menu a:hover { color: var(--primary-glow); transform: translateX(3px); }

.cbd-footer-bottom { 
  margin-top: 4rem; padding-top: 2rem; border-top: 1px solid var(--border-light); 
  text-align: center; color: var(--text-muted); font-size: 0.8rem; opacity: 0.6; 
}

/* =========================================================
   7. PÁGINAS & ARTÍCULOS (FLECHA Y TEXTO)
========================================================= */
/* Estilo Flecha Volver */
.cbd-back-arrow {
  display: inline-flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; border-radius: 50%;
  background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.1);
  transition: 0.2s ease;
}
.cbd-back-arrow:hover {
  background: var(--primary-glow); border-color: var(--primary-glow); transform: translateX(-3px);
}

/* Contenido legible */
.cbd-article-content { font-size: 1.15rem; line-height: 1.8; color: var(--text-muted); }
.cbd-article-content p { margin-bottom: 1.5rem; }
.cbd-article-content h2 { 
  color: var(--text-main); font-weight: 800; font-size: 1.8rem; 
  margin-top: 3rem; margin-bottom: 1rem; 
}
.cbd-article-content h3 { 
  color: var(--text-main); font-weight: 700; font-size: 1.4rem; 
  margin-top: 2.5rem; margin-bottom: 0.8rem; 
}
.cbd-article-content ul, .cbd-article-content ol { margin-bottom: 1.5rem; padding-left: 1.5rem; }
.cbd-article-content ul li { list-style-type: disc; margin-bottom: 0.5rem; }
.cbd-article-content ul li::marker { color: var(--primary-glow); }
.cbd-article-content a { color: var(--primary-glow); text-decoration: underline; text-underline-offset: 3px; font-weight: 600; }
.cbd-article-content strong, .cbd-article-content b { color: var(--text-main); font-weight: 700; }

/* =========================================================
   8. MEDIA QUERIES (RESPONSIVE)
========================================================= */

/* ESCRITORIO (Más de 900px) */
@media (min-width: 900px) {
  .cbd-grid--2 { grid-template-columns: repeat(2, 1fr); }
  .cbd-grid--3 { grid-template-columns: repeat(3, 1fr); }
  .cbd-grid--4 { grid-template-columns: repeat(4, 1fr); }
  
  /* Footer 3 Columnas */
  .cbd-footer-grid {
    grid-template-columns: 4fr 3fr 3fr; /* Marca ancha - Enlaces - Legal */
    gap: 2rem; align-items: start;
  }
}

/* MÓVIL / TABLET (Menos de 900px) - FIX HUAWEI */
@media (max-width: 900px) {
  
  /* 1. Botón Hamburguesa VISIBLE */
  .cbd-menu-toggle { display: block; }

  /* 2. Ocultar eslogan para ganar sitio */
  .cbd-brand-tagline { display: none; }

  /* 3. MENÚ OCULTO (Anti-Destroy) */
  .cbd-header-nav {
    display: none; /* ¡Clave! Oculto por defecto */
    position: absolute;
    top: 100%; left: 0; width: 100%;
    background: #000000;
    padding: 2rem;
    border-top: 1px solid #22c55e;
    box-shadow: 0 20px 50px rgba(0,0,0,0.9);
  }

  /* 4. MENÚ ABIERTO (Clase activada por JS) */
  .cbd-header-nav.is-open {
    display: block !important;
    animation: slideIn 0.3s ease;
  }

  /* 5. Lista Vertical en Móvil */
  .cbd-menu-list {
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    margin-right: 0;
  }
  .cbd-menu-list a { font-size: 1.3rem; color: #fff; }

  @keyframes slideIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
  }
}
/* =========================================================
   9. WOOCOMMERCE TIENDA (ESTILO DARK PRO)
========================================================= */

/* 1. Rejilla de Productos/Categorías */
.woocommerce ul.products {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); /* Rejilla automática responsiva */
  gap: 2rem;
  margin: 2rem 0 !important;
}

.woocommerce ul.products li.product {
  background: #0d1411;       /* Fondo oscuro tarjeta */
  border: 1px solid rgba(34, 197, 94, 0.45); /* Borde verde unificado */
  border-radius: 20px;       /* Bordes redondos */
  padding: 1.5rem;
  text-align: center;
  transition: 0.3s;
  width: 100% !important;    /* Forzar ancho */
  margin: 0 !important;      /* Quitar márgenes viejos */
  float: none !important;    /* Quitar flotados antiguos */
}

/* Efecto Hover */
.woocommerce ul.products li.product:hover {
  transform: translateY(-5px);
  border-color: #22c55e;     /* Verde neón al pasar ratón */
  box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

/* 2. Imágenes de Categoría/Producto */
.woocommerce ul.products li.product a img {
  border-radius: 15px;
  margin-bottom: 1rem !important;
  filter: brightness(0.9);   /* Un pelín oscuras para elegancia */
  transition: 0.3s;
  background: rgba(255,255,255,0.05); /* Fondo para PNGs transparentes */
}

.woocommerce ul.products li.product:hover a img {
  filter: brightness(1.1);
}

/* 3. Títulos (Nombre de categoría o producto) */
.woocommerce ul.products li.product .woocommerce-loop-category__title,
.woocommerce ul.products li.product .woocommerce-loop-product__title {
  color: #fff;
  font-size: 1.2rem;
  font-weight: 800;
  margin-top: 0.5rem;
  padding: 0;
}

/* Contador de productos (el numerito pequeña) */
.woocommerce ul.products li.product .count {
  background: #22c55e;
  color: #000;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.1rem 0.5rem;
  border-radius: 10px;
  vertical-align: middle;
  margin-left: 0.5rem;
}

/* 4. Precio y Botón (si es producto) */
.woocommerce ul.products li.product .price {
  color: #22c55e;
  font-weight: 700;
  font-size: 1.1rem;
  display: block;
  margin-bottom: 1rem;
}

.woocommerce ul.products li.product .button {
  background: transparent;
  border: 1px solid rgba(255,255,255,0.2);
  color: #fff;
  border-radius: 50px;
  padding: 0.5rem 1.2rem;
  font-weight: 700;
  margin-top: auto; /* Empuja el botón al fondo */
}
.woocommerce ul.products li.product .button:hover {
  background: #22c55e;
  color: #000;
  border-color: #22c55e;
}

/* 5. Títulos de página de tienda */
.woocommerce-products-header__title.page-title {
  text-align: center;
  font-size: 2.5rem;
  font-weight: 900;
  margin-bottom: 3rem;
  color: #fff;
}


/* =========================================================
   CBDLeón: Promo Home (barra promo) + Aviso tienda WooCommerce
========================================================= */

/* Barra promo (shortcode [cbd_promo_strip]) */
.cbdleon-promo{
  position: fixed;
  left: 0;
  right: 0;
  padding: 10px 14px;
  z-index: 999;
  display: flex;
  pointer-events: none; /* permite clicar solo dentro del bloque */
}
.cbdleon-promo__inner{
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(5, 46, 22, 0.94);
  border: 1px solid rgba(34, 197, 94, 0.28);
  border-radius: 999px;
  padding: 8px 12px;
  max-width: 100%;
  box-shadow: 0 10px 30px rgba(0,0,0,.25);
}
.cbdleon-promo__left{
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.cbdleon-promo__badge{
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(34, 197, 94, 0.18);
  border: 1px solid rgba(34, 197, 94, 0.35);
  color: rgba(255,255,255,.92);
  font-weight: 800;
  font-size: 13px;
  line-height: 1;
}
.cbdleon-promo__text{
  color: rgba(255,255,255,.88);
  font-weight: 700;
  font-size: 13px;
  line-height: 1.1;
}
.cbdleon-promo__btn{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(34, 197, 94, 0.92);
  color: #062e16;
  font-weight: 900;
  font-size: 13px;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
}
.cbdleon-promo__btn:hover{
  filter: brightness(1.05);
}

/* Posición (Customizer) */
.cbdleon-promo--x-left{ justify-content: flex-start; }
.cbdleon-promo--x-center{ justify-content: center; }
.cbdleon-promo--x-right{ justify-content: flex-end; }

.cbdleon-promo--y-top{ top: 0; }
.cbdleon-promo--y-middle{ top: 50%; transform: translateY(-50%); }
.cbdleon-promo--y-bottom{ bottom: 0; }

body.admin-bar .cbdleon-promo--y-top{ top: 32px; }

/* Responsive: que no tape demasiado en móvil */
@media (max-width: 640px){
  .cbdleon-promo__inner{
    border-radius: 18px;
    padding: 8px 10px;
    gap: 10px;
    flex-wrap: wrap;
  }
}

/* Aviso tienda WooCommerce (debajo del header) */
.cbd-store-notice{
  background: rgba(255, 255, 255, 0.06);
  border-bottom: 1px solid rgba(255,255,255,0.10);
  color: rgba(255,255,255,0.92);
  padding: 10px 16px;
  font-weight: 700;
  text-align: center;
}
.cbd-store-notice a{
  color: var(--primary-glow);
  font-weight: 900;
  text-decoration: underline;
}
