/* ============================================================
   QUÍMICA 3D — Estilos principales
   Paleta: Violeta #6d28d9 | Blanco #ffffff | Negro #0f0f0f
   ============================================================ */

:root {
  --violet:       #6d28d9;
  --violet-dark:  #4c1d95;
  --violet-light: #8b5cf6;
  --violet-pale:  #ede9fe;
  --white:        #ffffff;
  --black:        #0f0f0f;
  --gray-100:     #f8f7ff;
  --gray-200:     #f0eeff;
  --gray-300:     #e5e0ff;
  --gray-600:     #6b6b7b;
  --gray-800:     #2d2d3b;
  --success:      #10b981;
  --danger:       #ef4444;
  --warning:      #f59e0b;
}

/* ── RESET & BASE ── */
*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: var(--gray-100);
  color: var(--black);
  line-height: 1.65;
  font-size: 16px;
}

a { color: var(--violet); text-decoration: none; transition: color .2s; }
a:hover { color: var(--violet-dark); }

img { max-width: 100%; height: auto; display: block; }

/* ── NAVBAR ── */
.navbar-quimica {
  background: var(--black) !important;
  border-bottom: 3px solid var(--violet);
  padding: 0.6rem 0;
}

.navbar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 1.3rem;
  color: var(--white) !important;
  letter-spacing: .5px;
}

.navbar-brand img {
  height: 44px;
  width: auto;
  border-radius: 6px;
}

.navbar-brand span { color: var(--violet-light); }

.nav-link-custom {
  color: rgba(255,255,255,.85) !important;
  font-weight: 500;
  padding: .5rem .9rem !important;
  border-radius: 6px;
  transition: background .2s, color .2s;
}
.nav-link-custom:hover,
.nav-link-custom.active {
  background: var(--violet);
  color: var(--white) !important;
}

.navbar-cart-btn {
  background: var(--violet);
  color: var(--white) !important;
  border-radius: 8px;
  padding: .45rem .9rem !important;
  font-weight: 600;
  position: relative;
}
.navbar-cart-btn:hover { background: var(--violet-dark); color: var(--white) !important; }

.cart-badge {
  position: absolute;
  top: -6px; right: -6px;
  background: #ef4444;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  border-radius: 50%;
  width: 20px; height: 20px;
  display: flex; align-items: center; justify-content: center;
  line-height: 1;
}

/* ── HERO / SLIDER ── */
.hero-slider { position: relative; overflow: hidden; max-height: 520px; }

.carousel-item img {
  width: 100%;
  height: 520px;
  object-fit: cover;
  filter: brightness(.7);
}

.carousel-caption-custom {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  padding: 2rem;
  background: linear-gradient(0deg, rgba(0,0,0,.75) 0%, transparent 100%);
  text-align: left;
}
.carousel-caption-custom h2 {
  font-size: clamp(1.4rem, 4vw, 2.5rem);
  font-weight: 800;
  color: #fff;
  text-shadow: 0 2px 8px rgba(0,0,0,.5);
  margin-bottom: .4rem;
}
.carousel-caption-custom p {
  color: rgba(255,255,255,.9);
  font-size: 1.05rem;
  margin-bottom: .8rem;
}

/* ── SECCIÓN TÍTULOS ── */
.section-title {
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--black);
  position: relative;
  margin-bottom: 1rem;
}
.section-title::after {
  content: '';
  display: block;
  width: 50px;
  height: 4px;
  background: var(--violet);
  border-radius: 2px;
  margin-top: 6px;
}
.section-title.centered::after { margin-left: auto; margin-right: auto; }

/* ── TARJETAS DE PRODUCTO ── */
.product-card {
  border: 1px solid var(--gray-300);
  border-radius: 14px;
  overflow: hidden;
  background: var(--white);
  transition: transform .25s, box-shadow .25s;
  height: 100%;
  display: flex;
  flex-direction: column;
}
.product-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 12px 32px rgba(109,40,217,.15);
}

.product-card-img {
  position: relative;
  overflow: hidden;
  aspect-ratio: 1/1;
  background: var(--gray-200);
}
.product-card-img img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform .35s;
}
.product-card:hover .product-card-img img { transform: scale(1.06); }

.product-badge {
  position: absolute;
  top: 10px; left: 10px;
  background: var(--violet);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: .5px;
}
.product-badge.out-of-stock { background: var(--gray-600); }

.product-card-body {
  padding: 1rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}
.product-card-title {
  font-weight: 700;
  font-size: .95rem;
  color: var(--black);
  margin-bottom: .35rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.product-card-category {
  font-size: .78rem;
  color: var(--gray-600);
  margin-bottom: .5rem;
}
.product-card-price {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--violet);
  margin-top: auto;
  padding-top: .5rem;
}

.btn-add-cart {
  background: var(--violet);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: .5rem 1rem;
  font-weight: 600;
  font-size: .9rem;
  width: 100%;
  cursor: pointer;
  transition: background .2s, transform .1s;
  margin-top: .6rem;
}
.btn-add-cart:hover { background: var(--violet-dark); }
.btn-add-cart:active { transform: scale(.97); }
.btn-add-cart:disabled { background: var(--gray-600); cursor: not-allowed; }

/* ── BOTONES GLOBALES ── */
.btn-violet {
  background: var(--violet);
  color: #fff;
  border: 2px solid var(--violet);
  border-radius: 8px;
  padding: .55rem 1.4rem;
  font-weight: 600;
  transition: background .2s, transform .1s;
}
.btn-violet:hover { background: var(--violet-dark); border-color: var(--violet-dark); color: #fff; }

.btn-outline-violet {
  background: transparent;
  color: var(--violet);
  border: 2px solid var(--violet);
  border-radius: 8px;
  padding: .5rem 1.4rem;
  font-weight: 600;
  transition: all .2s;
}
.btn-outline-violet:hover { background: var(--violet); color: #fff; }

/* ── BUSCADOR ── */
.search-bar {
  position: relative;
  max-width: 480px;
}
.search-bar input {
  border: 2px solid var(--gray-300);
  border-radius: 30px;
  padding: .6rem 1.2rem .6rem 3rem;
  width: 100%;
  font-size: .95rem;
  transition: border-color .2s;
  background: var(--white);
}
.search-bar input:focus { border-color: var(--violet); outline: none; box-shadow: 0 0 0 3px rgba(109,40,217,.15); }
.search-bar .search-icon {
  position: absolute;
  left: 14px; top: 50%;
  transform: translateY(-50%);
  color: var(--gray-600);
  pointer-events: none;
}

/* ── FILTROS SIDEBAR ── */
.filter-card {
  background: var(--white);
  border: 1px solid var(--gray-300);
  border-radius: 12px;
  padding: 1.2rem;
  margin-bottom: 1rem;
}
.filter-card h6 {
  font-weight: 700;
  color: var(--black);
  margin-bottom: .8rem;
  padding-bottom: .5rem;
  border-bottom: 2px solid var(--violet-pale);
}

/* ── CATEGORÍAS NAV PILLS ── */
.category-pill {
  display: inline-block;
  padding: .35rem .9rem;
  border-radius: 20px;
  font-size: .85rem;
  font-weight: 600;
  border: 2px solid var(--gray-300);
  color: var(--gray-800);
  transition: all .2s;
  cursor: pointer;
}
.category-pill:hover,
.category-pill.active {
  background: var(--violet);
  border-color: var(--violet);
  color: #fff;
}

/* ── PÁGINA DE PRODUCTO ── */
.product-gallery { position: relative; }
.product-main-img {
  width: 100%;
  aspect-ratio: 1/1;
  object-fit: cover;
  border-radius: 14px;
  border: 2px solid var(--gray-300);
  cursor: zoom-in;
}
.product-thumbs {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}
.product-thumb {
  width: 72px; height: 72px;
  object-fit: cover;
  border-radius: 8px;
  border: 2px solid var(--gray-300);
  cursor: pointer;
  transition: border-color .2s;
}
.product-thumb:hover,
.product-thumb.active { border-color: var(--violet); }

.product-title { font-size: 1.8rem; font-weight: 800; margin-bottom: .3rem; }
.product-price { font-size: 2rem; font-weight: 900; color: var(--violet); margin: .5rem 0; }

.variant-btn {
  border: 2px solid var(--gray-300);
  border-radius: 8px;
  padding: .4rem .9rem;
  cursor: pointer;
  font-weight: 600;
  background: var(--white);
  color: var(--black);
  transition: all .2s;
}
.variant-btn.selected,
.variant-btn:hover { border-color: var(--violet); background: var(--violet-pale); color: var(--violet); }

/* ── CARRITO ── */
.cart-item {
  background: var(--white);
  border: 1px solid var(--gray-300);
  border-radius: 12px;
  padding: 1rem;
  margin-bottom: .8rem;
  display: flex;
  gap: 1rem;
  align-items: center;
}
.cart-item-img {
  width: 80px; height: 80px;
  object-fit: cover;
  border-radius: 8px;
  flex-shrink: 0;
}
.qty-control {
  display: flex;
  align-items: center;
  gap: 6px;
}
.qty-btn {
  width: 30px; height: 30px;
  border-radius: 6px;
  border: 2px solid var(--gray-300);
  background: var(--white);
  font-weight: 700;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all .2s;
}
.qty-btn:hover { border-color: var(--violet); color: var(--violet); }
.qty-input {
  width: 46px;
  text-align: center;
  border: 2px solid var(--gray-300);
  border-radius: 6px;
  padding: .25rem;
  font-weight: 600;
}

.order-summary-card {
  background: var(--white);
  border: 1px solid var(--gray-300);
  border-radius: 14px;
  padding: 1.4rem;
  position: sticky;
  top: 80px;
}
.order-summary-card h5 { font-weight: 800; margin-bottom: 1rem; }
.summary-row { display: flex; justify-content: space-between; margin-bottom: .5rem; }
.summary-total { font-weight: 800; font-size: 1.2rem; color: var(--violet); border-top: 2px solid var(--gray-300); padding-top: .7rem; margin-top: .3rem; }

/* ── FORMULARIOS ── */
.form-control:focus,
.form-select:focus {
  border-color: var(--violet);
  box-shadow: 0 0 0 3px rgba(109,40,217,.15);
}
.form-label { font-weight: 600; color: var(--gray-800); font-size: .9rem; }

.form-card {
  background: var(--white);
  border: 1px solid var(--gray-300);
  border-radius: 14px;
  padding: 1.8rem;
}

/* ── SECCIÓN CONTACTO ── */
.contact-section { background: var(--white); }
.contact-section .card {
  border: 1px solid var(--gray-300);
  border-radius: 14px;
}

/* ── WHATSAPP FLOTANTE ── */
.whatsapp-float {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 999;
  width: 58px; height: 58px;
  background: #25d366;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 20px rgba(37,211,102,.45);
  transition: transform .2s, box-shadow .2s;
  cursor: pointer;
}
.whatsapp-float:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 28px rgba(37,211,102,.55);
}
.whatsapp-float svg { width: 32px; height: 32px; fill: #fff; }

/* ── FOOTER ── */
.footer {
  background: var(--black);
  color: rgba(255,255,255,.75);
  padding: 2.5rem 0 1.2rem;
  margin-top: 4rem;
}
.footer h6 { color: var(--violet-light); font-weight: 700; margin-bottom: 1rem; text-transform: uppercase; letter-spacing: .5px; font-size: .85rem; }
.footer a { color: rgba(255,255,255,.65); font-size: .9rem; }
.footer a:hover { color: var(--violet-light); }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.1); padding-top: 1rem; margin-top: 1.5rem; font-size: .8rem; color: rgba(255,255,255,.4); }

/* ── ALERTS Y FLASH ── */
.alert { border-radius: 10px; border: none; }
.alert-success { background: #ecfdf5; color: #065f46; }
.alert-danger  { background: #fef2f2; color: #991b1b; }
.alert-warning { background: #fffbeb; color: #92400e; }
.alert-info    { background: var(--violet-pale); color: var(--violet-dark); }

/* ── BADGES ── */
.badge-violet { background: var(--violet); color: #fff; }

/* ── LOGIN / REGISTER CARD ── */
.auth-card {
  max-width: 440px;
  margin: 4rem auto;
  background: var(--white);
  border: 1px solid var(--gray-300);
  border-radius: 16px;
  padding: 2.5rem;
  box-shadow: 0 8px 30px rgba(109,40,217,.08);
}
.auth-card h2 { font-weight: 800; margin-bottom: 1.5rem; text-align: center; }
.auth-divider {
  display: flex; align-items: center; gap: 12px;
  color: var(--gray-600); font-size: .85rem;
  margin: 1.2rem 0;
}
.auth-divider::before, .auth-divider::after {
  content: ''; flex: 1; height: 1px; background: var(--gray-300);
}

/* ── LOGO PLACEHOLDER ── */
.logo-placeholder {
  width: 44px; height: 44px;
  background: var(--violet);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
}
.logo-placeholder svg { width: 28px; height: 28px; fill: none; stroke: #fff; stroke-width: 2; }

/* ── RESPONSIVE ── */
@media (max-width: 768px) {
  .carousel-item img { height: 300px; }
  .hero-slider { max-height: 300px; }
  .product-title { font-size: 1.4rem; }
  .product-price { font-size: 1.6rem; }
  .cart-item { flex-wrap: wrap; }
  .auth-card { margin: 1.5rem; padding: 1.8rem; }
  .whatsapp-float { bottom: 16px; right: 16px; width: 50px; height: 50px; }
}

@media (max-width: 576px) {
  .product-thumbs { gap: 5px; }
  .product-thumb { width: 56px; height: 56px; }
}
