/*--------------------------------------------------------------------- LaVitrina64 Navbar & Footer Professional Design ---------------------------------------------------------------------*/
/* REFACTORIZADO - Versión 5.3.0 - Sin hacks, código limpio y mantenible */
/* Sidebar basado en transform + clases, sin manipulación de width/style */
/* Icono de búsqueda eliminado */

/* ============================================================================
   VARIABLES CSS
   ============================================================================ */

:root {
    --logo-h: 70px;
    --nav-pad-top: 6px;
    --nav-pad-bottom: 20px;
    --nav-h: calc(var(--logo-h) + var(--nav-pad-top) + var(--nav-pad-bottom));
    --btn-size: 40px;
    --icon-size: 24px;
    --gap: 12px;
    --sidebar-width: 300px;
    --sidebar-z-index: 2100;
    --overlay-z-index: 2000;
    
    /* anchos reservados para columnas del navbar */
    --buttons-w: 140px;  /* desktop */
    --search-w: 0px;    /* desktop - eliminado */
}

/* ============================================================================
   NAVBAR - ESTRUCTURA LIMPIA
   ============================================================================ */

.header_section {
    background: linear-gradient(135deg, #1a1a1a 0%, #2a2a2a 100%);
    padding: var(--nav-pad-top) 0 var(--nav-pad-bottom) !important;
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 2px solid rgba(196, 30, 58, 0.3);
    min-height: var(--nav-h);
    width: 100%;
    box-sizing: border-box;
    overflow: visible;
}

.header_container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 15px;
    width: 100%;
    box-sizing: border-box;
}

.header_row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    min-height: var(--logo-h);
    gap: var(--gap);
    flex-wrap: nowrap;
    margin: 0;
    padding: 0;
}

/* ============================================================================
   COLUMNAS DEL NAVBAR
   ============================================================================ */

.header_col {
    display: flex;
    align-items: center;
    box-sizing: border-box;
}

/* Búsqueda (izquierda) */
.header_col_search {
    flex: 0 0 var(--search-w);
    min-width: var(--search-w);
}

/* Logo (centro) */
.header_col_logo {
    flex: 1 1 auto;
    min-width: 0;
    justify-content: center;
    overflow: visible;
    /* CRÍTICO: el logo NO puede invadir el ancho de botones */
    max-width: calc(100% - var(--buttons-w) - (var(--gap) * 2));
}

/* Botones (derecha) - Ancho fijo */
.header_col_buttons {
    flex: 0 0 var(--buttons-w);
    width: var(--buttons-w);
    min-width: var(--buttons-w);
    max-width: var(--buttons-w);
    flex-shrink: 0;
    flex-grow: 0;
    justify-content: flex-end;
    display: flex;
    box-sizing: border-box;
}

/* ============================================================================
   ELEMENTOS DEL NAVBAR
   ============================================================================ */

.search_icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: var(--btn-size);
    height: var(--btn-size);
    cursor: pointer;
}

.search_icon img {
    width: var(--icon-size);
    height: var(--icon-size);
    filter: brightness(0) invert(1);
}

.logo {
    text-align: center;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-width: 0;
    overflow: visible;
    background: transparent;
}

.logo a {
    text-decoration: none;
    color: inherit;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border-radius: 4px;
    transition: opacity 0.3s ease;
}

.logo a:hover {
    opacity: 0.9;
}

.logo-image {
    max-height: var(--logo-h);
    width: auto;
    height: auto;
    object-fit: contain;
    display: block;
    background: transparent;
    padding: 0;
    margin: 0;
    border-radius: 4px;
    transition: transform 0.3s ease;
}

.logo-image:hover {
    transform: scale(1.05);
}

.header_col_logo {
    background: transparent;
}

.logo-container-dark {
    background: linear-gradient(135deg, #1a1a1a 0%, #2a2a2a 100%);
    padding: 15px 20px;
    border-radius: 8px;
    display: inline-block;
}

/* Contenedor de botones */
.header_buttons_wrapper {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: var(--gap);
    width: 100%;
    flex-shrink: 0;
}

.shoping_bag {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.cart-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: var(--btn-size);
    height: var(--btn-size);
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
    text-decoration: none;
    position: relative;
    transition: background 0.3s ease;
    flex-shrink: 0;
}

.cart-link:hover {
    background: rgba(255, 255, 255, 0.2);
}

.cart-link svg {
    width: var(--icon-size);
    height: var(--icon-size);
    fill: currentColor;
}

#cart-count {
    position: absolute;
    top: -3px;
    right: -3px;
    background: #c41e3a;
    color: #ffffff;
    font-size: 10px;
    font-weight: bold;
    min-width: 18px;
    height: 18px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1px 5px;
    border: 2px solid #1a1a1a;
}

.togle_main {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    pointer-events: auto;
    position: relative;
}

.openbtn {
    appearance: none;
    -webkit-appearance: none;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    width: var(--btn-size);
    height: var(--btn-size);
    min-width: var(--btn-size);
    min-height: var(--btn-size);
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    cursor: pointer;
    padding: 8px;
    transition: background 0.3s ease;
    flex-shrink: 0;
    position: relative;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.openbtn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.openbtn img {
    width: var(--icon-size);
    height: var(--icon-size);
    min-width: var(--icon-size);
    min-height: var(--icon-size);
    max-width: var(--icon-size);
    max-height: var(--icon-size);
    filter: brightness(0) invert(1);
    display: block;
    object-fit: contain;
    margin: 0;
    padding: 0;
    pointer-events: none;
}

/* ============================================================================
   SIDEBAR - BASADO EN TRANSFORM (SIN HACKS)
   ============================================================================ */

.sidebar,
#mySidebar {
    position: fixed;
    top: 0;
    right: 0;
    left: auto;
    width: var(--sidebar-width);
    height: 100vh;
    background-color: #1a1a1a;
    padding-top: 80px;
    box-shadow: -2px 0 12px rgba(0,0,0,0.35);
    transform: translateX(100%);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: transform 0.35s ease, opacity 0.25s ease, visibility 0.25s ease;
    z-index: var(--sidebar-z-index);
    overflow-y: auto;
    overflow-x: hidden;
}

.sidebar.open,
#mySidebar.open {
    transform: translateX(0);
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

/* Overlay del sidebar */
.sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0.25s ease;
    z-index: var(--overlay-z-index);
    cursor: pointer;
}

.sidebar-overlay.active {
    opacity: 1;
    visibility: visible;
}

body.sidebar-open {
    overflow: hidden;
}

.sidebar a {
    padding: 15px 20px;
    text-decoration: none;
    font-size: 18px;
    color: #ffffff;
    display: block;
    transition: 0.3s;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.sidebar a:not(.closebtn):first-of-type {
    margin-top: 30px;
    padding-top: 20px;
}

.sidebar .closebtn + a {
    margin-top: 50px;
    padding-top: 20px;
}

.sidebar a:hover {
    background-color: rgba(196, 30, 58, 0.3);
    color: #ffffff;
}

.closebtn {
    position: absolute;
    top: 15px;
    left: 25px;
    right: auto;
    font-size: 36px;
    border: none;
    padding: 10px 15px;
    z-index: 2001;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
    min-width: 50px;
    min-height: 50px;
    background: transparent;
    color: #ffffff;
    cursor: pointer;
    transition: color 0.3s ease;
}

.closebtn:hover {
    color: #c41e3a;
}

/* ============================================================================
   FOOTER - DISEÑO MEJORADO
   ============================================================================ */

.footer_section {
    background-color: #2a2a2a;
    padding: 60px 0 30px;
    color: #ffffff;
    margin-top: 60px;
    border-top: 3px solid #c41e3a;
    position: relative;
    width: 100%;
    float: none;
    height: auto;
}

.footer_section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, transparent 0%, #c41e3a 20%, #c41e3a 80%, transparent 100%);
}

.footer_section .container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

.footer_section .row {
    display: flex;
    flex-wrap: wrap;
    margin: 0 -15px;
}

.footer_section .col-sm-4 {
    flex: 0 0 33.333333%;
    max-width: 33.333333%;
    padding: 0 15px;
    margin-bottom: 30px;
    box-sizing: border-box;
}

.footer_section .col-sm-4:first-child {
    text-align: left;
}

.footer_section .col-sm-4:first-child > div {
    text-align: left;
}

.important_text {
    font-size: clamp(18px, 2.5vw, 22px);
    color: #ffffff;
    font-weight: 600;
    margin-bottom: 20px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    position: relative;
    padding-bottom: 10px;
}

.important_text::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 50px;
    height: 2px;
    background: linear-gradient(90deg, #c41e3a 0%, transparent 100%);
}

.footer_menu {
    margin-bottom: 20px;
}

.footer_menu ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer_menu li {
    margin-bottom: 12px;
    font-size: 14px;
}

.footer_menu li a {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: all 0.3s ease;
    display: inline-block;
    position: relative;
    padding-left: 0;
}

.footer_menu li a::before {
    content: '→';
    margin-right: 8px;
    opacity: 0;
    transition: all 0.3s ease;
    color: #c41e3a;
}

.footer_menu li a:hover {
    color: #c41e3a;
    padding-left: 12px;
}

.footer_menu li a:hover::before {
    opacity: 1;
}

.footer_lorem_text {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.8);
    line-height: 1.7;
    margin-bottom: 20px;
}

.footer_section .input-group {
    margin-bottom: 15px;
}

.footer_section .form-control {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #ffffff;
    font-size: 14px;
    padding: 12px 16px;
    border-radius: 4px 0 0 4px;
}

.footer_section .form-control::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.footer_section .form-control:focus {
    background: rgba(255, 255, 255, 0.15);
    border-color: #c41e3a;
    outline: none;
    box-shadow: 0 0 0 3px rgba(196, 30, 58, 0.2);
}

.footer_section .input-group-text {
    background: #c41e3a;
    border: 1px solid #c41e3a;
    color: #ffffff;
    font-weight: 600;
    padding: 12px 20px;
    border-radius: 0 4px 4px 0;
    cursor: pointer;
    transition: all 0.3s ease;
}

.footer_section .input-group-text:hover {
    background: #a01a2e;
    border-color: #a01a2e;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(196, 30, 58, 0.3);
}

.copyright_text {
    background-color: #1a1a1a;
    color: rgba(255, 255, 255, 0.7);
    text-align: center;
    padding: 20px 0;
    font-size: 13px;
    margin-top: 0;
    border-top: 2px solid #c41e3a;
    position: relative;
    width: 100%;
    float: none;
}

.copyright_text::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent 0%, #c41e3a 20%, #c41e3a 80%, transparent 100%);
}

.copyright_text a {
    color: #c41e3a;
    text-decoration: none;
    transition: color 0.3s ease;
}

.copyright_text a:hover {
    color: #a01a2e;
    text-decoration: underline;
}

.powered-by {
    background-color: #1a1a1a;
    color: rgba(255, 255, 255, 0.5);
    text-align: center;
    padding: 15px 0;
    font-size: 12px;
    margin-top: 0;
    border-top: none;
    border: none;
    width: 100%;
    float: none;
    position: relative;
}

.powered-by::before,
.powered-by::after {
    display: none;
    content: none;
}

.powered-by a {
    color: #c41e3a;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s ease;
}

.powered-by a:hover {
    color: #a01a2e;
    text-decoration: underline;
}

.footer-logo {
    max-height: 60px;
    width: auto;
    height: auto;
    object-fit: contain;
    display: block;
    margin: 0;
    text-align: left;
    transition: opacity 0.3s ease;
}

.footer-logo:hover {
    opacity: 0.9;
}

/* ============================================================================
   RESPONSIVE - FOOTER (mantener estilos del footer en móvil)
   ============================================================================ */

@media (max-width: 767px) {
    .footer-logo {
        max-height: 50px;
    }
}

@media (max-width: 575px) {
    .footer-logo {
        max-height: 45px;
    }
}

/* ============================================================================
   PREVENIR SCROLLBAR HORIZONTAL
   ============================================================================ */

body {
    overflow-x: hidden;
    max-width: 100vw;
}

html {
    overflow-x: hidden;
    max-width: 100vw;
}

/* ============================================================================
   FOOTER - FONDO GRIS OSCURO UNIFORME (Reglas finales para sobrescribir)
   ============================================================================ */

.footer_section {
    background: #2a2a2a !important;
    color: #ffffff;
}

.copyright_text,
.powered-by {
    background: #1f1f1f !important;
    color: rgba(255, 255, 255, 0.75);
}

.footer_section a {
    color: rgba(255, 255, 255, 0.85);
    text-decoration: none;
}

.footer_section a:hover {
    color: #c41e3a;
}

/* Asegurar que los links dentro de copyright y powered-by también tengan buen contraste */
.copyright_text a,
.powered-by a {
    color: rgba(255, 255, 255, 0.85);
    text-decoration: none;
    transition: color 0.3s ease;
}

.copyright_text a:hover,
.powered-by a:hover {
    color: #c41e3a;
}

/* Asegurar que los elementos del footer mantengan buen contraste */
.footer_section .important_text {
    color: #ffffff;
}

.footer_section .footer_lorem_text {
    color: rgba(255, 255, 255, 0.85);
}

.footer_menu li a {
    color: rgba(255, 255, 255, 0.85);
}

.footer_menu li a:hover {
    color: #c41e3a;
}

/* ============================================================================
   FOOTER - OVERRIDE DEFINITIVO (Forzar gris oscuro, anular cualquier azul)
   ============================================================================ */

/* ============================================================================
   FOOTER - OVERRIDE TEMPORAL (Anular reglas azules del servidor)
   
   CAUSA RAÍZ IDENTIFICADA:
   El archivo lavitrina-main.css en el servidor tiene reglas antiguas con colores azules:
   - REGLA 1: .footer_section { background: rgb(5, 17, 72); }  (#051148)
   - REGLA 3: .footer_section { background: linear-gradient(135deg, rgb(5, 17, 72) 0%, rgb(10, 26, 58) 100%); }
   - REGLA 2 y 5: .copyright_text { background: rgb(4, 6, 20); }  (#040614)
   
   El archivo local (public_html/lavitrina/css/lavitrina-main.css) ya está corregido
   con colores grises (#2a2a2a y #1f1f1f).
   
   SOLUCIÓN DEFINITIVA: Subir el archivo lavitrina-main.css actualizado al servidor.
   Este override es temporal hasta que se actualice el archivo en el servidor.
   ============================================================================ */

/* ============================
   NAVBAR RESPONSIVE FIX (v6)
   - Sin recortes
   - Botones siempre visibles
   - Logo se ajusta sin empujar
   ============================ */

.logo, .logo a{
  width: 100%;
  min-width: 0;
  display: flex;
  justify-content: center;
  align-items: center;
}

.logo-image{
  max-height: var(--logo-h);
  width: auto;
  height: auto;
  max-width: 100%;
  object-fit: contain;
  display: block;
}

.header_buttons_wrapper{
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--gap);
  width: 100%;
}

.cart-link,
.openbtn{
  width: var(--btn-size);
  height: var(--btn-size);
}

.cart-link svg,
.openbtn img{
  width: var(--icon-size);
  height: var(--icon-size);
}

/* ============ BREAKPOINTS ============ */

/* Tablet / móvil */
@media (max-width: 767px){
  :root{
    --nav-pad-top: 10px;
    --nav-pad-bottom: 18px;
    --logo-h: 60px;
    --btn-size: 38px;
    --icon-size: 20px;
    --gap: 8px;

    --buttons-w: 120px; /* más compacto */
    --search-w: 0px;    /* eliminado */
  }

  .header_col_search{
    display: none !important;
  }

  .header_col_logo{
    max-width: calc(100% - var(--buttons-w) - (var(--gap) * 2));
  }
}

/* móviles pequeños */
@media (max-width: 575px){
  :root{
    --buttons-w: 100px;
    --logo-h: 54px;
    --btn-size: 36px;
    --icon-size: 18px;
    --gap: 6px;
  }

  .header_col_logo{
    max-width: calc(100% - var(--buttons-w) - (var(--gap) * 1));
  }
}

/* móviles muy pequeños */
@media (max-width: 400px){
  :root{
    --buttons-w: 90px;
    --logo-h: 48px;
    --btn-size: 32px;
    --icon-size: 16px;
    --gap: 4px;
  }

  .header_col_logo{
    max-width: calc(100% - var(--buttons-w) - (var(--gap) * 1));
  }

  /* opcional: reduce badge para que no choque */
  #cart-count{
    font-size: 8px;
    min-width: 14px;
    height: 14px;
  }
}

/* ============================================================================
   FOOTER - OVERRIDE FINAL (AL FINAL DEL ARCHIVO)
   Se carga después de lavitrina-responsive.css para garantizar máxima prioridad
   ============================================================================ */

html body div.footer_section.layout_padding,
html body .footer_section.layout_padding,
body div.footer_section.layout_padding,
body .footer_section.layout_padding,
div.footer_section.layout_padding,
.footer_section.layout_padding,
html body div.footer_section,
html body .footer_section,
body div.footer_section,
body .footer_section,
div.footer_section,
.footer_section {
    background: #2a2a2a !important;
    background-color: #2a2a2a !important;
    background-image: none !important;
}

html body div.copyright_text,
html body .copyright_text,
body div.copyright_text,
body .copyright_text,
div.copyright_text,
.copyright_text,
html body div.powered-by,
html body .powered-by,
body div.powered-by,
body .powered-by,
div.powered-by,
.powered-by {
    background: #1f1f1f !important;
    background-color: #1f1f1f !important;
    background-image: none !important;
    color: rgba(255, 255, 255, 0.75) !important;
}
