/*
Theme Name: Tienda Dropify Custom
Description: Child theme personalizado para tienda WooCommerce + Dropify. Base ligera, sin dependencias de builders pesados.
Author: Proyecto Ecommerce
Template: storefront
Version: 1.0.0
Text Domain: tienda-dropify
*/

/* ==========================================================================
   1. VARIABLES DE DISEÑO (Paleta y tipografía)
   ========================================================================== */
:root{
  /* Paleta moderna: azul profundo + coral de acento + neutros cálidos.
     Transmite confianza (azul) y urgencia/CTA (coral) sin saturar. */
  --color-primary:        #1C2B4A;   /* Azul profundo - headers, texto fuerte */
  --color-primary-light:  #2F4272;
  --color-accent:         #FF6B4A;   /* Coral - botones, precios, CTAs */
  --color-accent-hover:   #E85536;
  --color-bg:             #FAFAF8;   /* Fondo cálido, no blanco puro */
  --color-bg-alt:         #F0F1EE;
  --color-text:           #22262E;
  --color-text-muted:     #6B7280;
  --color-border:         #E5E5E0;
  --color-success:        #2E9E5B;
  --color-star:           #F5B301;

  --font-heading: 'Poppins', -apple-system, sans-serif;
  --font-body: 'Inter', -apple-system, sans-serif;

  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 20px;

  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
  --shadow-md: 0 6px 20px rgba(0,0,0,0.08);
  --shadow-lg: 0 12px 32px rgba(0,0,0,0.12);

  --transition: 220ms cubic-bezier(.4,0,.2,1);
}

/* ==========================================================================
   2. RESET LIGERO Y BASE
   ========================================================================== */
body{
  font-family: var(--font-body);
  color: var(--color-text);
  background: var(--color-bg);
  line-height: 1.6;
}
h1,h2,h3,h4,h5{
  font-family: var(--font-heading);
  color: var(--color-primary);
  font-weight: 600;
  line-height: 1.25;
}
a{ transition: color var(--transition); }
img{ max-width:100%; height:auto; display:block; }

/* ==========================================================================
   3. HERO SECTION (home)
   ========================================================================== */
.hero-section{
  position: relative;
  min-height: 70vh;
  display: flex;
  align-items: center;
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-light) 100%);
  color: #fff;
  overflow: hidden;
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}
.hero-section__content{
  max-width: 640px;
  padding: 3rem 5vw;
  z-index: 2;
}
.hero-section__content h1{
  color: #fff;
  font-size: clamp(2rem, 5vw, 3.4rem);
  margin-bottom: 1rem;
}
.hero-section__content p{
  font-size: 1.15rem;
  color: rgba(255,255,255,.85);
  margin-bottom: 2rem;
}
.hero-cta{
  display: inline-block;
  background: var(--color-accent);
  color: #fff;
  padding: .9rem 2.2rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
  text-decoration: none;
  transition: transform var(--transition), background var(--transition), box-shadow var(--transition);
  box-shadow: var(--shadow-md);
}
.hero-cta:hover{
  background: var(--color-accent-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  color: #fff;
}

/* ==========================================================================
   4. CATEGORÍAS DESTACADAS
   ========================================================================== */
.featured-categories{
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.25rem;
  padding: 3rem 5vw;
}
.category-card{
  position: relative;
  border-radius: var(--radius-md);
  overflow: hidden;
  aspect-ratio: 4/3;
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition), box-shadow var(--transition);
}
.category-card:hover{
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
}
.category-card img{
  width: 100%; height: 100%; object-fit: cover;
  transition: transform 400ms ease;
}
.category-card:hover img{ transform: scale(1.08); }
.category-card__label{
  position: absolute; bottom:0; left:0; right:0;
  background: linear-gradient(to top, rgba(0,0,0,.65), transparent);
  color:#fff; padding: 1.2rem 1rem .8rem;
  font-family: var(--font-heading); font-weight:600;
}

/* ==========================================================================
   5. GRID DE PRODUCTOS + TARJETA DE PRODUCTO
   ========================================================================== */
.products-grid{
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1.5rem;
  padding: 2rem 5vw;
}
.product-card{
  background:#fff;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
  overflow: hidden;
  transition: transform var(--transition), box-shadow var(--transition);
  position: relative;
}
.product-card:hover{
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}
.product-card__image-wrap{ position: relative; overflow: hidden; aspect-ratio: 1/1; background: var(--color-bg-alt); }
.product-card__image-wrap img{ width:100%; height:100%; object-fit: cover; transition: transform 350ms ease, opacity 350ms ease; }
.product-card:hover .product-card__image-wrap img.img-primary{ opacity:0; }
.product-card__image-wrap img.img-secondary{
  position:absolute; inset:0; opacity:0; transition: opacity 350ms ease;
}
.product-card:hover .img-secondary{ opacity:1; }

.product-card__badge{
  position:absolute; top:.75rem; left:.75rem;
  background: var(--color-accent); color:#fff;
  font-size:.72rem; font-weight:700; letter-spacing:.03em;
  padding: .3rem .6rem; border-radius: 999px;
  z-index: 2;
}
.product-card__quick-add{
  position:absolute; right:.6rem; bottom:.6rem;
  background:#fff; border:none; border-radius:50%;
  width:40px; height:40px; display:flex; align-items:center; justify-content:center;
  box-shadow: var(--shadow-sm); cursor:pointer;
  opacity:0; transform: translateY(8px);
  transition: opacity var(--transition), transform var(--transition), background var(--transition);
}
.product-card:hover .product-card__quick-add{ opacity:1; transform: translateY(0); }
.product-card__quick-add:hover{ background: var(--color-accent); color:#fff; }

.product-card__body{ padding: 1rem 1.1rem 1.2rem; }
.product-card__title{ font-size: .98rem; font-weight:600; margin: 0 0 .35rem; color: var(--color-text); }
.product-card__rating{ color: var(--color-star); font-size:.85rem; margin-bottom:.4rem; }
.product-card__price{ font-family: var(--font-heading); font-weight:700; color: var(--color-accent); font-size:1.05rem; }
.product-card__price del{ color: var(--color-text-muted); font-weight:400; margin-right:.4rem; font-size:.9rem; }

/* ==========================================================================
   6. FILTROS DINÁMICOS (sidebar / offcanvas en móvil)
   ========================================================================== */
.filters-bar{
  display:flex; align-items:center; justify-content:space-between;
  padding: 0 5vw; margin-bottom: 1rem; flex-wrap: wrap; gap: .75rem;
}
.filters-toggle-btn{
  display:none;
  background: var(--color-primary); color:#fff; border:none;
  padding:.6rem 1.1rem; border-radius: var(--radius-sm); cursor:pointer; font-weight:600;
}
.filter-group{ border-bottom: 1px solid var(--color-border); padding: 1rem 0; }
.filter-group__title{
  display:flex; justify-content:space-between; align-items:center;
  cursor:pointer; font-weight:600; font-family: var(--font-heading);
  user-select:none;
}
.filter-group__title .chevron{ transition: transform var(--transition); }
.filter-group.is-open .chevron{ transform: rotate(180deg); }
.filter-group__content{
  max-height:0; overflow:hidden; transition: max-height var(--transition), opacity var(--transition);
  opacity:0;
}
.filter-group.is-open .filter-group__content{ max-height: 500px; opacity:1; margin-top:.75rem; }

.filter-chip{
  display:inline-flex; align-items:center; gap:.4rem;
  background: var(--color-bg-alt); border-radius: 999px;
  padding: .35rem .8rem; font-size:.82rem; margin: 0 .4rem .4rem 0;
}
.filter-chip button{ background:none; border:none; cursor:pointer; color: var(--color-text-muted); }

@media (max-width: 880px){
  .filters-toggle-btn{ display:inline-block; }
  .filters-sidebar{
    position: fixed; top:0; right:-100%; width: min(340px, 88vw); height:100vh;
    background:#fff; z-index: 999; box-shadow: var(--shadow-lg);
    transition: right var(--transition); overflow-y:auto; padding: 1.5rem;
  }
  .filters-sidebar.is-open{ right:0; }
  .filters-overlay{
    display:none; position:fixed; inset:0; background:rgba(0,0,0,.4); z-index:998;
  }
  .filters-overlay.is-open{ display:block; }
}

/* ==========================================================================
   7. GALERÍA DE PRODUCTO (página individual)
   ========================================================================== */
.product-gallery{ display:flex; gap: .75rem; }
.product-gallery__thumbs{ display:flex; flex-direction:column; gap:.6rem; width:72px; flex-shrink:0; }
.product-gallery__thumbs img{
  border-radius: var(--radius-sm); cursor:pointer; border: 2px solid transparent;
  opacity:.65; transition: opacity var(--transition), border-color var(--transition);
}
.product-gallery__thumbs img.is-active,
.product-gallery__thumbs img:hover{ opacity:1; border-color: var(--color-accent); }
.product-gallery__main{ flex:1; border-radius: var(--radius-md); overflow:hidden; background: var(--color-bg-alt); position:relative; }
.product-gallery__main img{ width:100%; transition: opacity 250ms ease; }
@media (max-width:600px){
  .product-gallery{ flex-direction: column-reverse; }
  .product-gallery__thumbs{ flex-direction:row; width:100%; overflow-x:auto; }
  .product-gallery__thumbs img{ width:56px; height:56px; object-fit:cover; }
}

/* ==========================================================================
   8. BOTONES GENERALES / WOOCOMMERCE OVERRIDES
   ========================================================================== */
.woocommerce a.button, .woocommerce button.button, .woocommerce input.button,
.wc-forward, .add_to_cart_button, .single_add_to_cart_button{
  background: var(--color-accent) !important;
  color: #fff !important;
  border-radius: var(--radius-sm) !important;
  border: none !important;
  padding: .8rem 1.6rem !important;
  font-weight: 600 !important;
  transition: background var(--transition), transform var(--transition) !important;
}
.woocommerce a.button:hover, .woocommerce button.button:hover,
.add_to_cart_button:hover, .single_add_to_cart_button:hover{
  background: var(--color-accent-hover) !important;
  transform: translateY(-2px);
}

/* ==========================================================================
   9. BADGE DE OFERTAS / SECCIÓN DE DESCUENTOS
   ========================================================================== */
.deals-banner{
  background: var(--color-primary);
  color:#fff; text-align:center; padding: .6rem 1rem;
  font-size:.85rem; font-weight:500;
}
.deals-banner strong{ color: var(--color-accent); }

/* ==========================================================================
   10. ACCESIBILIDAD / RENDIMIENTO
   ========================================================================== */
@media (prefers-reduced-motion: reduce){
  *{ transition: none !important; animation: none !important; }
}
