/* =============================================================
   HM-NET — Design System & Custom Styles
   ============================================================= */

/* -------------------------------------------------------------
   1. Design Tokens (CSS Custom Properties)
   ------------------------------------------------------------- */
:root {
  /* Primary blue — moderno, vibrante */
  --hm-primary:        #0369A1;
  --hm-primary-hover:  #0284C7;
  --hm-primary-light:  #E0F2FE;
  --hm-primary-dark:   #075985;

  /* Accent teal */
  --hm-accent:         #0891B2;
  --hm-accent-hover:   #06B6D4;
  --hm-accent-light:   #CFFAFE;

  /* Neutros */
  --hm-bg:             #F8FAFC;
  --hm-bg-card:        #FFFFFF;
  --hm-border:         #E2E8F0;
  --hm-border-strong:  #CBD5E1;

  /* Texto */
  --hm-text:           #0F172A;
  --hm-text-muted:     #64748B;
  --hm-text-light:     #94A3B8;

  /* Sombras uniformes */
  --hm-shadow-sm:      0 1px 3px rgba(15, 23, 42, 0.08);
  --hm-shadow:         0 4px 16px rgba(15, 23, 42, 0.10);
  --hm-shadow-lg:      0 8px 32px rgba(15, 23, 42, 0.14);
  --hm-shadow-hover:   0 12px 40px rgba(15, 23, 42, 0.18);

  /* Border radius */
  --hm-radius-sm:      4px;
  --hm-radius:         8px;
  --hm-radius-lg:      12px;
  --hm-radius-xl:      16px;

  /* Transición base */
  --hm-transition:     0.25s ease;

  /* Bootstrap overrides para coherencia */
  --bs-primary:        #0369A1;
  --bs-primary-rgb:    3, 105, 161;
  --bs-link-color:     #0369A1;
  --bs-link-hover-color: #0284C7;
}


/* -------------------------------------------------------------
   2. Base & Body
   ------------------------------------------------------------- */
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  color: var(--hm-text);
  background-color: var(--hm-bg);
  margin: 0;
  padding: 0;
  line-height: 1.6;
}

.container {
  max-width: 1320px;
  margin: 0 auto;
  padding: 0 15px;
}


/* -------------------------------------------------------------
   3. Navbar
   ------------------------------------------------------------- */
.navbar-hmnet {
  border-bottom: 3px solid var(--hm-primary);
}

.navbar-nav .nav-link {
  position: relative;
  transition: color var(--hm-transition);
}

.navbar-nav .nav-link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 0;
  height: 2px;
  background-color: var(--hm-primary);
  transition: width var(--hm-transition), left var(--hm-transition);
}

.navbar-nav .nav-link.active {
  color: var(--hm-primary) !important;
  font-weight: 500;
}

@media (min-width: 992px) {
  .navbar-nav .nav-link.active::after {
    width: 80%;
    left: 10%;
  }
}

/* Hover solo en dispositivos con mouse */
@media (hover: hover) and (pointer: fine) {
  .navbar-nav .nav-link:hover::after {
    width: 80%;
    left: 10%;
  }
  .navbar-nav .nav-link:hover,
  .navbar-nav .dropdown-toggle:hover {
    color: var(--hm-primary) !important;
  }
}


/* -------------------------------------------------------------
   4. Dropdown
   ------------------------------------------------------------- */
.dropdown-item {
  transition: background-color var(--hm-transition), padding-left var(--hm-transition), color var(--hm-transition);
  color: #212529;
  min-height: 44px;
  display: flex;
  align-items: center;
}

@media (hover: hover) and (pointer: fine) {
  .dropdown-item:hover {
    background-color: var(--hm-primary) !important;
    color: #ffffff !important;
  }
  .dropdown-item:hover i,
  .dropdown-item:hover .fa,
  .dropdown-item:hover .fa-solid,
  .dropdown-item:hover .fa-brands {
    color: #ffffff !important;
  }
}

.dropdown-item:active {
  background-color: var(--hm-primary) !important;
  color: #ffffff !important;
  transform: scale(0.98);
}

.dropdown-item:active i {
  color: #ffffff !important;
}

.dropdown-item:focus,
.dropdown-item:focus-visible {
  background-color: var(--hm-primary-light) !important;
  color: var(--hm-primary) !important;
  outline: 2px solid var(--hm-primary);
  outline-offset: -2px;
}

.dropdown-header {
  transition: none !important;
  pointer-events: none;
}

/* Mobile */
@media (max-width: 991.98px) {
  .dropdown-item {
    padding: 1rem 1.25rem;
    font-size: 1.05rem;
  }
  .dropdown-item i {
    margin-right: 0.75rem;
    width: 1.25rem;
    text-align: center;
  }
  .dropdown-divider {
    margin: 0.75rem 0;
    border-top-width: 2px;
  }
  .dropdown-header {
    padding: 0.75rem 1.25rem;
    font-size: 0.9rem;
    font-weight: 600;
    background-color: #f8f9fa;
  }
  .navbar-nav .dropdown-menu {
    width: 100%;
    border: none;
    box-shadow: none;
  }
  .navbar-nav .nav-link {
    padding: 0.75rem 1rem;
    font-size: 1.05rem;
  }
  .navbar-nav .nav-link::after {
    display: none;
  }
  .navbar-collapse {
    max-height: 80vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
}

/* Desktop */
@media (min-width: 992px) {
  .dropdown-item {
    padding: 0.5rem 1rem;
    font-size: 1rem;
  }
  .navbar-nav .dropdown-menu {
    box-shadow: var(--hm-shadow);
    border: 1px solid var(--hm-border);
  }
}

/* Fix z-index */
.navbar .dropdown-menu {
  z-index: 1030 !important;
}


/* -------------------------------------------------------------
   5. Cards
   ------------------------------------------------------------- */
.card {
  border: 1px solid var(--hm-border);
  border-radius: var(--hm-radius-lg) !important;
  box-shadow: var(--hm-shadow-sm);
  transition: transform var(--hm-transition), box-shadow var(--hm-transition);
  background-color: var(--hm-bg-card);
}

@media (hover: hover) and (pointer: fine) {
  .card:hover {
    transform: translateY(-4px);
    box-shadow: var(--hm-shadow-hover) !important;
  }
}

.card-img-top {
  width: 100%;
  height: auto;
  aspect-ratio: 3 / 2;
  object-fit: cover;
  border-radius: var(--hm-radius-lg) var(--hm-radius-lg) 0 0 !important;
}


/* -------------------------------------------------------------
   6. Product cards (store)
   ------------------------------------------------------------- */
.product-img {
  aspect-ratio: 1 / 1;
  object-fit: cover;
  width: 100%;
  height: auto;
}

.product-price {
  color: var(--hm-primary);
  font-size: 1.25rem;
  font-weight: 700;
}

.product-badge {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 0.3em 0.7em;
  border-radius: var(--hm-radius-sm);
}


/* -------------------------------------------------------------
   7. Botones personalizados
   ------------------------------------------------------------- */
.btn {
  border-radius: var(--hm-radius);
  font-weight: 500;
  transition: all var(--hm-transition);
}

.btn-primary {
  background-color: var(--hm-primary);
  border-color: var(--hm-primary);
}

.btn-primary:hover,
.btn-primary:focus {
  background-color: var(--hm-primary-hover);
  border-color: var(--hm-primary-hover);
}

.btn-outline-primary {
  color: var(--hm-primary);
  border-color: var(--hm-primary);
}

.btn-outline-primary:hover {
  background-color: var(--hm-primary);
  border-color: var(--hm-primary);
}

.btn-success {
  transition: transform var(--hm-transition), box-shadow var(--hm-transition);
}

@media (hover: hover) and (pointer: fine) {
  .btn-success:hover {
    transform: scale(1.04);
    box-shadow: 0 4px 14px rgba(25, 135, 84, 0.4);
  }
}

.btn-success:active {
  transform: scale(0.96);
}


/* -------------------------------------------------------------
   8. Imágenes del carousel
   ------------------------------------------------------------- */
.carousel-inner {
  overflow: hidden;
}

.carousel-inner img {
  width: 100%;
  object-fit: cover;
  object-position: center;
}

@media (max-width: 575px) {
  .carousel-inner img { height: 180px; }
}
@media (min-width: 576px) and (max-width: 991px) {
  .carousel-inner img { height: 220px; }
}
@media (min-width: 992px) {
  .carousel-inner img {
    height: auto;
    max-height: 600px;
  }
}


/* -------------------------------------------------------------
   9. Secciones
   ------------------------------------------------------------- */
#ppal {
  min-height: 500px;
}

.section-light {
  background-color: var(--hm-bg);
}

.section-hero {
  background: linear-gradient(135deg, var(--hm-primary-light) 0%, #fff 60%);
}


/* -------------------------------------------------------------
   10. Carrito — tabla de productos
   ------------------------------------------------------------- */
.cart-wrapper {
  background-color: var(--hm-bg-card);
  border: 1px solid var(--hm-border);
  border-radius: var(--hm-radius-xl);
  box-shadow: var(--hm-shadow);
}

.cart-summary {
  background-color: var(--hm-bg);
  border-radius: var(--hm-radius-lg);
}

.qty-group {
  display: flex;
  align-items: center;
  width: 130px;
}

.qty-btn {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--hm-bg);
  border: 1px solid var(--hm-border);
  border-radius: var(--hm-radius-sm);
  cursor: pointer;
  transition: background var(--hm-transition), color var(--hm-transition);
  font-size: 1rem;
  font-weight: 600;
  color: var(--hm-text);
  user-select: none;
}

.qty-btn:hover {
  background: var(--hm-primary);
  color: #fff;
  border-color: var(--hm-primary);
}

.qty-input {
  width: 50px;
  text-align: center;
  border: 1px solid var(--hm-border);
  border-radius: var(--hm-radius-sm);
  padding: 0.35rem 0;
  font-weight: 600;
}

.remove-btn {
  background: none;
  border: none;
  color: var(--hm-text-light);
  cursor: pointer;
  padding: 0.25rem 0.5rem;
  border-radius: var(--hm-radius-sm);
  transition: color var(--hm-transition), background var(--hm-transition);
}

.remove-btn:hover {
  color: #DC2626;
  background: #FEF2F2;
}


/* -------------------------------------------------------------
   11. Checkout
   ------------------------------------------------------------- */
.checkout-wrapper {
  background-color: var(--hm-bg-card);
  border: 1px solid var(--hm-border);
  border-radius: var(--hm-radius-xl);
  box-shadow: var(--hm-shadow);
}

.checkout-sidebar {
  background-color: var(--hm-bg);
  border-radius: var(--hm-radius-lg);
  padding: 1.5rem;
}

.checkout-sidebar .list-group-item {
  background-color: transparent;
  border-color: var(--hm-border);
}

.payment-option {
  border: 2px solid var(--hm-border);
  border-radius: var(--hm-radius);
  padding: 1rem;
  cursor: pointer;
  transition: border-color var(--hm-transition), background var(--hm-transition);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.payment-option:has(input:checked) {
  border-color: var(--hm-primary);
  background-color: var(--hm-primary-light);
}

.form-control:focus,
.form-select:focus {
  border-color: var(--hm-primary);
  box-shadow: 0 0 0 0.2rem rgba(3, 105, 161, 0.2);
}


/* -------------------------------------------------------------
   12. Página de producto (ver-producto-ls)
   ------------------------------------------------------------- */
.product-detail-wrapper {
  background-color: var(--hm-bg-card);
  border: 1px solid var(--hm-border);
  border-radius: var(--hm-radius-xl);
  box-shadow: var(--hm-shadow);
  overflow: hidden;
}

.product-detail-img {
  width: 100%;
  height: auto;
  border-radius: var(--hm-radius-lg);
  object-fit: cover;
  aspect-ratio: 1 / 1;
}

.product-detail-price {
  font-size: 2rem;
  font-weight: 800;
  color: var(--hm-primary);
  line-height: 1;
}

.product-detail-sku {
  font-size: 0.8rem;
  color: var(--hm-text-light);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.qty-selector {
  display: flex;
  align-items: center;
  gap: 0;
  border: 1px solid var(--hm-border);
  border-radius: var(--hm-radius);
  overflow: hidden;
  width: fit-content;
}

.qty-selector button {
  width: 40px;
  height: 44px;
  background: var(--hm-bg);
  border: none;
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--hm-text);
  cursor: pointer;
  transition: background var(--hm-transition);
}

.qty-selector button:hover {
  background: var(--hm-primary-light);
  color: var(--hm-primary);
}

.qty-selector input {
  width: 56px;
  height: 44px;
  border: none;
  border-left: 1px solid var(--hm-border);
  border-right: 1px solid var(--hm-border);
  text-align: center;
  font-weight: 600;
  font-size: 1rem;
  background: #fff;
}

.qty-selector input:focus {
  outline: none;
}


/* -------------------------------------------------------------
   13. Footer
   ------------------------------------------------------------- */
.footer-copyright {
  background-color: var(--hm-bg);
  border-top: 1px solid var(--hm-border);
}


/* -------------------------------------------------------------
   14. Breadcrumb
   ------------------------------------------------------------- */
.breadcrumb-item a {
  color: var(--hm-primary);
  text-decoration: none;
}

.breadcrumb-item a:hover {
  text-decoration: underline;
}


/* -------------------------------------------------------------
   15. Alerts y mensajes
   ------------------------------------------------------------- */
.alert {
  border-radius: var(--hm-radius);
}


/* -------------------------------------------------------------
   16. Login
   ------------------------------------------------------------- */
.login-card-header {
  background: linear-gradient(135deg, var(--hm-primary) 0%, var(--hm-primary-dark) 100%);
  border: none;
}

.login-help-card {
  background: linear-gradient(135deg, var(--hm-primary) 0%, var(--hm-primary-dark) 100%);
  border-radius: var(--hm-radius-lg) !important;
}

.icon-badge {
  width: 70px;
  height: 70px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
}

.form-floating > .form-control:focus ~ label,
.form-floating > .form-control:not(:placeholder-shown) ~ label {
  color: var(--hm-primary);
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

.card-animated {
  animation: fadeInUp 0.5s ease;
}


/* -------------------------------------------------------------
   17. Banner navideño (condicional)
   ------------------------------------------------------------- */
.xmas-banner {
  background: linear-gradient(135deg, #c41e3a, #d4af37);
  color: white;
  text-align: center;
  padding: 8px 20px;
  font-size: 0.9rem;
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  position: relative;
  z-index: 1020;
}

.xmas-banner-content {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.xmas-lights {
  display: flex;
  gap: 5px;
}

.light {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  animation: xmas-pulse 1s infinite ease-in-out;
}

.light-1 { background: #ff0000; box-shadow: 0 0 6px #ff0000; animation-delay: 0s; }
.light-2 { background: #00ff00; box-shadow: 0 0 6px #00ff00; animation-delay: 0.33s; }
.light-3 { background: #ffd700; box-shadow: 0 0 6px #ffd700; animation-delay: 0.66s; }

@keyframes xmas-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

@media (max-width: 768px) {
  .xmas-banner { padding: 6px 15px; font-size: 0.8rem; }
  .xmas-banner-content { gap: 8px; }
  .light { width: 5px; height: 5px; }
}

.navbar .dropdown-menu {
  z-index: 1030 !important;
}


/* -------------------------------------------------------------
   18. Contacto
   ------------------------------------------------------------- */
.contact-card {
  border-color: var(--hm-primary) !important;
}

.contact-cta-card {
  background: linear-gradient(135deg, var(--hm-primary) 0%, var(--hm-primary-dark) 100%) !important;
  border: none !important;
}

.contact-hero-img {
  max-width: 200px;
  width: 100%;
}

.icon-badge-lg {
  width: 80px !important;
  height: 80px !important;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  border-radius: 50% !important;
}

textarea.form-control {
  resize: vertical;
}
