:root {
    --bs-primary: #702D3C;
    --bs-primary-rgb: 112, 45, 60;
    --bs-link-color: #702D3C;
    --bs-link-hover-color: #55202c;
}

/* FONDO GLOBAL Y TIPOGRAFÍA DE ALTO CONTRASTE */
body, 
body.bg-light {
    background-color: #F7F0E5 !important;
    color: #292725 !important;
}

/* TÍTULOS Y ENCABEZADOS (#702D3C) */
h1, h2, h3, h4, h5, h6,
.h1, .h2, .h3, .h4, .h5, .h6,
h1.text-dark, h2.text-dark, h3.text-dark, h4.text-dark, h5.text-dark, h6.text-dark,
.card-title,
.section-title {
    color: #702D3C !important;
}

/* Excepciones de títulos sobre fondos oscuros o de cabecera */
.bg-dark h1, .bg-dark h2, .bg-dark h3, .bg-dark h4, .bg-dark h5, .bg-dark h6,
.bg-primary h1, .bg-primary h2, .bg-primary h3, .bg-primary h4, .bg-primary h5, .bg-primary h6,
.card-header.bg-dark h1, .card-header.bg-dark h2, .card-header.bg-dark h3, .card-header.bg-dark h4, .card-header.bg-dark h5, .card-header.bg-dark h6,
.modal-header.bg-dark h5, .modal-header.bg-dark .modal-title,
.footer h1, .footer h2, .footer h3, .footer h4, .footer h5, .footer h6,
.card.text-white h3, .text-white h3,
.stat-total-vinos h3, .stat-bodegas h3, .stat-cepas h3, .stat-usuario h3 {
    color: #ffffff !important;
}

/* ESTADÍSTICAS (vinosuser.php) */
.stat-total-vinos {
    background-color: #702D3C !important;
}
.stat-bodegas {
    background-color: #3E5336 !important;
}
.stat-cepas {
    background-color: #5C4033 !important;
}
.stat-usuario {
    background-color: #997D3D !important;
}

/* HEADER Y NAVBAR */
.header-main {
    height: auto !important;
    min-height: auto !important;
    padding: 0 !important;
}

.header-banner-container {
    width: 100%;
    background-color: transparent;
    text-align: center;
    overflow: hidden;
    line-height: 0;
}

.header-banner {
    width: 100% !important;
    max-width: 100% !important;
    height: auto;
    display: block;
    margin: 0 auto;
}

.aviso {
    font-size: 0.9rem !important;
    padding-top: 5px !important;
    padding-bottom: 5px !important;
    margin-bottom: 5px !important;
}

.header-img-left,
.header-img-right,
.header-logo {
    height: 146px !important; /* 122px * 1.20 */
    width: auto !important;
    max-width: 241px !important; /* 201px * 1.20 */
}

/* NAVBAR COMPACTA */
.navbar {
    min-height: 42px !important;
    padding-top: .55rem !important;
    padding-bottom: 0.25rem !important;
}

.navbar-brand,
.navbar .navbar-brand {
    font-size: 1.25rem !important;
    padding-top: .5rem !important;
    padding-bottom: 0.5rem !important;
    color: #ffffff !important;
    text-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

.nav-link,
.navbar .nav-link {
    padding-top: 0.5rem !important;
    padding-bottom: 0.5rem !important;
    color: #ffffff !important;
    font-weight: 700 !important; /* Texto más grueso para resaltar */
    opacity: 1 !important; /* Quitamos la transparencia de Bootstrap */
    transition: all 0.3s ease;
    text-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

.navbar .nav-link:hover,
.navbar .nav-link.active {
    color: #ffffff !important;
    text-decoration: underline; /* Opcional: una línea abajo al pasar el mouse */
    transform: scale(1.05); /* Ligero aumento de tamaño */
}

.navbar .dropdown-item {
    color: #292725 !important;
}

.navbar .dropdown-item:hover {
    background-color: #F7F0E5;
    color: #292725 !important;
}

/* PAGINACIÓN */
.pagination .page-link {
    color: #292725 !important;
}

.pagination .page-item.active .page-link {
    background-color: #702D3C !important;
    border-color: #702D3C !important;
    color: #ffffff !important;
}

/* BOTONES DE COMPRA (#702D3C) */
.btn-primary,
.card-vino .btn-primary,
.card-vino-mini .btn-primary,
a.btn-primary,
a[href*="agregar_carrito"],
#formFinalizar button[type="submit"],
.btn-compra,
.btn-comprar {
    --bs-btn-bg: #702D3C !important;
    --bs-btn-border-color: #702D3C !important;
    --bs-btn-hover-bg: #55202c !important;
    --bs-btn-hover-border-color: #55202c !important;
    --bs-btn-active-bg: #55202c !important;
    --bs-btn-active-border-color: #55202c !important;
    --bs-btn-color: #ffffff !important;
    background-color: #702D3C !important;
    border-color: #702D3C !important;
    color: #ffffff !important;
    font-weight: 700 !important;
    transition: all 0.2s ease-in-out;
}

.btn-primary:hover,
.btn-primary:focus,
.btn-primary:active,
.card-vino .btn-primary:hover,
.card-vino-mini .btn-primary:hover,
a.btn-primary:hover,
a[href*="agregar_carrito"]:hover,
#formFinalizar button[type="submit"]:hover,
.btn-compra:hover,
.btn-comprar:hover {
    background-color: #55202c !important;
    border-color: #55202c !important;
    color: #ffffff !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(112, 45, 60, 0.35) !important;
}

.btn-outline-primary {
    color: #702D3C !important;
    border-color: #702D3C !important;
    font-weight: 600;
}

.btn-outline-primary:hover,
.btn-outline-primary:focus,
.btn-outline-primary:active {
    background-color: #702D3C !important;
    border-color: #702D3C !important;
    color: #ffffff !important;
}

/* ELEMENTOS DISTINTIVOS (#702D3C) */
.text-primary,
a.text-primary {
    color: #702D3C !important;
}

.bg-primary,
.badge.bg-primary,
.badge.bg-danger,
.badge-oferta,
.badge-distintivo {
    background-color: #702D3C !important;
    color: #ffffff !important;
}

.border-primary {
    border-color: #702D3C !important;
}

/* Z-INDEX */
.header-main { z-index: 1050 !important; }
.navbar { z-index: 1040 !important; top: 0 !important; }

/* RESPONSIVE */
@media (max-width: 992px) {
  .header-main {
    height: auto !important;
    min-height: auto !important;
  }
  .header-img-left,
  .header-img-right {
    width: 216px !important;
    height: 130px !important;
  }
  
  .header-logo {
    max-width: 220px !important;
    height: auto !important;
    max-height: 120px !important;
  }
}

@media (max-width: 768px) {
  .header-main {
    height: auto !important;
    min-height: auto !important;
    padding-bottom: 10px !important;
  }
  
  .header-main .row {
    flex-direction: column !important;
    text-align: center !important;
  }
  
  .header-main .col-auto,
  .header-main .col {
    width: 100% !important;
    max-width: 100% !important;
    padding-left: 10px !important;
    padding-right: 10px !important;
  }

  .header-img-left,
  .header-img-right {
    display: none !important;
  }
  
  .header-logo {
    max-width: 160px !important;
    max-height: 75px !important;
    width: auto !important;
    height: auto !important;
    margin: 4px auto !important;
    display: inline-block !important;
  }

  .header-main h5 {
    font-size: 0.88rem !important;
    line-height: 1.35 !important;
    margin: 4px 0 0 0 !important;
  }

  .header-main br {
    display: none !important;
  }
  
  .aviso {
    font-size: 0.72rem !important;
    padding: 0.35rem 0.5rem !important;
    line-height: 1.25 !important;
  }
}

@media (max-width: 576px) {
  .header-main {
    height: auto !important;
    min-height: auto !important;
    padding-top: 4px !important;
    padding-bottom: 8px !important;
  }

  .header-img-left,
  .header-img-right {
    display: none !important;
  }
  
  .header-logo {
    max-width: 135px !important;
    max-height: 65px !important;
    width: auto !important;
    height: auto !important;
    margin: 2px auto !important;
  }

  .header-main h5 {
    font-size: 0.78rem !important;
    line-height: 1.3 !important;
  }

  .aviso {
    font-size: 0.65rem !important;
    padding: 0.25rem 0.4rem !important;
  }
}

/* Sticky + Smooth scroll */
.header-main {
  z-index: 1030;
}

.navbar {
  z-index: 1031;
  margin-top: 0 !important;
}

/* BOTONES NAVBAR */
.navbar .btn-outline-light,
.navbar .btn-light,
.navbar .btn-success {
  background-color: #ffffff !important;
  border: 1px solid #ffffff !important;
  color: #292725 !important;
  font-weight: 600;
  transition: all 0.3s ease;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1) !important;
  opacity: 1 !important;
}

.navbar .btn-outline-light:hover,
.navbar .btn-light:hover,
.navbar .btn-success:hover {
  background-color: #f8f9fa !important;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.2) !important;
  color: #292725 !important;
}

/* Input buscador */
.navbar .form-control {
  background: rgba(255,255,255,0.9) !important;
  border: 1px solid rgba(255,255,255,0.3) !important;
  color: #333 !important;
  font-weight: 500;
}

.navbar .form-control::placeholder {
  color: #666 !important;
  opacity: 1;
}

/* FOOTER ESTILOS */
.footer {
  background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%) !important;
  border-top: 4px solid #dc3545;
}

.footer h5, .footer h6 {
  color: #dc3545;
  position: relative;
}

.footer h5::after, .footer h6::after {
  content: '';
  position: absolute;
  bottom: -8px;
  left: 0;
  width: 50px;
  height: 3px;
  background: #dc3545;
  border-radius: 2px;
}

.btn-circle {
  width: 50px !important;
  height: 50px !important;
  border-radius: 50% !important;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  transition: all 0.3s ease;
}

.btn-circle:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(0,0,0,0.3) !important;
}

.hover-text-primary:hover {
  color: #dc3545 !important;
  transition: color 0.3s ease;
}

.social-links a {
  text-decoration: none !important;
}

/* RESPONSIVE */
@media (max-width: 768px) {
  .footer {
    text-align: center;
  }
  
  .social-links {
    justify-content: center;
  }
  
  .btn-circle {
    width: 45px !important;
    height: 45px !important;
    font-size: 1rem;
  }
}

/* ANIMACIÓN SUAVE */
.footer a {
  transition: all 0.3s ease;
}

.footer a:hover {
  opacity: 0.8;
  transform: translateX(5px);
}

/* OFERTAS INDEX */
.card-vino {
    transition: transform 0.3s ease;
    font-size: 0.85rem;
}

.card-vino img {
    max-height: 140px !important;
    padding: 10px;
}

.card-vino .badge {
    font-size: 0.8rem !important;
    padding: 5px 10px !important;
    top: 10px !important;
    left: 10px !important;
}

.card-vino .card-title {
    font-size: 0.95rem;
    line-height: 1.2;
}

.card-vino .h3 {
    font-size: 1.1rem !important;
}

.card-vino:hover {
    transform: translateY(-10px);
    box-shadow: 0 1rem 3rem rgba(0,0,0,.175)!important;
}

.card-vino .btn-primary {
    padding: 5px;
    font-size: 0.8rem;
}

/* Tarjeta Miniatura */
.card-vino-mini {
    max-width: 180px;
    max-height: 320px;
    font-size: 0.75rem;
    overflow: hidden;
}

/* Reducir altura de la imagen */
.img-container-mini {
    height: 120px;         
    display: flex;
    align-items: center;
    justify-content: center;
}

.img-container-mini img {
    max-height: 110px;
    width: auto;
}

/* Badge mini */
.badge-oferta {
    top: 5px;
    left: 5px;
    font-size: 0.7rem;
    padding: 3px 7px;
    z-index: 10;
}

/* Textos compactos */
.bodega-cepa-text {
    font-size: 0.65rem;
    line-height: 1;
}

.vino-titulo {
    font-size: 0.8rem !important;
    white-space: nowrap;    /* Evita que el nombre ocupe 2 renglones */
    overflow: hidden;
    text-overflow: ellipsis; /* Si es muy largo pone ... */
}

.precio-viejo {
    font-size: 0.65rem;
}

.precio-nuevo {
    font-size: 0.95rem;
    line-height: 1.1;
}

/* Efecto hover suave */
.card-vino-mini:hover {
    transform: scale(1.03);
    z-index: 20;
}

/* Para asegurar que el espaciador sea exacto con tu header de 140px */
.header-spacer {
    height: 202px;
}

/* Limitar texto a 2 líneas */
.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* NAVBAR GESTIÓN (sgestion.php) */
.nav-gestion {
    background-color: #87CEEB !important; /* Color Celeste */
    padding: 3px 0 !important;
    width: 100% !important;
}
.nav-gestion .nav-link {
    color: white !important;
    font-weight: bold;
    font-size: 0.9rem;
    padding: 5px 12px !important;
    text-transform: uppercase;
    border-radius: 4px;
    white-space: nowrap;
}
.nav-gestion .nav-link:hover,
.nav-gestion .nav-link.active {
    background-color: rgba(255,255,255,0.25);
}

@media (max-width: 768px) {
    .nav-gestion {
        padding: 5px 2px !important;
    }
    .nav-gestion .nav-link {
        font-size: 0.75rem !important;
        padding: 4px 7px !important;
    }
}
