/* =========================================================
   1. BASE GENERAL
========================================================= */
body {
    margin: 0;
    font-family: Arial, sans-serif;
    background-color: #f5f7fa;
    color: #222;
}

.contenedor {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
}


/* =========================================================
   2. HEADER / TOPBAR
========================================================= */
.topbar {
    background: blueviolet;
    padding: 15px 0;
}

.topbar .contenedor {
    display: flex;
    justify-content: space-between;
    align-items: center;
}


/* =========================================================
   3. LOGO
========================================================= */
.logo {
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo h1 {
    color: white;
    margin: 0;
    font-size: 20px;
}

.logo-img {
    height: 40px;
    object-fit: contain;
}


/* =========================================================
   4. MENÚ
========================================================= */
.menu {
    display: flex;
    align-items: center;
    gap: 18px;
    flex-wrap: wrap;
}

.menu a {
    text-decoration: none;
    color: white;
    font-weight: 600;
}

.menu-dropdown {
    position: relative;
    display: inline-block;
}

.menu-dropdown::after {
    content: "";
    position: absolute;
    left: 0;
    top: 100%;
    width: 100%;
    height: 14px;
}

.dropdown-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: white;
    text-decoration: none;
    font-weight: 600;
    cursor: pointer;
}

.flecha {
    font-size: 12px;
    transition: transform 0.25s ease;
}

.dropdown-contenido {
    position: absolute;
    top: calc(100% + 12px);
    left: 0;
    min-width: 240px;
    background: white;
    border-radius: 14px;
    box-shadow: 0 14px 35px rgba(0, 0, 0, 0.18);
    padding: 10px 0;
    display: none;
    z-index: 2000;
    border: 1px solid rgba(0, 0, 0, 0.06);
}

.dropdown-contenido a {
    display: block;
    padding: 12px 18px;
    color: #222;
    text-decoration: none;
    font-weight: 500;
    transition: background 0.2s ease, padding-left 0.2s ease;
}

.dropdown-contenido a:hover {
    background: #f5f5f5;
    padding-left: 24px;
}

.menu-dropdown:hover .dropdown-contenido {
    display: block;
}

.menu-dropdown:hover .flecha {
    transform: rotate(180deg);
}


/* =========================================================
   5. BOTONES DEL MENÚ (LOGIN / REGISTER / CARRITO)
========================================================= */
.btn-menu {
    display: inline-block;
    padding: 10px 20px;
    border-radius: 999px;
    font-weight: 700;
    font-size: 14px;
    text-decoration: none;
    transition: 0.25s ease;
}

/* Botón iniciar sesión */
.btn-menu-login {
    background: transparent;
    border: 2px solid #ffffff;
    color: #ffffff;
}

.btn-menu-login:hover {
    background: #ffffff;
    color: #7e22ce;
}

/* Botón crear cuenta */
.btn-menu-register {
    background: linear-gradient(135deg, #f59e0b, #f97316);
    color: #fff;
    border: none;
}

.btn-menu-register:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

/* Botón carrito en menú */
.btn-carrito-menu {
    position: relative;
    display: inline-block;
    padding: 10px 16px;
    border-radius: 999px;
    background: #0f172a;
    color: #fff !important;
    text-decoration: none;
    font-weight: 700;
}

.btn-carrito-menu:hover {
    background: #1e293b;
}

.carrito-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    min-width: 22px;
    height: 22px;
    padding: 0 6px;
    border-radius: 999px;
    background: #ef4444;
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}


/* =========================================================
   6. MAIN
========================================================= */
main {
    padding: 60px 0;
}


/* =========================================================
   7. HERO
========================================================= */
.hero {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
    background-color: white;
    padding: 50px;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 40px;
    box-sizing: border-box;
}

.hero-texto {
    flex: 1;
}

.hero-texto h2 {
    margin-top: 0;
    font-size: 40px;
    color: #0d1b2a;
}

.hero-texto p {
    font-size: 18px;
    line-height: 1.7;
    margin-bottom: 25px;
}

.hero-imagen {
    flex: 1;
}

.hero-imagen img {
    width: 100%;
    border-radius: 12px;
    display: block;
}


/* =========================================================
   8. BOTONES HERO
========================================================= */
.btn-principal,
.btn-secundario {
    display: inline-block;
    padding: 14px 24px;
    text-decoration: none;
    border-radius: 6px;
    font-weight: bold;
    margin-right: 12px;
    border: none;
    cursor: pointer;
    box-sizing: border-box;
}

.btn-principal {
    background-color: #fca311;
    color: white;
}

.btn-principal:hover {
    background-color: #e59200;
}

.btn-secundario {
    background-color: #0d1b2a;
    color: white;
}

.btn-secundario:hover {
    background-color: #16263a;
}


/* =========================================================
   9. TARJETAS DE SERVICIOS
========================================================= */
.servicios {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto 40px auto;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.servicio {
    background: #fff;
    border-radius: 14px;
    padding: 25px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    box-sizing: border-box;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
}

.servicio h3 {
    margin-top: 0;
    color: #0d1b2a;
}

.servicio p {
    font-size: 15px;
    line-height: 1.5;
}

.servicio-contenido {
    flex: 1;
}

/* botón pequeño solo para tarjetas */
.servicio .btn-principal,
.servicio .btn-servicio {
    display: inline-block;
    width: auto;
    align-self: flex-start;
    background: #fca311;
    color: white;
    text-decoration: none;
    border: none;
    border-radius: 8px;
    padding: 12px 22px;
    font-weight: bold;
    cursor: pointer;
    box-sizing: border-box;
    margin-top: 15px;
}

.servicio .btn-principal:hover,
.servicio .btn-servicio:hover {
    background: #e59200;
}

/* seguimiento dentro de tarjeta */
.form-seguimiento-card {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 12px;
}

.form-seguimiento-card input {
    width: 100%;
    padding: 10px;
    border-radius: 8px;
    border: 1px solid #ccc;
    font-size: 14px;
    box-sizing: border-box;
}

.form-seguimiento-card button {
    width: auto;
    align-self: flex-start;
}


/* =========================================================
   10. TIENDA
========================================================= */
.tienda {
    padding: 60px 20px;
    background: #f5f7fb;
}

.tienda h2 {
    text-align: center;
    margin-bottom: 30px;
}


/* =========================================================
   11. PRODUCTOS CENTRADOS
========================================================= */
.productos-grid {
    display: grid;
    grid-template-columns: repeat(4, 280px);
    gap: 20px;
    justify-content: center;
}

.producto-card {
    width: 280px;
    background: white;
    border-radius: 12px;
    padding: 12px;
    text-align: center;
    transition: 0.3s;
    display: flex;
    flex-direction: column;
    gap: 8px;
    box-sizing: border-box;
}

.producto-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.producto-card img {
    width: 100%;
    height: 220px;
    object-fit: cover;
    border-radius: 10px;
    display: block;
    padding: 0;
    margin: 0;
}

.producto-info-linea {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 12px 0;
}

.producto-info-linea h3 {
    margin: 0;
    font-size: 18px;
    font-weight: bold;
    text-align: right;
}

.producto-info-linea .precio {
    margin: 0;
    font-size: 18px;
    font-weight: bold;
}

.producto-botones {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: auto;
}

.form-carrito {
    margin: 0;
    width: 100%;
}

.btn-ver,
.btn-carrito {
    display: block;
    width: 100%;
    padding: 12px 15px;
    border-radius: 8px;
    text-decoration: none;
    border: none;
    cursor: pointer;
    font-weight: 600;
    box-sizing: border-box;
    text-align: center;
}

.btn-ver {
    background: #2563eb;
    color: white;
}

.btn-ver:hover {
    background: #1d4ed8;
}

.btn-carrito {
    background: #f59e0b;
    color: #fff;
}

.btn-carrito:hover {
    background: #d97706;
}

@media (max-width: 1200px) {
    .productos-grid {
        grid-template-columns: repeat(3, 280px);
    }
}

@media (max-width: 900px) {
    .productos-grid {
        grid-template-columns: repeat(2, 280px);
    }
}

@media (max-width: 600px) {
    .productos-grid {
        grid-template-columns: 280px;
    }
}


/* =========================================================
   12. CARRITO - CONTENEDOR
========================================================= */
.user-page {
    min-height: 100vh;
    background: linear-gradient(135deg, #0f172a, #1e3a8a);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
}

.user-card {
    width: 100%;
    max-width: 900px;
    background: #ffffff;
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
    box-sizing: border-box;
}

.user-title {
    text-align: center;
    margin-bottom: 25px;
    font-size: 28px;
    font-weight: 700;
    color: #0f172a;
}

.user-empty {
    text-align: center;
    padding: 20px;
    background: #f1f5f9;
    border-radius: 10px;
    color: #334155;
}


/* =========================================================
   13. CARRITO - TABLA
========================================================= */
.user-table-wrap {
    overflow-x: auto;
}

.user-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
}

.user-table thead {
    background: #0f172a;
    color: white;
}

.user-table th {
    padding: 12px;
    text-align: left;
}

.user-table td {
    padding: 12px;
    border-bottom: 1px solid #e2e8f0;
}

.user-table tbody tr:hover {
    background: #f8fafc;
}

.user-table tbody tr:last-child {
    background: #f1f5f9;
    font-weight: bold;
}


/* =========================================================
   14. LINKS DEL CARRITO / PERFIL
========================================================= */
.user-links {
    margin-top: 25px;
    display: flex;
    justify-content: space-between;
}

.user-links a {
    text-decoration: none;
    color: #2563eb;
    font-weight: 600;
}

.user-links a:hover {
    text-decoration: underline;
}


/* =========================================================
   15. FOOTER
========================================================= */
footer {
    margin-top: 40px;
    background-color: blueviolet;
    color: white;
    text-align: center;
    padding: 20px;
}


/* =========================================================
   16. RESPONSIVE
========================================================= */
@media (max-width: 900px) {
    .hero {
        flex-direction: column;
        padding: 30px;
    }

    .servicios {
        grid-template-columns: 1fr;
    }

    .topbar .contenedor {
        flex-direction: column;
        gap: 15px;
    }

    .menu {
        justify-content: center;
    }

    .producto-detalle {
        flex-direction: column;
    }

    .producto-detalle-principal img {
        height: 320px;
    }

    .producto-detalle-info h1 {
        font-size: 30px;
    }
}

@media (max-width: 600px) {
    .hero-texto h2 {
        font-size: 28px;
    }

    .hero .btn-principal,
    .hero .btn-secundario {
        width: 100%;
        margin-bottom: 10px;
        text-align: center;
    }

    .user-card {
        padding: 20px;
    }

    .user-title {
        font-size: 24px;
    }

    .user-links {
        flex-direction: column;
        gap: 10px;
    }
}


/* =========================================================
   17. MESSAGE DE CONFEMACION A CARRETO
========================================================= */
.alert-ok {
    background: #dcfce7;
    color: #166534;
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 20px;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    animation: fadeOut 4s forwards;
}

@keyframes fadeOut {
    0% { opacity: 1; }
    80% { opacity: 1; }
    100% { opacity: 0; }
}


/* =========================================================
   18. TOSTADA
========================================================= */
.toast-ok {
    position: fixed;
    top: 20px;
    right: 20px;
    width: 340px;
    max-width: calc(100% - 40px);
    background: #ffffff;
    border-left: 5px solid #16a34a;
    border-radius: 12px;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.15);
    padding: 16px;
    z-index: 9999;
    transition: all 0.3s ease;
    box-sizing: border-box;
}

.toast-ok-texto {
    color: #166534;
    font-weight: 700;
    margin-bottom: 12px;
}

.toast-ok-botones {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.toast-btn {
    display: inline-block;
    background: #2563eb;
    color: white;
    text-decoration: none;
    padding: 10px 14px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
}

.toast-btn:hover {
    background: #1d4ed8;
}

.toast-cerrar {
    border: none;
    background: #f3f4f6;
    color: #111827;
    width: 34px;
    height: 34px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 20px;
    line-height: 1;
}

.toast-cerrar:hover {
    background: #e5e7eb;
}


/* =========================================================
   19. PRODUCTO DETALLE
========================================================= */
.producto-detalle {
    display: flex;
    gap: 40px;
    align-items: flex-start;
    background: white;
    padding: 30px;
    border-radius: 16px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.08);
    flex-wrap: wrap;
}

.producto-detalle-galeria {
    flex: 1;
    min-width: 320px;
    max-width: 520px;
}

.producto-detalle-principal {
    background: #f8fafc;
    border-radius: 14px;
    padding: 20px;
    border: 1px solid #e5e7eb;
}

.producto-detalle-principal img {
    width: 100%;
    height: 420px;
    object-fit: contain;
    display: block;
}

.producto-detalle-miniaturas {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 15px;
}

.miniatura-img {
    width: 90px;
    height: 90px;
    object-fit: cover;
    border-radius: 10px;
    border: 2px solid #ddd;
    background: white;
    cursor: pointer;
    transition: 0.2s ease;
    padding: 4px;
    box-sizing: border-box;
}

.miniatura-img:hover {
    border-color: #2563eb;
    transform: scale(1.04);
}

.producto-detalle-info {
    flex: 1;
    min-width: 300px;
}

.producto-detalle-info h1 {
    margin-top: 0;
    font-size: 42px;
    color: #0f172a;
    margin-bottom: 10px;
}

.producto-detalle-precio {
    font-size: 28px;
    font-weight: 700;
    color: #2563eb;
    margin: 10px 0 18px 0;
}

.producto-detalle-descripcion {
    color: #475569;
    line-height: 1.7;
    margin-bottom: 20px;
}

/*CARRITOS*/
.btn-confirmar {
    background: linear-gradient(135deg, #16a34a, #22c55e);
    color: #fff;
    border: none;
    padding: 12px 22px;
    border-radius: 8px;
    font-weight: bold;
    font-size: 15px;
    cursor: pointer;
    transition: all 0.25s ease;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

/* Hover */
.btn-confirmar:hover {
    background: linear-gradient(135deg, #15803d, #16a34a);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.2);
}

/* Click */
.btn-confirmar:active {
    transform: scale(0.98);
}

/* Deshabilitado */
.btn-confirmar:disabled {
    background: #ccc;
    cursor: not-allowed;
    box-shadow: none;
}


/* =========================================================
   CONTACTO
========================================================= */

/* CONTENEDOR */
.contacto-box {
    max-width: 600px;
    margin: 60px auto;
    background: #ffffff;
    padding: 40px;
    border-radius: 18px;
    box-shadow: 0 15px 40px rgba(0,0,0,0.08);
    text-align: center;
}

/* TÍTULO */
.contacto-box h2 {
    margin-bottom: 10px;
    font-size: 28px;
    color: #0f172a;
}

.contacto-box p {
    color: #64748b;
    margin-bottom: 25px;
}

/* INPUTS */
.contacto-box input,
.contacto-box textarea {
    width: 100%;
    padding: 14px;
    margin-bottom: 15px;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
    font-size: 15px;
    transition: 0.2s;
    box-sizing: border-box;
}

.contacto-box input:focus,
.contacto-box textarea:focus {
    border-color: #7c3aed;
    outline: none;
    box-shadow: 0 0 0 3px rgba(124,58,237,0.1);
}

/* TEXTAREA */
.contacto-box textarea {
    min-height: 130px;
    resize: none;
}

/* BOTÓN */
.btn-contacto {
    width: 100%;
    padding: 14px;
    border-radius: 10px;
    border: none;
    font-weight: bold;
    font-size: 16px;
    cursor: pointer;
    color: white;
    background: linear-gradient(135deg, #7c3aed, #9333ea);
    transition: 0.25s;
}

.btn-contacto:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.15);
}

/* MENSAJE OK */
.alert-ok {
    background: #dcfce7;
    color: #166534;
    padding: 12px;
    border-radius: 10px;
    margin-bottom: 15px;
    font-weight: 600;
}