/* style.css */

/* --- Importar Fuente y Variables de Color --- */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;600;700&display=swap');

:root {
    --primary-blue: #0a2463;
    --primary-red: #d8315b;
    --light-bg: #fdfdff;
    --text-dark: #333;
    --text-light: #fdfdff;
    --border-color: #e0e0e0;
    --shadow-color: rgba(0, 0, 0, 0.08);
    --admin-bg: #f4f7fc;
    --admin-sidebar-bg: #ffffff;
}

/* --- Estilos Generales --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', sans-serif;
    background-color: var(--light-bg);
    color: var(--text-dark);
    line-height: 1.6;
    overflow-x: hidden; /* Prevenir scroll horizontal no deseado */
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

a {
    text-decoration: none;
    color: var(--primary-red);
    transition: color 0.3s ease;
}

a:hover {
    color: var(--primary-blue);
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

h1, h2, h3 {
    margin-bottom: 1rem;
    color: var(--primary-blue);
    font-weight: 600;
}

/* --- Encabezado y Navegación --- */
header {
    background-color: #ffffff;
    padding: 1rem 0;
    box-shadow: 0 2px 10px var(--shadow-color);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--primary-blue);
}

.logo span {
    color: var(--primary-red);
}

.nav-links {
    list-style: none;
    display: flex;
    gap: 2rem;
}

.nav-links a {
    color: var(--text-dark);
    font-weight: 600;
    padding-bottom: 5px;
    border-bottom: 2px solid transparent;
}

.nav-links a:hover, .nav-links a.active {
    color: var(--primary-red);
    border-bottom-color: var(--primary-red);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 1.5rem; /* Espacio entre el carrito y el botón */
}

.cart-icon a {
    font-size: 1.5rem;
    position: relative;
    color: var(--text-dark);
}

.cart-count {
    position: absolute;
    top: -8px;
    right: -12px;
    background-color: var(--primary-red);
    color: var(--text-light);
    border-radius: 50%;
    width: 22px;
    height: 22px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 0.8rem;
    font-weight: 600;
}

.menu-toggle {
    display: none; /* Oculto por defecto en escritorio */
    font-size: 1.8rem;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--primary-blue);
}


/* --- Hero Banner (Página de Inicio) --- */
.hero-banner {
    position: relative;
    height: 60vh;
    min-height: 400px;
    background-image: url('muro.png');
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: #FFFFFF;
}

.hero-banner::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(10, 36, 99, 0.5); /* Overlay azul oscuro semi-transparente */
}

.hero-content {
    position: relative;
    z-index: 2;
    padding: 0 1rem;
}

.hero-content h1 {
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
    text-shadow: 2px 2px 8px rgba(0,0,0,0.5);
    color: #FFFFFF;
}

.hero-content p {
    font-size: 1.2rem;
    font-weight: 400;
    text-shadow: 1px 1px 6px rgba(0,0,0,0.5);
}


/* --- Rejilla de Productos --- */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.product-card {
    background-color: #ffffff;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 5px 15px var(--shadow-color);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
}

.product-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 25px rgba(0, 0, 0, 0.12);
}

.product-card-image {
    aspect-ratio: 4 / 3;
    overflow: hidden;
}

.product-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.product-card-content {
    padding: 1.5rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.product-card-title {
    font-size: 1.2rem;
    color: var(--primary-blue);
    margin-bottom: 0.5rem;
}

.product-card-price {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--primary-red);
    margin-bottom: 1rem;
}

.product-card-footer {
    margin-top: auto;
}

/* --- Botones --- */
.btn {
    display: inline-block;
    background-color: var(--primary-red);
    color: var(--text-light);
    padding: 0.8rem 1.8rem;
    border-radius: 50px;
    font-weight: 600;
    text-align: center;
    border: none;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.2s ease;
}

.btn:hover {
    background-color: #c22b50;
    transform: scale(1.05);
}

.btn-secondary {
    background-color: var(--primary-blue);
}

.btn-secondary:hover {
    background-color: #081e4f;
}

.btn-sm {
    padding: 0.4rem 1rem;
    font-size: 0.9rem;
}

/* --- Página de Producto Individual --- */
.product-detail-container {
    display: grid;
    grid-template-columns: 1fr; /* Cambiado a 1 columna por defecto */
    gap: 2rem;
    margin-top: 2rem;
    align-items: center;
}

.product-detail-image img {
    border-radius: 20px;
    box-shadow: 0 10px 20px var(--shadow-color);
    width: 100%;
}

.product-detail-info .price {
    font-size: 2rem;
    color: var(--primary-red);
    font-weight: 700;
    margin-bottom: 1.5rem;
}

.product-detail-info .description {
    margin-bottom: 1.5rem;
}

.add-to-cart-form {
    display: flex;
    flex-wrap: wrap; /* Para que se ajuste en pantallas pequeñas */
    gap: 1rem;
    align-items: center;
}

.add-to-cart-form input[type="number"] {
    width: 70px;
    padding: 0.7rem;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    font-size: 1rem;
    text-align: center;
}

/* --- Página del Carrito --- */
.cart-container {
    margin-top: 2rem;
}
.cart-item {
    display: grid;
    grid-template-columns: 80px 1fr auto;
    align-items: center;
    gap: 1rem;
    padding: 1.5rem 0;
    border-bottom: 1px solid var(--border-color);
}
.cart-item-price, .cart-item-quantity, .cart-item-total {
    display: none; /* Ocultar en móvil para un diseño más limpio */
}

.cart-item-info h4 {
    margin-bottom: 0.25rem;
}
.cart-item-info .mobile-price {
    font-weight: bold;
    color: var(--primary-red);
}

.cart-item-img img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 15px;
}
.cart-item-actions {
    grid-column: 2 / 4; /* Abarca más espacio en móvil */
    display: flex;
    align-items: center;
    gap: 0.5rem;
    justify-self: start;
    margin-top: 0.5rem;
}
.cart-item-actions input {
    width: 60px;
    padding: 0.5rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    text-align: center;
}
.btn-remove {
    background: none;
    border: none;
    color: var(--primary-red);
    font-size: 1.5rem;
    cursor: pointer;
    margin-left: auto;
    grid-column: 3 / 4;
    grid-row: 1 / 2;
}
.cart-summary {
    margin-top: 2rem;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}
.cart-total {
    text-align: right;
    width: 100%;
}
.cart-total h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
}
.cart-header {
    display: none;
}


/* --- Página de Cuenta / Formularios --- */
.account-container {
    display: grid;
    grid-template-columns: 1fr; /* Una columna por defecto */
    gap: 3rem;
    max-width: 900px;
    margin: 2rem auto;
    background-color: #fff;
    padding: 2rem;
    border-radius: 20px;
    box-shadow: 0 5px 25px var(--shadow-color);
}

.form-box h2 {
    text-align: center;
    margin-bottom: 2rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.form-group input, .form-group textarea, .form-group select {
    width: 100%;
    padding: 0.8rem 1rem;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    font-size: 1rem;
    font-family: 'Poppins', sans-serif;
}

.form-group input:focus, .form-group textarea:focus, .form-group select:focus {
    outline: none;
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 3px rgba(10, 36, 99, 0.1);
}

/* --- Footer --- */
footer {
    margin-top: 3rem;
    text-align: center;
    padding: 2rem;
    background-color: var(--primary-blue);
    color: var(--text-light);
    border-top-right-radius: 40px; /* Reducido para móvil */
}

/* --- Panel de Administración Responsivo --- */
body.admin-body {
    background-color: var(--admin-bg);
}
.admin-wrapper {
    display: flex;
    min-height: 100vh;
}
.admin-sidebar {
    position: fixed;
    left: -280px; /* Oculto por defecto en móvil */
    width: 260px;
    height: 100%;
    background-color: var(--admin-sidebar-bg);
    box-shadow: 2px 0 10px var(--shadow-color);
    padding: 2rem 1.5rem;
    display: flex;
    flex-direction: column;
    z-index: 1100;
    transition: left 0.3s ease;
}
.admin-sidebar.visible {
    left: 0;
}
.admin-sidebar .logo {
    margin-bottom: 2rem;
    text-align: center;
}
.admin-nav {
    list-style: none;
    flex-grow: 1;
}
.admin-nav li a {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    margin-bottom: 0.5rem;
    border-radius: 10px;
    color: #555;
    font-weight: 600;
    transition: all 0.3s ease;
}
.admin-nav li a:hover, .admin-nav li a.active {
    background-color: var(--primary-red);
    color: var(--text-light);
}
.admin-sidebar .sidebar-footer a {
    color: #555;
    font-weight: 600;
}
.admin-content {
    width: 100%;
    flex-grow: 1;
    padding: 1rem;
    overflow-y: auto;
}
.page-header {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    align-items: flex-start;
    margin-bottom: 2rem;
}
.page-header .btn {
    align-self: flex-start;
}
.admin-menu-toggle {
    display: block; /* Visible en móvil */
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1200;
    font-size: 1.5rem;
    background: var(--primary-blue);
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
}
.table-responsive {
    overflow-x: auto;
    width: 100%;
}
.admin-table {
    width: 100%;
    min-width: 600px;
    border-collapse: collapse;
}

/* --- Página de Contacto --- */
.contact-wrapper {
    display: grid;
    grid-template-columns: 1fr; /* Una columna por defecto */
    gap: 3rem;
}

/* --- Checkout y Confirmación --- */
.checkout-wrapper {
    display: grid;
    grid-template-columns: 1fr; /* Una columna por defecto */
    gap: 2rem;
}
.form-row {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}
.order-summary {
    position: static; /* Cambiado para móvil */
    margin-top: 2rem;
}

/* ------------------------------------------- */
/* --- MEDIA QUERIES PARA PANTALLAS GRANDES --- */
/* ------------------------------------------- */

/* Tablets (768px y más) */
@media (min-width: 768px) {
    .container {
        padding: 20px 40px;
    }
    .menu-toggle {
        display: none;
    }
    .nav-links {
        display: flex;
        position: static;
        flex-direction: row;
        width: auto;
        height: auto;
        background-color: transparent;
        box-shadow: none;
        padding: 0;
    }
    .hero-content h1 {
        font-size: 4rem;
    }
    .hero-content p {
        font-size: 1.5rem;
    }
    .product-detail-container {
        grid-template-columns: 1fr 1fr;
    }
    .account-container {
        grid-template-columns: 1fr 1fr;
        padding: 3rem;
    }
    .page-header {
        flex-direction: row;
        align-items: center;
    }
    .page-header .btn {
        align-self: auto;
    }
    .cart-header {
        display: grid;
        grid-template-columns: 110px 1fr 100px 100px 100px;
        gap: 1.5rem;
        padding-bottom: 1rem;
        border-bottom: 2px solid var(--border-color);
        font-weight: bold;
        text-align: center;
    }
    .cart-header-product {
        text-align: left;
    }
    .cart-item {
        grid-template-columns: 80px 1fr 100px 100px 100px;
        text-align: center;
        gap: 1.5rem;
    }
    .cart-item-info {
        text-align: left;
    }
    .cart-item-price, .cart-item-quantity, .cart-item-total {
        display: block;
    }
    .cart-item-info .mobile-price {
        display: none;
    }
    .cart-item-actions {
        grid-column: auto;
        margin-top: 0;
        justify-self: center;
    }
    .btn-remove {
        grid-column: auto;
        grid-row: auto;
        justify-self: center;
    }
    .contact-wrapper {
        grid-template-columns: 2fr 1fr;
    }
    .checkout-wrapper {
        grid-template-columns: 2fr 1fr;
    }
    .form-row {
        flex-direction: row;
        gap: 1rem;
    }
    .order-summary {
        position: sticky;
        top: 120px;
    }
    .admin-menu-toggle {
        display: none;
    }
    .admin-sidebar {
        position: static;
        left: 0;
        height: auto;
    }
    .admin-content {
        padding: 2rem;
    }
}

/* Menú de navegación móvil */
@media (max-width: 767px) {
    .menu-toggle {
        display: block;
        z-index: 1001;
    }
    .nav-links {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100vh;
        background-color: rgba(255, 255, 255, 0.98);
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 2rem;
        z-index: 1000;
        font-size: 1.5rem;
    }
    .nav-links.active {
        display: flex;
    }
}

