/* ============================================================
   RepuestosMax — components.css
   ============================================================ */

/* ---------- Topbar ---------- */
.topbar { background: var(--navy-dark); color: rgba(255,255,255,0.9); font-size: 0.82rem; }
.topbar__inner { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-4); padding: 8px 0; }
.topbar__item { display: inline-flex; align-items: center; gap: 6px; }
.topbar__item svg { opacity: 0.85; }

/* ---------- Header ---------- */
.header { position: sticky; top: 0; z-index: var(--z-header); background: var(--white); 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 { display: inline-flex; align-items: center; gap: 8px; font-size: 1.3rem; font-weight: 900; letter-spacing: -0.03em; color: var(--navy); }
.logo__mark { display: inline-flex; color: var(--red); }
.logo__accent { color: var(--red); }
.logo--footer { font-size: 1.4rem; color: var(--white); }
.logo--footer .logo__accent { color: var(--red); }
.logo--footer .logo__mark { color: var(--red); }

/* Buscador SKU en header */
.header__search { position: relative; flex: 1; max-width: 440px; display: flex; align-items: center; gap: 10px; padding: 0 14px; background: var(--gray-100); border: 1.5px solid transparent; border-radius: var(--radius-full); transition: border-color 0.2s var(--ease), background 0.2s var(--ease); }
.header__search:focus-within { background: var(--white); border-color: var(--navy); }
.header__search > svg { color: var(--gray-400); flex-shrink: 0; }
.header__search-input { flex: 1; border: none; background: none; padding: 11px 0; font-size: 0.92rem; }
.header__search-input:focus { outline: none; }
.header__search-results { position: absolute; top: calc(100% + 8px); left: 0; right: 0; background: var(--white); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-lg); padding: 8px; display: none; z-index: 20; max-height: 380px; overflow-y: auto; }
.header__search-results.is-open { display: block; }
.search-result { display: flex; align-items: center; gap: 12px; padding: 8px; border-radius: var(--radius-sm); transition: background 0.2s var(--ease); cursor: pointer; }
.search-result:hover { background: var(--gray-100); }
.search-result img { width: 48px; height: 48px; object-fit: cover; border-radius: 6px; background: var(--gray-100); }
.search-result__name { font-weight: 600; font-size: 0.9rem; }
.search-result__sku { font-size: 0.78rem; color: var(--gray-400); }
.search-result__price { font-size: 0.85rem; color: var(--red); font-weight: 700; }
.search-result__empty { color: var(--text-muted); padding: 10px; font-size: 0.9rem; }

.nav { margin-left: auto; }
.nav__menu { display: flex; align-items: center; gap: 2px; }
.nav__link { padding: 8px 12px; font-size: 0.92rem; 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(--navy); background: var(--gray-100); }
.header__actions { display: flex; align-items: center; gap: 2px; }
.header__menu-toggle { display: none; }

/* ---------- Hero ---------- */
.hero { position: relative; min-height: min(78vh, 640px); 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(23,43,102,0.92), rgba(30,58,138,0.6) 55%, rgba(15,23,42,0.35)); }
.hero__content { position: relative; color: var(--white); max-width: var(--container); padding-block: 56px; }
.hero__badge { display: inline-flex; align-items: center; gap: 8px; font-size: 0.82rem; font-weight: 600; padding: 8px 16px; border-radius: var(--radius-full); background: rgba(255,255,255,0.14); border: 1px solid rgba(255,255,255,0.22); backdrop-filter: blur(6px); margin-bottom: var(--sp-5); }
.hero__badge-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--red); animation: pulse 2s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(220,38,38,0.5); } 70% { box-shadow: 0 0 0 9px rgba(220,38,38,0); } 100% { box-shadow: 0 0 0 0 rgba(220,38,38,0); } }
.hero__title { font-size: clamp(2.1rem, 5vw, 3.8rem); font-weight: 900; color: var(--white); line-height: 1.06; margin-bottom: var(--sp-4); }
.hero__subtitle { font-size: clamp(1.05rem, 2vw, 1.25rem); color: rgba(255,255,255,0.86); max-width: 520px; margin-bottom: var(--sp-6); }
.hero__actions { display: flex; flex-wrap: wrap; gap: var(--sp-4); }

/* ---------- Indicadores ---------- */
.indicators { border-bottom: 1px solid var(--border); background: var(--white); }
.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(--navy); letter-spacing: -0.03em; line-height: 1; }
.indicator__icon { color: var(--red); }
.indicator__label { font-size: 0.9rem; color: var(--text-muted); font-weight: 500; }

/* ---------- Buscador por vehículo ---------- */
.finder { padding: 0; margin-top: -48px; position: relative; z-index: 5; }
.finder__card { background: var(--white); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); padding: clamp(24px, 4vw, 40px); border-top: 4px solid var(--red); }
.finder__head { display: flex; align-items: center; gap: var(--sp-4); margin-bottom: var(--sp-5); }
.finder__icon { display: inline-flex; align-items: center; justify-content: center; width: 60px; height: 60px; flex-shrink: 0; border-radius: var(--radius); background: var(--navy); color: var(--white); }
.finder__title { font-size: clamp(1.3rem, 2.4vw, 1.8rem); }
.finder__subtitle { color: var(--text-muted); font-size: 0.95rem; }
.finder__form { display: grid; grid-template-columns: repeat(5, 1fr); gap: var(--sp-4); align-items: end; }
.finder__field { display: flex; flex-direction: column; gap: 6px; }
.finder__field label { font-size: 0.85rem; font-weight: 600; color: var(--gray-700); }
.finder__actions { grid-column: 1 / -1; display: flex; gap: var(--sp-3); }
.finder__actions .btn { flex: 1; max-width: 240px; }
.finder__result { margin-top: var(--sp-4); font-size: 0.95rem; color: var(--navy); font-weight: 600; }
.finder__result:empty { display: none; }

/* ---------- Categorías ---------- */
.categories { display: grid; grid-template-columns: repeat(5, 1fr); gap: var(--sp-4); }
.category { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: var(--sp-5) var(--sp-3); background: var(--white); border: 1px solid var(--border); border-radius: var(--radius); text-align: center; transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition); cursor: pointer; }
.category:hover { transform: translateY(-4px); box-shadow: var(--shadow); border-color: var(--navy); }
.category__icon { display: inline-flex; align-items: center; justify-content: center; width: 60px; height: 60px; border-radius: 50%; background: var(--gray-100); color: var(--navy); transition: background var(--transition), color var(--transition); }
.category:hover .category__icon { background: var(--navy); color: var(--white); }
.category__name { font-size: 0.95rem; font-weight: 600; color: var(--text-strong); }
.category__count { font-size: 0.8rem; color: var(--text-muted); }

/* ---------- 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: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; 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: 1 / 1; overflow: hidden; background: var(--gray-100); }
.product-card__img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s var(--ease); }
.product-card:hover .product-card__img { transform: scale(1.06); }
.product-card__fav { position: absolute; top: 10px; right: 10px; z-index: 2; width: 36px; height: 36px; border-radius: var(--radius-full); background: rgba(255,255,255,0.94); display: inline-flex; align-items: center; justify-content: center; color: var(--gray-500); transition: color 0.2s var(--ease), transform 0.2s var(--ease); }
.product-card__fav:hover { transform: scale(1.1); }
.product-card__fav.is-active { color: var(--red); }
.product-card__fav.is-active svg { fill: var(--red); }
.product-card__stock { position: absolute; top: 10px; left: 10px; z-index: 2; font-size: 0.7rem; font-weight: 700; padding: 4px 10px; border-radius: var(--radius-full); }
.product-card__stock--in { background: rgba(22,163,74,0.12); color: var(--success); }
.product-card__stock--low { background: rgba(217,119,6,0.14); color: var(--warning); }
.product-card__stock--out { background: rgba(220,38,38,0.12); color: var(--red); }
.product-card__body { padding: var(--sp-4); display: flex; flex-direction: column; gap: 4px; flex: 1; }
.product-card__brand { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--gray-400); font-weight: 700; }
.product-card__name { font-size: 0.95rem; font-weight: 600; color: var(--text-strong); line-height: 1.3; }
.product-card__sku { font-size: 0.78rem; color: var(--gray-500); }
.product-card__compat { font-size: 0.78rem; color: var(--navy); background: rgba(30,58,138,0.06); padding: 4px 8px; border-radius: 6px; align-self: flex-start; }
.product-card__price { font-size: 1.2rem; font-weight: 800; color: var(--text-strong); margin-top: 4px; }
.product-card__actions { display: flex; gap: 8px; margin-top: auto; padding-top: var(--sp-3); }
.product-card__actions .btn { flex: 1; }

/* ---------- Benefits / Promos / Testimonials / Blog (compartidos) ---------- */
.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: rgba(30,58,138,0.08); color: var(--navy); margin-bottom: 6px; }
.benefit h3 { font-size: 1.05rem; }
.benefit p { font-size: 0.9rem; color: var(--text-muted); line-height: 1.6; }

.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.45rem; line-height: 1.2; }
.promo__text { font-size: 0.95rem; opacity: 0.92; margin-bottom: auto; }
.promo--red { background: linear-gradient(135deg, var(--red), var(--red-dark)); color: var(--white); }
.promo--red .promo__title { color: var(--white); }
.promo--dark { background: var(--navy); color: var(--white); }
.promo--dark .promo__title { color: var(--white); }
.promo--light { background: var(--gray-100); color: var(--gray-700); }
.promo--light .promo__label { background: var(--white); color: var(--red); }

.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 { 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(--red); font-weight: 700; }
.blog-card__title { font-size: 1.1rem; margin: 8px 0; line-height: 1.3; }
.blog-card__title a:hover { color: var(--navy); }
.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); }

/* ---------- CTA ---------- */
.cta { background: var(--navy); color: var(--white); padding: clamp(48px, 7vw, 80px) 0; }
.cta__inner { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-6); flex-wrap: wrap; }
.cta__title { font-size: clamp(1.6rem, 3vw, 2.4rem); color: var(--white); margin-bottom: 10px; max-width: 640px; }
.cta__subtitle { color: rgba(255,255,255,0.78); max-width: 640px; }

/* ---------- Footer ---------- */
.footer { background: var(--gray-900); 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(--red); 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(--red); 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); }

/* ---------- Drawer ---------- */
.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(15,23,42,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(--text-strong); padding-top: 8px; border-top: 1px dashed var(--border); }
.drawer__row--total strong { font-weight: 800; }
.drawer__row--discount strong { color: var(--success); }

.cart-item { display: grid; grid-template-columns: 60px 1fr auto; gap: 12px; align-items: start; }
.cart-item__img { width: 60px; height: 60px; object-fit: cover; border-radius: var(--radius-sm); background: var(--gray-100); }
.cart-item__name { font-weight: 600; font-size: 0.9rem; line-height: 1.3; }
.cart-item__meta { font-size: 0.78rem; color: var(--text-muted); margin: 2px 0 8px; }
.cart-item__price { font-weight: 700; color: var(--red); 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(--text-strong); }
.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(--red); }

/* ---------- Modal ficha de producto ---------- */
.modal { position: fixed; inset: 0; z-index: var(--z-modal); display: flex; align-items: center; justify-content: center; padding: var(--sp-5); visibility: hidden; }
.modal.is-open { visibility: visible; }
.modal__overlay { position: absolute; inset: 0; background: rgba(15,23,42,0.6); opacity: 0; transition: opacity var(--transition); }
.modal.is-open .modal__overlay { opacity: 1; }
.modal__panel { position: relative; background: var(--white); border-radius: var(--radius-lg); max-width: 860px; width: 100%; max-height: 90vh; overflow-y: auto; box-shadow: var(--shadow-lg); transform: scale(0.96); opacity: 0; transition: transform var(--transition), opacity var(--transition); }
.modal.is-open .modal__panel { transform: none; opacity: 1; }
.modal__close { position: absolute; top: 14px; right: 14px; z-index: 2; background: var(--white); box-shadow: var(--shadow-sm); }
.modal__content { display: grid; grid-template-columns: 1fr 1fr; }
.modal__media { background: var(--gray-100); aspect-ratio: 1 / 1; }
.modal__media img { width: 100%; height: 100%; object-fit: cover; border-radius: var(--radius-lg) 0 0 var(--radius-lg); }
.modal__info { padding: clamp(24px, 4vw, 40px); }
.modal__brand { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--gray-400); font-weight: 700; }
.modal__name { font-size: 1.5rem; margin: 6px 0 10px; }
.modal__price { font-size: 1.8rem; font-weight: 900; color: var(--red); margin-bottom: var(--sp-4); }
.modal__specs { display: flex; flex-direction: column; gap: 10px; margin-bottom: var(--sp-5); }
.modal__spec { display: flex; justify-content: space-between; gap: 12px; font-size: 0.9rem; padding-bottom: 8px; border-bottom: 1px solid var(--border); }
.modal__spec-label { color: var(--text-muted); }
.modal__spec-value { font-weight: 600; color: var(--text-strong); text-align: right; }
.modal__compat-title { font-size: 0.9rem; font-weight: 700; margin-bottom: 8px; color: var(--text-strong); }
.modal__compat-list { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: var(--sp-5); }
.modal__compat-chip { font-size: 0.78rem; padding: 5px 12px; border-radius: var(--radius-full); background: rgba(30,58,138,0.08); color: var(--navy); font-weight: 500; }
.modal__actions { display: flex; gap: 10px; }
.modal__actions .btn { flex: 1; }
