/* =========================================================
   RENOPARTES PACHO - ESTILOS GENERALES
   Versión mejorada y responsive
   ========================================================= */

/* ===========================
   ESTILOS GENERALES
=========================== */

*{
    box-sizing:border-box;
}

html{
    scroll-behavior:smooth;
}

body{
    margin:0;
    background:#eceff1;
    font-family:Arial, Helvetica, sans-serif;
    color:#333;
}

img{
    max-width:100%;
}

a{
    color:inherit;
}

/* ===========================
   ENCABEZADO
=========================== */

header{
    background:#1f3c88;
    color:white;
    padding:35px 20px;
    text-align:center;
}

header h1{
    margin:0;
    font-size:40px;
}

header p{
    margin-top:10px;
    font-size:18px;
}

/* ===========================
   BIENVENIDA
=========================== */

.bienvenida{
    text-align:center;
    margin:40px auto 0;
    padding:0 20px;
}

.bienvenida h2{
    color:#1f3c88;
}

.bienvenida p{
    color:#555;
}

/* ===========================
   TARJETAS DE MODELOS
=========================== */

.modelos{
    display:flex;
    justify-content:center;
    flex-wrap:wrap;
    gap:25px;
    margin:40px auto;
    width:90%;
}

.modelo{
    background:white;
    width:220px;
    padding:25px;
    border-radius:15px;
    text-align:center;
    box-shadow:0 5px 15px rgba(0,0,0,.15);
    transition:.3s;
}

.modelo:hover{
    transform:translateY(-8px);
}

.modelo h3{
    color:#1f3c88;
    margin-bottom:20px;
}

.modelo button{
    background:#1f3c88;
    color:white;
    border:none;
    padding:10px 18px;
    border-radius:8px;
    cursor:pointer;
    transition:.3s;
}

.modelo button:hover{
    background:#16306d;
}

.tarjeta-link{
    text-decoration:none;
    color:inherit;
}

/* ===========================
   CONTENIDO
=========================== */

.contenido{
    width:90%;
    max-width:1400px;
    margin:30px auto 0;
}

.volver{
    text-decoration:none;
    color:#1f3c88;
    font-weight:bold;
    font-size:24px;
    display:inline-block;
    padding:12px 0;
}

input{
    width:100%;
    padding:12px;
    margin:20px 0;
    border-radius:8px;
    border:1px solid #ccc;
    font-size:16px;
}

/* =========================================================
   TARJETAS DE PRODUCTOS
   Se usa UNA sola definición para evitar conflictos.
   ========================================================= */

.productos{
    display:grid;
    grid-template-columns:repeat(auto-fit,minmax(250px,280px));
    justify-content:center;
    gap:28px;
    margin:35px auto;
    width:100%;
}

.producto{
    width:100%;
    min-width:0;
    height:430px;
    background:white;
    border-radius:16px;
    overflow:hidden;
    box-shadow:0 5px 15px rgba(0,0,0,.15);
    transition:transform .25s, box-shadow .25s;
    display:flex;
    flex-direction:column;
}

.producto:hover{
    transform:translateY(-6px);
    box-shadow:0 10px 22px rgba(0,0,0,.20);
}

/* Imagen de tarjeta */
.imagen-tarjeta,
.imagen-producto{
    width:100%;
    height:220px;
    object-fit:contain;
    object-position:center;
    background:#f8f8f8;
    padding:15px;
    display:block;
}

/* Información */
.info-producto{
    padding:18px;
    text-align:center;
    display:flex;
    flex-direction:column;
    flex:1;
    min-height:0;
}

.info-producto h3,
.producto h3{
    color:#1f3c88;
    font-size:18px;
    margin:0 0 10px;
    min-height:48px;
    display:flex;
    justify-content:center;
    align-items:center;
    text-align:center;
    line-height:1.3;
    font-weight:bold;
    overflow-wrap:anywhere;
    word-break:normal;
}

.info-producto p,
.producto p{
    margin:6px 0;
    color:#555;
    font-size:15px;
    line-height:1.4;
}

.precio{
    margin:12px 0 16px;
    font-size:24px !important;
    color:#198754 !important;
    font-weight:bold;
}

.boton{
    display:block;
    width:100%;
    margin-top:auto;
    background:#1f3c88;
    color:white;
    text-decoration:none;
    text-align:center;
    padding:12px 14px;
    border-radius:9px;
    font-weight:bold;
    font-size:16px;
    transition:.25s;
}

.boton:hover{
    background:#16306d;
}

/* ===========================
   BOTÓN CARRITO
=========================== */

.boton-carrito{
    width:100%;
    margin:12px 0 0;
    padding:13px;
    background:#1f3c88;
    color:white;
    border:none;
    border-radius:10px;
    font-size:16px;
    font-weight:bold;
    cursor:pointer;
    transition:.3s;
}

.boton-carrito:hover{
    background:#16306d;
}

/* ===========================
   LOGIN
=========================== */

.login{
    width:min(350px,90%);
    margin:60px auto;
    background:white;
    padding:30px;
    border-radius:15px;
    box-shadow:0 5px 15px rgba(0,0,0,.20);
}

.login input{
    width:100%;
    padding:12px;
    margin:15px 0;
    border-radius:8px;
    border:1px solid #ccc;
    box-sizing:border-box;
}

.boton-admin{
    width:100%;
    padding:12px;
    background:#1f3c88;
    color:white;
    border:none;
    border-radius:8px;
    cursor:pointer;
    font-size:16px;
}

.boton-admin:hover{
    background:#16306d;
}

/* ===========================
   PANEL ADMINISTRADOR
=========================== */

.panel{
    width:min(600px,92%);
    margin:60px auto;
    background:white;
    padding:40px;
    border-radius:15px;
    box-shadow:0 5px 15px rgba(0,0,0,.2);
    text-align:center;
}

.panel h2{
    color:#1f3c88;
    margin-bottom:40px;
}

.opciones{
    display:flex;
    flex-direction:column;
    gap:20px;
}

.opcion{
    background:#1f3c88;
    color:white;
    text-decoration:none;
    padding:18px;
    border-radius:10px;
    font-size:20px;
    transition:.3s;
}

.opcion:hover{
    background:#16306d;
}

.salir{
    background:#c6c6c6;
}

.salir:hover{
    background:#9d1f1f;
}

/* ===========================
   FORMULARIO
=========================== */

.formulario{
    width:min(600px,92%);
    margin:40px auto;
    background:white;
    padding:30px;
    border-radius:15px;
    box-shadow:0 5px 15px rgba(0,0,0,.2);
}

.formulario label{
    display:block;
    margin-top:20px;
    font-weight:bold;
    color:#1f3c88;
}

.formulario textarea{
    width:100%;
    padding:10px;
    border-radius:8px;
    border:1px solid #ccc;
    box-sizing:border-box;
    resize:vertical;
    min-height:120px;
}

.lista-modelos{
    display:grid;
    grid-template-columns:repeat(2,1fr);
    gap:15px;
    margin-top:15px;
    margin-bottom:25px;
}

.modelo-item{
    display:flex;
    align-items:center;
    gap:10px;
    background:#f5f5f5;
    padding:12px;
    border-radius:8px;
    cursor:pointer;
    transition:.3s;
}

.modelo-item:hover{
    background:#e8f0ff;
}

.modelo-item input{
    width:18px;
    height:18px;
    margin:0;
}

/* ===========================
   DETALLE DEL PRODUCTO
=========================== */

.detalle-producto{
    display:flex;
    gap:40px;
    margin-top:40px;
    align-items:flex-start;
    flex-wrap:wrap;
}

.galeria-producto{
    flex:1 1 500px;
    min-width:280px;
    display:grid;
    grid-template-columns:repeat(auto-fit,minmax(180px,1fr));
    gap:20px;
}

.imagen-grande{
    width:100%;
    height:260px;
    object-fit:contain;
    background:white;
    padding:15px;
    border-radius:15px;
    transition:.25s;
}

.imagen-grande:hover{
    transform:scale(1.03);
}

.info-detalle{
    flex:1 1 320px;
    min-width:280px;
    background:white;
    padding:35px;
    border-radius:15px;
    box-shadow:0 5px 15px rgba(0,0,0,.15);
}

.info-detalle h2{
    color:#1f3c88;
    margin-top:0;
    font-size:34px;
    overflow-wrap:anywhere;
}

.info-detalle p{
    font-size:18px;
    line-height:1.7;
    color:#444;
}

.info-detalle strong{
    color:#1f3c88;
}

.info-detalle h3{
    margin-top:35px;
    color:#1f3c88;
}

.precio-detalle{
    font-size:38px;
    color:#198754;
    font-weight:bold;
    margin:25px 0;
}

#buscarProducto{
    width:100%;
    padding:14px;
    border-radius:10px;
    border:1px solid #ccc;
    margin:25px 0;
    font-size:17px;
    box-sizing:border-box;
}

/* ===========================
   TABLAS ADMINISTRADOR
=========================== */

.tabla-admin{
    width:100%;
    border-collapse:collapse;
    margin-top:25px;
    background:white;
    border-radius:12px;
    box-shadow:0 5px 15px rgba(0,0,0,.15);
    display:block;
    overflow-x:auto;
}

.tabla-admin th{
    background:#1f3c88;
    color:white;
    padding:16px;
    text-align:center;
    font-size:17px;
}

.tabla-admin td{
    padding:15px;
    text-align:center;
    border-bottom:1px solid #ececec;
    vertical-align:middle;
}

.tabla-admin tr:hover{
    background:#f7f9fc;
}

/* ===========================
   BOTONES ADMIN
=========================== */

.btn-editar,
.btn-eliminar{
    display:inline-block;
    width:140px;
    margin:8px 4px;
    padding:10px 14px;
    box-sizing:border-box;
    text-align:center;
    border-radius:9px;
    text-decoration:none;
    font-weight:bold;
    transition:.3s;
}

.btn-editar{
    background:#198754;
    color:white;
}

.btn-editar:hover{
    background:#146c43;
}

.btn-eliminar{
    background:#dc3545;
    color:white;
}

.btn-eliminar:hover{
    background:#bb2d3b;
}

.busqueda-admin{
    display:flex;
    gap:15px;
    margin:30px 0;
}

.busqueda-admin input{
    flex:1;
    margin:0;
}

.busqueda-admin button{
    width:180px;
    background:#1f3c88;
    color:white;
    border:none;
    border-radius:8px;
    font-size:17px;
    cursor:pointer;
}

.busqueda-admin button:hover{
    background:#17316d;
}

/* ===========================
   CARRITO FLOTANTE
=========================== */

#carrito-flotante{
    position:fixed;
    bottom:25px;
    right:25px;
    width:70px;
    height:70px;
    background:#1f3c88;
    color:white;
    border-radius:50%;
    display:flex;
    justify-content:center;
    align-items:center;
    font-size:34px;
    cursor:pointer;
    box-shadow:0 10px 25px rgba(0,0,0,.35);
    z-index:9999;
    transition:.3s;
}

#carrito-flotante:hover{
    transform:scale(1.08);
}

/* ===========================
   PANEL DEL CARRITO
=========================== */

#panel-carrito{
    position:fixed;
    top:0;
    right:-420px;
    width:380px;
    max-width:100%;
    height:100%;
    background:white;
    box-shadow:-5px 0 20px rgba(0,0,0,.25);
    transition:.35s;
    z-index:10000;
    display:flex;
    flex-direction:column;
}

#panel-carrito.abierto{
    right:0;
}

.cabecera-carrito{
    background:#1f3c88;
    color:white;
    padding:20px;
    display:flex;
    justify-content:space-between;
    align-items:center;
}

#cerrar-carrito{
    font-size:40px;
    font-weight:bold;
    cursor:pointer;
}

#productos-carrito{
    flex:1;
    overflow:auto;
    padding:20px;
}

.carrito-vacio{
    text-align:center;
    color:#777;
    margin-top:50px;
}

.pie-carrito{
    padding:20px;
    border-top:1px solid #ddd;
}

#enviar-whatsapp{
    width:100%;
    padding:14px;
    background:#25D366;
    color:white;
    border:none;
    border-radius:10px;
    cursor:pointer;
    font-size:17px;
    font-weight:bold;
}

/* ===========================
   RESPONSIVE - TABLET
=========================== */

@media (max-width:900px){

    .productos{
        grid-template-columns:repeat(2,minmax(0,280px));
    }

    .detalle-producto{
        gap:25px;
    }

    .info-detalle{
        padding:25px;
    }
}

/* ===========================
   RESPONSIVE - CELULAR
=========================== */

@media (max-width:600px){

    header{
        padding:25px 15px;
    }

    header h1{
        font-size:30px;
    }

    header p{
        font-size:16px;
    }

    .contenido{
        width:94%;
    }

    .modelos{
        width:94%;
        margin:30px auto;
        gap:15px;
    }

    .modelo{
        width:calc(50% - 10px);
        min-width:140px;
        padding:18px 12px;
    }

    .productos{
        grid-template-columns:1fr;
        gap:20px;
        width:100%;
        padding:0 8px;
        margin-top:25px;
    }

    .producto{
        width:100%;
        max-width:360px;
        height:auto;
        min-height:410px;
        margin:0 auto;
    }

    .imagen-tarjeta,
    .imagen-producto{
        height:210px;
    }

    .info-producto{
        padding:16px;
    }

    .info-producto h3,
    .producto h3{
        font-size:18px;
        min-height:44px;
    }

    .precio{
        font-size:23px !important;
    }

    .boton,
    .boton-carrito{
        font-size:17px;
        padding:13px;
    }

    .lista-modelos{
        grid-template-columns:1fr;
    }

    .formulario{
        padding:20px;
        margin:25px auto;
    }

    .panel{
        padding:25px 18px;
        margin:35px auto;
    }

    .opcion{
        font-size:18px;
        padding:16px;
    }

    .detalle-producto{
        flex-direction:column;
        gap:25px;
    }

    .galeria-producto,
    .info-detalle{
        width:100%;
        min-width:0;
        flex:none;
    }

    .galeria-producto{
        grid-template-columns:1fr;
    }

    .imagen-grande{
        height:240px;
    }

    .info-detalle{
        padding:22px;
    }

    .info-detalle h2{
        font-size:28px;
    }

    .precio-detalle{
        font-size:32px;
    }

    .busqueda-admin{
        flex-direction:column;
    }

    .busqueda-admin button{
        width:100%;
        padding:13px;
    }

    #carrito-flotante{
        width:62px;
        height:62px;
        right:15px;
        bottom:15px;
        font-size:30px;
    }

    #panel-carrito{
        width:100%;
        right:-100%;
    }

    .cabecera-carrito h2{
        font-size:24px;
    }

    #cerrar-carrito{
        font-size:36px;
    }

    #enviar-whatsapp{
        font-size:17px;
        padding:15px;
    }
}

/* ===========================
   CELULARES MUY PEQUEÑOS
=========================== */

@media (max-width:380px){

    .modelo{
        width:100%;
    }

    .producto{
        max-width:100%;
    }

    .imagen-tarjeta,
    .imagen-producto{
        height:190px;
    }
}
