/* ============================================================
   ModaUrbana — components.css
   Header, hero, tarjetas, drawers y demás componentes.
   ============================================================ */

/* ---------- Topbar ---------- */
.topbar { background: var(--black); color: var(--white); font-size: 0.82rem; }
.topbar__inner { display: flex; justify-content: center; padding: 8px 0; }
.topbar__text { text-align: center; }
.topbar strong { color: var(--accent); }

/* ---------- Header ---------- */
.header {
  position: sticky; top: 0; z-index: var(--z-header); background: rgba(255,255,255,0.9);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border); transition: box-shadow var(--transition);
}
.header.is-scrolled { box-shadow: var(--shadow-sm); }
.header__inner { display: flex; align-items: center; gap: var(--sp-4); height: var(--header-h); }
.logo { font-size: 1.35rem; font-weight: 900; letter-spacing: -0.03em; color: var(--black); }
.logo__accent { color: var(--accent); }
.logo--footer { font-size: 1.5rem; color: var(--white); }
.logo--footer .logo__accent { color: var(--accent); }

.nav { margin-left: auto; }
.nav__menu { display: flex; align-items: center; gap: 4px; }
.nav__link {
  padding: 8px 14px; font-size: 0.94rem; font-weight: 500; color: var(--gray-700);
  border-radius: var(--radius-sm); transition: color 0.2s var(--ease), background 0.2s var(--ease);
}
.nav__link:hover { color: var(--accent); background: var(--gray-100); }
.header__actions { display: flex; align-items: center; gap: 2px; margin-left: auto; }
.nav + .header__actions { margin-left: var(--sp-4); }
.header__menu-toggle { display: none; }

/* Buscador */
.search-bar { border-top: 1px solid var(--border); padding: var(--sp-4) 0; background: var(--white); }
.search-bar[hidden] { display: none; }
.search-bar__form { display: flex; align-items: center; gap: 12px; }
.search-bar__form > svg { color: var(--gray-400); flex-shrink: 0; }
.search-bar__input { flex: 1; border: none; font-size: 1.05rem; padding: 6px 0; }
.search-bar__input:focus { outline: none; }
.search-bar__results { margin-top: var(--sp-3); display: grid; gap: 8px; }
.search-result {
  display: flex; align-items: center; gap: 12px; padding: 8px; border-radius: var(--radius-sm);
  transition: background 0.2s var(--ease);
}
.search-result:hover { background: var(--gray-100); }
.search-result img { width: 48px; height: 56px; object-fit: cover; border-radius: 6px; }
.search-result__name { font-weight: 600; font-size: 0.92rem; }
.search-result__price { font-size: 0.85rem; color: var(--accent); font-weight: 600; }
.search-result__empty { color: var(--text-muted); padding: 8px; font-size: 0.92rem; }

/* ---------- Hero ---------- */
.hero { position: relative; min-height: min(88vh, 720px); display: flex; align-items: center; overflow: hidden; }
.hero__bg { position: absolute; inset: 0; z-index: -1; }
.hero__img { width: 100%; height: 100%; object-fit: cover; animation: heroZoom 16s ease-out forwards; }
@keyframes heroZoom { from { transform: scale(1.1); } to { transform: scale(1); } }
.hero__overlay { position: absolute; inset: 0; background: linear-gradient(90deg, rgba(17,24,39,0.78), rgba(17,24,39,0.35) 60%, transparent); }
.hero__content { position: relative; color: var(--white); max-width: 680px; padding-block: 60px; }
.hero__badge {
  display: inline-block; font-size: 0.8rem; font-weight: 600; letter-spacing: 0.06em;
  text-transform: uppercase; padding: 8px 16px; border-radius: var(--radius-full);
  background: rgba(255,255,255,0.16); border: 1px solid rgba(255,255,255,0.24);
  backdrop-filter: blur(6px); margin-bottom: var(--sp-5);
}
.hero__title { font-size: clamp(2.2rem, 5.5vw, 4rem); font-weight: 900; color: var(--white); line-height: 1.05; margin-bottom: var(--sp-4); }
.hero__subtitle { font-size: clamp(1.05rem, 2vw, 1.3rem); color: rgba(255,255,255,0.85); max-width: 500px; margin-bottom: var(--sp-6); }
.hero__actions { display: flex; flex-wrap: wrap; gap: var(--sp-4); }

/* ---------- Indicadores ---------- */
.indicators { border-bottom: 1px solid var(--border); }
.indicators__grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--sp-5); padding: var(--sp-7) 0; }
.indicator { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; }
.indicator__num { font-size: clamp(1.8rem, 3vw, 2.6rem); font-weight: 900; color: var(--black); letter-spacing: -0.03em; line-height: 1; }
.indicator__icon { color: var(--accent); }
.indicator__label { font-size: 0.9rem; color: var(--text-muted); font-weight: 500; }

/* ---------- Categorías ---------- */
.categories { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--sp-5); }
.category {
  position: relative; aspect-ratio: 3 / 4; border-radius: var(--radius-lg);
  overflow: hidden; display: flex; align-items: flex-end; color: var(--white); isolation: isolate;
}
.category__img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -2; transition: transform 0.6s var(--ease); }
.category::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(to top, rgba(17,24,39,0.85), rgba(17,24,39,0.1) 60%); }
.category:hover .category__img { transform: scale(1.06); }
.category__body { padding: var(--sp-5); width: 100%; }
.category__name { font-size: 1.4rem; color: var(--white); margin-bottom: 4px; }
.category__count { font-size: 0.85rem; color: rgba(255,255,255,0.8); }
.category__btn {
  display: inline-flex; align-items: center; gap: 6px; margin-top: var(--sp-3);
  font-size: 0.9rem; font-weight: 600; padding: 8px 16px; border-radius: var(--radius-full);
  background: var(--white); color: var(--black); transition: gap 0.25s var(--ease), background 0.2s var(--ease);
}
.category__btn:hover { gap: 12px; background: var(--accent); color: var(--white); }
.category--wide { grid-column: span 2; aspect-ratio: 16 / 9; }

/* ---------- Tarjeta de producto ---------- */
.products { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--sp-5); }
.products__empty { text-align: center; color: var(--text-muted); padding: var(--sp-7) 0; }
.product-card { position: relative; background: var(--white); border-radius: var(--radius); overflow: hidden; transition: transform var(--transition), box-shadow var(--transition); }
.product-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.product-card__media { position: relative; aspect-ratio: 3 / 4; overflow: hidden; background: var(--gray-100); display: block; }
.product-card__img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: opacity 0.4s var(--ease); }
.product-card__img--hover { opacity: 0; }
.product-card:hover .product-card__img--hover { opacity: 1; }
.product-card:hover .product-card__img--main { opacity: 0; }
.product-card__badges { position: absolute; top: 12px; left: 12px; display: flex; flex-direction: column; gap: 6px; z-index: 2; }
.badge { font-size: 0.68rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; padding: 5px 10px; border-radius: var(--radius-full); color: var(--white); }
.badge--new { background: var(--accent); }
.badge--sale { background: var(--sale); }
.badge--best { background: var(--black); }
.product-card__fav {
  position: absolute; top: 12px; right: 12px; z-index: 2;
  width: 38px; height: 38px; border-radius: var(--radius-full); background: rgba(255,255,255,0.92);
  display: inline-flex; align-items: center; justify-content: center; color: var(--gray-600);
  transition: color 0.2s var(--ease), transform 0.2s var(--ease), background 0.2s var(--ease);
}
.product-card__fav:hover { transform: scale(1.1); }
.product-card__fav.is-active { color: var(--sale); }
.product-card__fav.is-active svg { fill: var(--sale); }
.product-card__add {
  position: absolute; left: 12px; right: 12px; bottom: 12px; z-index: 2;
  opacity: 0; transform: translateY(10px); transition: opacity var(--transition), transform var(--transition);
}
.product-card:hover .product-card__add { opacity: 1; transform: none; }
.product-card__body { padding: var(--sp-4); }
.product-card__cat { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--gray-400); font-weight: 600; }
.product-card__name { font-size: 0.98rem; font-weight: 600; margin: 4px 0 6px; color: var(--black); }
.product-card__name a:hover { color: var(--accent); }
.product-card__rating { display: flex; align-items: center; gap: 4px; margin-bottom: 8px; font-size: 0.8rem; color: var(--gray-500); }
.product-card__stars { display: inline-flex; color: #F59E0B; }
.product-card__price { display: flex; align-items: baseline; gap: 8px; }
.product-card__price-now { font-size: 1.1rem; font-weight: 800; color: var(--black); }
.product-card__price-old { font-size: 0.9rem; color: var(--gray-400); text-decoration: line-through; }
.product-card__discount { font-size: 0.78rem; font-weight: 700; color: var(--sale); }

/* ---------- Promos ---------- */
.promos { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--sp-5); }
.promo { padding: var(--sp-6); border-radius: var(--radius-lg); display: flex; flex-direction: column; align-items: flex-start; gap: var(--sp-3); min-height: 240px; }
.promo__label { font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; padding: 5px 12px; border-radius: var(--radius-full); background: rgba(255,255,255,0.2); }
.promo__title { font-size: 1.5rem; line-height: 1.2; }
.promo__text { font-size: 0.95rem; opacity: 0.9; margin-bottom: auto; }
.promo--dark { background: var(--black); color: var(--white); }
.promo--dark .promo__title { color: var(--white); }
.promo--accent { background: linear-gradient(135deg, var(--accent), var(--accent-dark)); color: var(--white); }
.promo--accent .promo__title { color: var(--white); }
.promo--light { background: var(--gray-100); color: var(--gray-700); }
.promo--light .promo__label { background: var(--white); color: var(--accent); }

/* ---------- Beneficios ---------- */
.benefits { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--sp-5); }
.benefit { display: flex; flex-direction: column; gap: 8px; padding: var(--sp-5); background: var(--white); border: 1px solid var(--border); border-radius: var(--radius); transition: transform var(--transition), box-shadow var(--transition); }
.benefit:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.benefit__icon { display: inline-flex; align-items: center; justify-content: center; width: 52px; height: 52px; border-radius: var(--radius-sm); background: var(--accent-soft); color: var(--accent); margin-bottom: 6px; }
.benefit h3 { font-size: 1.05rem; }
.benefit p { font-size: 0.9rem; color: var(--text-muted); line-height: 1.6; }

/* ---------- Carrusel (Novedades) ---------- */
.carousel { overflow: hidden; }
.carousel__nav { display: flex; gap: 8px; }
.carousel__track { display: flex; gap: var(--sp-5); transition: transform 0.5s var(--ease); }
.carousel__track > .product-card { flex: 0 0 calc((100% - 3 * var(--sp-5)) / 4); }

/* ---------- Testimonios ---------- */
.testimonials { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--sp-5); }
.testimonial { background: var(--white); border: 1px solid var(--border); border-radius: var(--radius); padding: var(--sp-5); }
.testimonial__stars { display: inline-flex; gap: 2px; color: #F59E0B; margin-bottom: var(--sp-3); }
.testimonial__text { font-size: 0.98rem; color: var(--gray-700); line-height: 1.65; margin-bottom: var(--sp-4); }
.testimonial__author { display: flex; align-items: center; gap: 12px; }
.testimonial__avatar { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; }
.testimonial__name { font-weight: 700; font-size: 0.92rem; display: flex; align-items: center; gap: 6px; }
.testimonial__verified { color: var(--success); }
.testimonial__role { font-size: 0.82rem; color: var(--text-muted); }

/* ---------- Blog ---------- */
.blog { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--sp-5); }
.blog-card { background: var(--white); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; transition: transform var(--transition), box-shadow var(--transition); }
.blog-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.blog-card__media { aspect-ratio: 16 / 10; overflow: hidden; }
.blog-card__img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.6s var(--ease); }
.blog-card:hover .blog-card__img { transform: scale(1.06); }
.blog-card__body { padding: var(--sp-5); }
.blog-card__tag { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--accent); font-weight: 700; }
.blog-card__title { font-size: 1.1rem; margin: 8px 0; line-height: 1.3; }
.blog-card__title a:hover { color: var(--accent); }
.blog-card__excerpt { font-size: 0.9rem; color: var(--text-muted); line-height: 1.6; margin-bottom: 10px; }
.blog-card__meta { font-size: 0.8rem; color: var(--gray-400); }

/* ---------- Newsletter ---------- */
.newsletter { background: var(--black); color: var(--white); padding: clamp(48px, 7vw, 80px) 0; }
.newsletter__inner { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-6); align-items: center; }
.newsletter__title { font-size: clamp(1.6rem, 3vw, 2.4rem); color: var(--white); margin-bottom: 10px; }
.newsletter__subtitle { color: rgba(255,255,255,0.75); }
.newsletter__fields { display: flex; gap: 10px; flex-wrap: wrap; }
.newsletter__fields .field { flex: 1; min-width: 160px; }
.newsletter__msg { margin-top: 12px; font-size: 0.9rem; }
.newsletter__msg--ok { color: #86EFAC; }
.newsletter__msg--err { color: #FCA5A5; }

/* ---------- Footer ---------- */
.footer { background: #0B1220; color: rgba(255,255,255,0.66); padding: clamp(48px, 7vw, 72px) 0 28px; }
.footer__grid { display: grid; grid-template-columns: 1.8fr 1fr 1fr 1fr 1.2fr; gap: var(--sp-6); padding-bottom: var(--sp-6); border-bottom: 1px solid rgba(255,255,255,0.1); }
.footer__desc { font-size: 0.9rem; line-height: 1.7; margin: var(--sp-4) 0; max-width: 300px; }
.footer__social { display: flex; gap: 10px; }
.footer__social-link { width: 40px; height: 40px; border-radius: var(--radius-sm); display: inline-flex; align-items: center; justify-content: center; background: rgba(255,255,255,0.08); color: var(--white); transition: background 0.25s var(--ease), transform 0.25s var(--ease); }
.footer__social-link:hover { background: var(--accent); transform: translateY(-3px); }
.footer__title { color: var(--white); font-size: 0.95rem; margin-bottom: var(--sp-4); }
.footer__list { display: flex; flex-direction: column; gap: 10px; }
.footer__link { font-size: 0.9rem; transition: color 0.2s var(--ease), padding-left 0.2s var(--ease); }
.footer__link:hover { color: var(--accent); padding-left: 4px; }
.footer__payments { display: flex; flex-wrap: wrap; gap: 8px; }
.pay-chip { font-size: 0.72rem; font-weight: 700; padding: 6px 10px; border-radius: 6px; background: rgba(255,255,255,0.1); color: var(--white); }
.footer__bottom { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; padding-top: var(--sp-5); font-size: 0.84rem; color: rgba(255,255,255,0.5); }

/* ---------- Drawers (carrito / wishlist) ---------- */
.drawer { position: fixed; inset: 0; z-index: var(--z-drawer); visibility: hidden; }
.drawer.is-open { visibility: visible; }
.drawer__overlay { position: absolute; inset: 0; background: rgba(17,24,39,0.5); opacity: 0; transition: opacity var(--transition); }
.drawer.is-open .drawer__overlay { opacity: 1; }
.drawer__panel {
  position: absolute; top: 0; right: 0; height: 100%; width: min(420px, 100%);
  background: var(--white); display: flex; flex-direction: column;
  transform: translateX(100%); transition: transform var(--transition); box-shadow: var(--shadow-lg);
}
.drawer.is-open .drawer__panel { transform: none; }
.drawer__head { display: flex; align-items: center; justify-content: space-between; padding: var(--sp-5); border-bottom: 1px solid var(--border); }
.drawer__title { font-size: 1.2rem; }
.drawer__body { flex: 1; overflow-y: auto; padding: var(--sp-5); display: flex; flex-direction: column; gap: var(--sp-4); }
.drawer__empty { text-align: center; color: var(--text-muted); padding: var(--sp-7) 0; }
.drawer__foot { padding: var(--sp-5); border-top: 1px solid var(--border); display: flex; flex-direction: column; gap: var(--sp-3); }
.drawer__foot[hidden] { display: none; }
.drawer__coupon { display: flex; gap: 8px; }
.drawer__row { display: flex; align-items: center; justify-content: space-between; font-size: 0.95rem; color: var(--gray-600); }
.drawer__row--total { font-size: 1.15rem; color: var(--black); padding-top: 8px; border-top: 1px dashed var(--border); }
.drawer__row--total strong { font-weight: 800; }
.drawer__row--discount strong { color: var(--success); }

/* Ítem del carrito */
.cart-item { display: grid; grid-template-columns: 68px 1fr auto; gap: 12px; align-items: start; }
.cart-item__img { width: 68px; height: 82px; object-fit: cover; border-radius: var(--radius-sm); }
.cart-item__name { font-weight: 600; font-size: 0.9rem; line-height: 1.3; }
.cart-item__meta { font-size: 0.8rem; color: var(--text-muted); margin: 2px 0 8px; }
.cart-item__price { font-weight: 700; color: var(--accent); font-size: 0.92rem; }
.cart-item__qty { display: inline-flex; align-items: center; border: 1px solid var(--border); border-radius: var(--radius-full); overflow: hidden; margin-top: 6px; }
.cart-item__qty button { width: 28px; height: 28px; display: inline-flex; align-items: center; justify-content: center; font-size: 1rem; color: var(--gray-600); }
.cart-item__qty button:hover { background: var(--gray-100); color: var(--black); }
.cart-item__qty span { min-width: 28px; text-align: center; font-size: 0.88rem; font-weight: 600; }
.cart-item__remove { color: var(--gray-400); font-size: 0.78rem; }
.cart-item__remove:hover { color: var(--danger); }
