:root {
    /* Paleta de colores corporativa ORISUR PERU */
    --color-primary: #008087;
    --color-accent: #eeaa2a;
    --color-secondary: #2c3e50;
    --color-text: #34495e;
    --color-background: #f7f9fc;
    --color-light: #ffffff;
    --font-primary: 'Poppins', 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
    --container-width: 1140px;
    --header-height: 70px;
}

/* --- 2. Reseteo Básico y Estilos Globales --- */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-primary);
    line-height: 1.6;
    color: var(--color-text);
    background-color: var(--color-background);
    padding-top: var(--header-height); /* Evita que el contenido se oculte tras el header fijo */
    transition: background-color 0.3s;
}

img {
    max-width: 100%;
    display: block;
}

a {
    color: var(--color-primary);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
    color: var(--color-secondary);
}

/* --- 3. Utilidades y Contenedor --- */
.container {
    max-width: var(--container-width);
    margin-left: auto;
    margin-right: auto;
    padding-left: 1rem;
    padding-right: 1rem;
}

/* --- 4. Header y Navegación (Mobile-First) --- */
.main-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background-color: var(--color-primary);
    color: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    z-index: 1001; /* <-- CORRECCIÓN: Header por encima del overlay */
}

.main-header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: var(--header-height);
}

.main-header .logo-link {
    display: flex;
    align-items: center;
}

.header-logo {
    height: 45px; /* Ajusta la altura del logo según necesites */
    width: auto;
}

.nav-toggle { /* El botón de hamburguesa */
    display: block;
    background: none;
    border: none;
    font-size: 2rem;
    cursor: pointer;
    color: var(--color-light);
    padding: 0.5rem;
}

.main-nav { /* El menú lateral oculto */
    position: fixed;
    top: 0;
    right: 0; /* <-- CORRECCIÓN: Se posiciona en el borde derecho */
    width: 280px;
    height: 100vh;
    background-color: var(--color-primary);
    box-shadow: -5px 0 25px rgba(0,0,0,0.1);
    padding-top: 1rem;
    transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94); /* <-- La animación se mantiene */
    transform: translateX(100%);
    z-index: 1002; /* Menú por encima del header */
}
.main-nav.active{
transform: translateX(0%);
  }  
.main-nav ul {
    list-style: none;
    margin-top: 3rem;
}

.main-nav a {
    display: flex; /* MEJORA: Para alinear icono y texto */
    align-items: center;
    gap: 1rem; /* Espacio entre icono y texto */
    padding: 1rem 1.5rem;
    color: var(--color-light);
    font-size: 1.1rem;
    font-weight: 600;
    transition: background-color 0.2s, color 0.2s;
}

.main-nav a i {
    font-size: 1.2rem;
}

.main-nav a:hover {
    background-color:var(--color-background);
    color: var(--color-primary);
    text-decoration: none;
}

/* --- 5. Estilos del Menú Activo (controlado por JS) --- */
body.nav-open .main-nav {
    transform: translateX(0);
}

.nav-close {
    display: block;
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--color-light);
    cursor: pointer;
    padding: 0.5rem;
}

/* Overlay para el fondo cuando el menú está abierto */
.nav-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.4);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s, visibility 0.4s;
    z-index: 1000; /* <-- CORRECCIÓN: Overlay por debajo del header */
}

body.nav-open .nav-overlay {
    opacity: 1;
    visibility: visible;
}

:root {
    --sidebar-width: 250px; /* ejemplo de valor */
}

.section-title {
    text-align: center;
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--color-secondary);
    margin-bottom: 3rem;
}

/* Hero Section */
.hero {
    background: linear-gradient(135deg, rgba(0, 128, 135, 0.05), rgba(0, 128, 135, 0));
    padding: 6rem 0;
    text-align: center;
    margin-top: calc(-1 * var(--header-height)); /* Para que se junte con el header */
    padding-top: calc(var(--header-height) + 6rem);
}

.hero-content {
    max-width: 800px;
    margin: 0 auto;
}

.hero-title {
    font-size: 3.5rem;
    font-weight: 700;
    line-height: 1.2; 
    color: var(--color-secondary);
    margin-bottom: 1rem;
}

.hero-subtitle {
    font-size: 1.25rem;
    color: var(--color-text);
    margin-bottom: 2rem;
}

/* Botones */
.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    font-weight: 600;
    text-decoration: none;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    border: none;
    cursor: pointer;
}

.btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    text-decoration: none;
}

.btn-primary {
    background-color: var(--color-primary);
    color: var(--color-light);
}

.btn-primary:hover {
    background-color: #00666d; /* Tono más oscuro del primario */
    color: var(--color-light);
}

.btn-secondary {
    background-color: transparent;
    color: var(--color-primary);
    border: 2px solid var(--color-primary);
}

.btn-secondary:hover {
    background-color: var(--color-primary);
    color: var(--color-light);
}

.btn-lg {
    font-size: 1.1rem;
    padding: 1rem 2rem;
}

/* Products Section */
.products-section {
    padding: 4rem 0;
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.product-card {
    background-color: var(--color-light);
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.05);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    opacity: 0;
    transform: translateY(30px);
    animation: fadeInUp 0.7s ease forwards;
}

.product-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 30px rgba(0,0,0,0.1);
}

.product-image-container {
    position: relative;
}

.product-badges {
    position: absolute;
    top: 1rem;
    left: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    z-index: 2;
}

.badge {
    padding: 0.3rem 0.8rem;
    border-radius: 50px;
    font-weight: 700;
    font-size: 0.8rem;
    backdrop-filter: blur(5px);
}

.badge-shipping {
    background-color: var(--color-primary);
    color: var(--color-light);
}

.product-image-container img {
    width: 100%;
    height: 300px;
    object-fit: cover;
    background-color: #eee;
}

.discount-badge {
    position: absolute;
    top: 1rem;
    right: 1rem; /* Se mantiene a la derecha */
    background-color: var(--color-accent);
    color: var(--color-secondary);
    padding: 0.3rem 0.7rem;
    border-radius: 50px;
    font-weight: 700;
    font-size: 0.9rem;
}

.product-info {
    padding: 1.5rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.product-title {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.product-title a {
    color: var(--color-secondary);
}

.product-title a:hover {
    color: var(--color-primary);
    text-decoration: none;
}

.product-description {
    font-size: 0.9rem;
    color: #6c757d;
    margin-bottom: 1rem;
    flex-grow: 1;
}

.product-price {
    margin-bottom: 1.5rem;
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
}

.current-price {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--color-primary);
}

.old-price {
    font-size: 1.1rem;
    color: #6c757d;
    text-decoration: line-through;
}

/* Benefits Section */
.benefits-section {
    background-color: #f7f9fc;
    padding: 4rem 0;
}

.benefits-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    text-align: center;
}

.benefit-item i {
    font-size: 3rem;
    color: var(--color-primary);
    margin-bottom: 1rem;
    display: inline-block;
}

.benefit-item h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    color: var(--color-secondary);
}

/* --- 7. Media Query para Escritorio --- */
/* A partir de 768px, el menú cambia */
@media (min-width: 992px) {
    .nav-toggle {
        display: none; /* Ocultamos el botón de hamburguesa */
    }
    .nav-close {
        display: none;
    }

    .main-nav { /* El menú se vuelve visible y horizontal */
        position: static;
        width: auto;
        height: auto;
        background: none;
        padding-top: 0;
        box-shadow: none;
        transform: none;
    }

    .main-nav ul {
        display: flex;
        margin-top: 0;
    }

    .main-nav a {
        color: var(--color-light);
        padding: 0.5rem 1rem;
        font-weight: 400;
    }

    .main-nav a:hover {
        background-color: transparent;
        color: var(--color-accent);
    }
}

@media (max-width: 768px) {
    .hero-title {
        font-size: 2.5rem;
    }
    .hero-subtitle {
        font-size: 1.1rem;
    }
    .section-title {
        font-size: 2rem;
    }
}

/* --- 8. Estilos del Footer --- */
.main-footer {
    background-color: var(--color-primary);
    color: rgba(255, 255, 255, 0.8);
    padding-top: 4rem;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    padding-bottom: 3rem;
}

.footer-column .footer-logo {
    display: inline-block;
    margin-bottom: 1rem;
}

.footer-logo-img {
    height: 40px; /* Altura del logo en el footer */
    width: auto;
}

.footer-description {
    font-size: 0.9rem;
    line-height: 1.7;
    margin-bottom: 1.5rem;
}

.social-icons {
    display: flex;
    gap: 1rem;
}

.social-icons a {
    color: var(--color-light);
    font-size: 1.5rem;
    transition: color 0.2s, transform 0.2s;
}

.social-icons a:hover {
    color: var(--color-accent);
    transform: translateY(-3px);
    text-decoration: none;
}

.footer-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--color-light);
    margin-bottom: 1.5rem;
    position: relative;
}

.footer-title::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 0;
    width: 40px;
    height: 3px;
    background-color: var(--color-accent);
}

.footer-links {
    list-style: none;
}

.footer-links li {
    margin-bottom: 0.8rem;
}

.footer-links a {
    color: rgba(255, 255, 255, 0.8);
    transition: color 0.2s;
}

.footer-links a:hover {
    color: var(--color-light);
    text-decoration: none;
    padding-left: 5px;
}

.footer-column p {
    margin-bottom: 0.8rem;
    display: flex;
    align-items: center;
    gap: 0.7rem;
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding: 1.5rem 0;
}

.footer-bottom .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.footer-bottom p {
    margin: 0;
}

.footer-bottom a {
    color: var(--color-accent);
    font-weight: 600;
}

.payment-methods {
    display: flex;
    gap: 0.5rem;
}

.payment-methods img {
    height: 25px;
    opacity: 0.8;
}

/* --- 9. Estilos para Página de Error --- */
.error-page {
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    /* Ocupa el espacio disponible entre header y footer */
    min-height: calc(100vh - var(--header-height) - 250px); /* 250px es una altura aprox del footer */
    padding: 2rem 0;
}

.error-content .error-code {
    font-size: 15rem;
    font-weight: 900;
    color: var(--color-primary);
    line-height: 1;
    opacity: 0.07;
}

.error-content .error-title {
    font-size: 3rem;
    margin-top: -5rem;
    color: var(--color-secondary);
    margin-bottom: 1rem;
    position: relative; /* Para asegurar que esté sobre el código de error */
}

.error-content .error-message {
    font-size: 1.2rem;
    margin-bottom: 2.5rem;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

/* Media Queries para responsividad */
@media (max-width: 768px) {
    .error-content .error-code {
        font-size: 12rem;
    }
    .error-content .error-title {
        font-size: 2.5rem;
        margin-top: -4rem;
    }
}

@media (max-width: 480px) {
    .error-content .error-code {
        font-size: 8rem;
    }
    .error-content .error-title {
        font-size: 2rem;
        margin-top: -2.5rem;
    }
    .error-content .error-message {
        font-size: 1rem;
    }
}

/* Animación de fade-in para las tarjetas de producto */
.products-grid .product-card:nth-child(1) { animation-delay: 0.1s; }
.products-grid .product-card:nth-child(2) { animation-delay: 0.2s; }
.products-grid .product-card:nth-child(3) { animation-delay: 0.3s; }
.products-grid .product-card:nth-child(4) { animation-delay: 0.4s; }

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Slider/banner simple */
.main-slider {
    width: 100%;
    max-width: 100vw;
    overflow: hidden;
    margin-bottom: 2rem;
}
.slider-wrapper {
    position: relative;
    width: 100%;
    height: 320px;
}
.slider-slide {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    opacity: 0;
    transition: opacity 0.7s;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}
.slider-slide.active {
    opacity: 1;
    z-index: 2;
}
.slider-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: brightness(0.7);
}
.slider-caption {
    position: absolute;
    left: 10%;
    top: 50%;
    transform: translateY(-50%);
    color: #fff;
    z-index: 3;
    text-shadow: 0 2px 8px rgba(0,0,0,0.3);
}
.slider-caption h2 {
    font-size: 2.2rem;
    margin-bottom: 0.5rem;
}
.slider-caption p {
    font-size: 1.1rem;
}
.slider-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0,0,0,0.3);
    color: #fff;
    border: none;
    font-size: 2rem;
    padding: 0.5rem 1rem;
    cursor: pointer;
    z-index: 4;
    border-radius: 50%;
}
.slider-btn.prev { left: 1rem; }
.slider-btn.next { right: 1rem; }
.slider-btn:hover { background: var(--color-primary); }

/* Botón fijo móvil */
.pedir-ahora-btn-fixed {
    display: none;
    position: fixed;
    left: 0; right: 0; bottom: 0;
    width: 100vw;
    z-index: 1003;
    border-radius: 0;
    font-size: 1.2rem;
    padding: 1rem;
}
@media (max-width: 768px) {
    .pedir-ahora-btn-fixed { display: block; }
    .pedir-ahora-btn { display: none; }
}
@media (min-width: 769px) {
    .pedir-ahora-btn-fixed { display: none; }
    .pedir-ahora-btn { float: left; }
}
/* Modal y ofertas */
.quantity-offers { margin-bottom: 1rem; }
.quantity-offer { display: flex; align-items: center; gap: 1rem; cursor: pointer; border: 2px solid #eee; border-radius: 8px; margin-bottom: 0.5rem; padding: 0.5rem; }
.quantity-offer.active { border-color: var(--color-primary); background: #f0f8f8; }
.offer-img { width: 60px; height: 60px; object-fit: cover; border-radius: 8px; }
.offer-title { font-weight: 600; }
.offer-prices { margin-top: 0.2rem; }
.old-price { color: #888; margin-right: 0.5rem; }
.new-price { color: var(--color-primary); font-weight: 700; }
.totals-summary { background: #f7f9fc; border-radius: 8px; padding: 1rem; margin-bottom: 1rem; }

.producto-card {
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}

.producto-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15) !important;
}

.producto-card .card-img-top {
    transition: transform 0.3s ease;
}

.producto-card:hover .card-img-top {
    transform: scale(1.05);
}

.badge {
    font-size: 0.75em;
}

@media (max-width: 768px) {
    .producto-card:hover {
        transform: none;
    }
}
