/* ═══════════════════════════════════════════════
   TiendaOnline – Estilos principales
   FastAPI + MySQL + Mercado Pago
═══════════════════════════════════════════════ */

:root {
  --brand:       #f5a623;
  --brand-dark:  #d48c0e;
  --dark:        #1a1a2e;
  --dark-mid:    #16213e;
  --dark-blue:   #0f3460;
  --radius-card: 12px;
  --shadow-card: 0 4px 20px rgba(0,0,0,.08);
}

/* ─── TIPOGRAFÍA ─── */
body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  color: #222;
  background: #f8f9fa;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

main {
  flex: 1;
}

/* ─── NAVBAR ─── */
.navbar {
  box-shadow: 0 2px 12px rgba(0,0,0,.35);
}
.navbar-brand {
  letter-spacing: -.5px;
}

/* ─── HERO ─── */
.hero-section {
  background: linear-gradient(135deg, var(--dark) 0%, var(--dark-mid) 50%, var(--dark-blue) 100%);
  min-height: 360px;
  display: flex;
  align-items: center;
}
.hero-icon {
  font-size: 10rem;
  opacity: .12;
  color: var(--brand);
}

/* ─── PRODUCT CARDS ─── */
.product-card {
  border-radius: var(--radius-card);
  overflow: hidden;
  transition: transform .2s ease, box-shadow .2s ease;
  background: #fff;
}
.product-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 12px 32px rgba(0,0,0,.14) !important;
}
.product-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .3s ease;
}
.product-card:hover .product-img {
  transform: scale(1.04);
}

/* ─── BOTONES ─── */
.btn-warning {
  background-color: var(--brand);
  border-color: var(--brand);
  color: #000;
}
.btn-warning:hover,
.btn-warning:focus {
  background-color: var(--brand-dark);
  border-color: var(--brand-dark);
  color: #000;
}
.btn-warning:focus {
  box-shadow: 0 0 0 .25rem rgba(245,166,35,.4);
}

/* ─── FORMULARIOS ─── */
.form-control:focus,
.form-select:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 .2rem rgba(245,166,35,.25);
}

/* ─── AUTH PAGES ─── */
.auth-wrapper {
  display: flex;
  justify-content: center;
  padding: 60px 16px;
}
.auth-card {
  width: 100%;
  max-width: 440px;
  border-radius: 18px !important;
}

/* ─── CART BADGE ANIMATION ─── */
@keyframes badge-pop {
  0%   { transform: translate(-50%, -50%) scale(1); }
  40%  { transform: translate(-50%, -50%) scale(1.6); }
  100% { transform: translate(-50%, -50%) scale(1); }
}
.badge-pop {
  animation: badge-pop .28s ease;
}

/* ─── CARD HEADERS ─── */
.card-header {
  background: #fff;
  font-weight: 600;
  border-bottom: 2px solid #f0f0f0;
}

/* ─── TABLAS ─── */
.table th {
  font-size: .78rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  font-weight: 700;
}

/* ─── SIDEBAR CATEGORÍAS ─── */
.list-group-item.active {
  background-color: var(--brand);
  border-color: var(--brand);
  color: #000;
  font-weight: 600;
}

/* ─── QTY GROUP ─── */
.qty-group .btn {
  padding: .35rem .65rem;
}

/* ─── BREADCRUMB ─── */
.breadcrumb {
  font-size: .85rem;
}

/* ─── FOOTER ─── */
footer a:hover {
  color: var(--brand) !important;
  text-decoration: underline !important;
}

/* ─── BLOG ─── */
.blog-card {
  border-radius: var(--radius-card);
  overflow: hidden;
  transition: transform .2s, box-shadow .2s;
}
.blog-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 28px rgba(0,0,0,.12) !important;
}
.blog-img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  transition: transform .3s;
}
.blog-card:hover .blog-img { transform: scale(1.04); }

.blog-card-sm {
  border-radius: 8px;
  overflow: hidden;
  transition: opacity .2s;
}
.blog-card-sm:hover { opacity: .85; }

.blog-content { font-size: 1.05rem; line-height: 1.85; }
.blog-content h2, .blog-content h3 { margin-top: 2rem; font-weight: 700; }
.blog-content img { max-width: 100%; border-radius: 8px; margin: 1rem 0; }
.blog-content blockquote {
  border-left: 4px solid var(--brand);
  padding: .5rem 1rem;
  color: #555;
  font-style: italic;
  background: #fffbf0;
  border-radius: 0 6px 6px 0;
}

/* ─── CHECKOUT: selector Boleta / Factura ─── */
.doc-type-label {
  cursor: pointer;
}
.doc-card {
  border: 2px solid #dee2e6 !important;
  transition: border-color .2s, background .2s;
  border-radius: 10px !important;
}
.doc-type-label.active .doc-card,
.doc-type-label:hover .doc-card {
  border-color: var(--brand) !important;
  background: rgba(245,166,35,.06);
}

/* ─── IZIPAY ─── */
.btn-izipay {
  background-color: #003087;
  border-color: #003087;
  color: #fff;
  font-weight: 700;
}
.btn-izipay:hover,
.btn-izipay:focus {
  background-color: #002066;
  border-color: #002066;
  color: #fff;
}
.btn-izipay:focus {
  box-shadow: 0 0 0 .25rem rgba(0,48,135,.4);
}

/* ─── ADMIN ─── */
.admin-stat-card {
  border-radius: var(--radius-card);
}

/* ─── CONTENIDO RICO DEL PRODUCTO ─── */
.product-content h2, .product-content h3 {
  margin-top: 1.5rem;
  font-weight: 700;
}
.product-content p  { line-height: 1.8; }
.product-content ul, .product-content ol {
  padding-left: 1.5rem;
  line-height: 1.9;
}
.product-content img {
  max-width: 100%;
  border-radius: 8px;
  margin: 1rem 0;
}
.product-content blockquote {
  border-left: 4px solid var(--brand);
  padding-left: 1rem;
  color: #555;
  font-style: italic;
}
.product-content pre {
  background: #f4f4f4;
  border-radius: 6px;
  padding: 1rem;
  overflow-x: auto;
}
/* Editor Quill en admin */
#quill-editor .ql-editor { min-height: 260px; font-size: 1rem; }

/* ─── RESPONSIVE ─── */
@media (max-width: 576px) {
  .hero-section {
    min-height: 220px;
    text-align: center;
  }
  .hero-section .display-4 {
    font-size: 1.8rem;
  }
  .auth-wrapper {
    padding: 30px 12px;
  }
}

@media (max-width: 768px) {
  .product-img {
    height: 160px !important;
  }
}
