/* ------------------------------
   BASE GENERAL
------------------------------ */
body {
    font-family: Arial, sans-serif;
    background: #f2f2f2;
    text-align: center;
    padding-top: 40px;
    transition: background 0.3s, color 0.3s;
}

.contenedor {
    background: white;
    
    width: 90%;
    max-width: 420px;
   margin: 60px auto;
    
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 0 12px rgba(0,0,0,0.2);
}

/* ------------------------------
   ENCABEZADO CON LOGO
------------------------------ */
.header {
    width: 100%;
    background: #007bff;
    color: white;
    padding: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    position: fixed;
    top: 0;
    left: 0;
}

.logo {
    height: 40px;
}

.titulo-sitio {
    font-size: 26px;
    font-weight: bold;
}

/* ------------------------------
   CAMPOS Y BOTONES
------------------------------ */
input {
    width: 90%;
    padding: 14px;
    margin: 10px 0;
    font-size: 20px;
    border-radius: 8px;
    border: 1px solid #999;
}

button {
    width: 95%;
    padding: 16px;
    font-size: 22px;
    background: #007bff;
    color: white;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    margin-top: 15px;
}

button:hover {
    background: #0056b3;
}

/* ------------------------------
   MENSAJES GRANDES
------------------------------ */
#msg {
    font-size: 22px;
    font-weight: bold;
    margin-top: 15px;
}

/* ------------------------------
   MODO OSCURO
------------------------------ */
body.oscuro {
    background: #1a1a1a;
    color: white;
}

body.oscuro .contenedor {
    background: #2b2b2b;
    color: white;
}

body.oscuro input {
    background: #444;
    color: white;
    border: 1px solid #777;
}

body.oscuro button {
    background: #0099ff;
}

.modo-btn {
    position: relative !important;
    top: auto !important;
    right: auto !important;
    margin-top: 25px;
    padding: 10px 14px;
    font-size: 16px;
    border-radius: 8px;
}


/* ------------------------------
   MENÚ LATERAL
------------------------------ */
.menu-btn {
    font-size: 22px;
    cursor: pointer;
    margin-top: 20px;
}

.menu-lateral {
    position: fixed;
    top: 0;
    left: -260px;
    width: 260px;
    height: 100%;
    background: #007bff;
    padding-top: 80px;
    transition: left 0.3s;
    display: flex;
    flex-direction: column;
}

.menu-lateral a {
    color: white;
    padding: 18px;
    text-align: left;
    font-size: 22px;
    text-decoration: none;
    border-bottom: 1px solid rgba(255,255,255,0.3);
}

.menu-lateral a:hover {
    background: #0056b3;
}

/* ------------------------------
   RESPONSIVE
------------------------------ */
@media (max-width: 480px) {
    h1, h2 {
        font-size: 24px;
    }

    input, button {
        font-size: 18px;
    }

    .titulo-sitio {
        font-size: 22px;
    }
}


.contenedor {
    max-width: 1100px;
    margin: 20px auto;
    padding: 15px;
}
h1 {
    font-size: 28px;
}
.barra-busqueda {
    margin: 15px 0;
}
.barra-busqueda input {
    width: 100%;
    font-size: 20px;
    padding: 8px;
    box-sizing: border-box;
}
.grid-productos {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
}
.card-prod {
    border: 1px solid #ccc;
    border-radius: 8px;
    padding: 10px;
    width: calc(33.333% - 10px);
    box-sizing: border-box;
    background: #fff;
}
.card-prod img {
    max-width: 100%;
    max-height: 150px;
    object-fit: contain;
    display: block;
    margin: 0 auto 8px;
    border: 1px solid #eee;
}
.card-prod h3 {
    font-size: 18px;
    margin: 5px 0;
}
.card-precios {
    margin: 8px 0;
}
.card-precios .normal {
    text-decoration: line-through;
    color: #888;
    font-size: 14px;
}
.card-precios .oferta {
    color: #c00;
    font-weight: bold;
    font-size: 18px;
}
.card-desc {
    font-size: 14px;
    height: 60px;
    overflow: hidden;
}
.card-controles {
    margin-top: 8px;
    font-size: 14px;
}
.card-controles input[type="number"] {
    width: 60px;
    font-size: 16px;
}
.card-controles button {
    margin-top: 5px;
    font-size: 14px;
}
.resumen-compra {
    margin-top: 20px;
    border-top: 2px solid #ccc;
    padding-top: 10px;
}
.resumen-compra h2 {
    font-size: 22px;
}
.resumen-compra table {
    width: 100%;
    max-width: 500px;
    font-size: 16px;
}
.resumen-compra td {
    padding: 4px 0;
}
.btn-pagar {
    margin-top: 10px;
    font-size: 18px;
    padding: 8px 16px;
}
/* *** CAMBIO 3: centrar términos y condiciones */
.terminos {
    margin-top: 10px;
    font-size: 14px;
    text-align: center;
    display:flex;
    justify-content:center;  /* centra horizontalmente */
}

.terminos label {
    text-align:center;
}


@media (max-width: 900px) {
    .card-prod {
        width: calc(50% - 10px);
    }
}
@media (max-width: 600px) {
    .card-prod {
        width: 100%;
    }
}

/* *** CAMBIO 4: barra superior con botón de cerrar sesión */
.header {
    display:flex;
    align-items:center;
    justify-content:space-between;
    padding:8px 15px;
    background:#008000 !important;          /* VERDE */
    border-bottom:1px solid #006000;
}
.logo {
    height:40px;
}
.titulo-sitio {
    font-size:20px;
    font-weight:bold;
    margin-left:10px;
    color:#fff;                  /* texto blanco sobre verde */
}
.header-left {
    display:flex;
    align-items:center;
}
.header-right a {
    padding:6px 12px;
    border:1px solid #ffffff;
    border-radius:4px;
    color:#ffffff;
    text-decoration:none;
    font-size:14px;
    margin-right:2em;            /* margen derecho pedido */
}
.header-right a:hover {
    background:#ffffff;
    color:#008000;
}

.oferta-relampago {
    color: #fff;
    background: rgb(255, 242, 0);
    padding: 3px 6px;
    border-radius: 4px;
    font-weight: bold;
    display: inline-block;
    animation: parpadeo 1s infinite;
}

@keyframes parpadeo {
    0%, 100% { opacity: 1; }
    50%      { opacity: 0.2; }
}

.contador-relampago {
    margin-top: 4px;
    font-size: 13px;
    color: #c00;
    font-weight: bold;
}

