@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap');

:root {
    --primary: #4F46E5; /* Indigo */
    --primary-dark: #4338ca;
    --secondary: #0f172a; /* Slate 900 */
    --accent: #f59e0b; /* Amber */
    --text: #334155; /* Slate 700 */
    --text-light: #64748b;
    --light-bg: #f8fafc; /* Slate 50 */
    --white: #ffffff;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.1);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --radius: 12px;
}

body {
    font-family: 'Poppins', sans-serif;
    background-color: var(--light-bg);
    color: var(--text);
    margin: 0;
    padding: 0;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/* Navbar */
.navbar {
    background-color: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(10px);
    color: var(--white);
    padding: 1rem 5%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.brand {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.5px;
    background: linear-gradient(to right, #fff, #a5b4fc);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.nav-links a {
    color: #cbd5e1;
    text-decoration: none;
    margin-left: 30px;
    font-weight: 500;
    font-size: 0.95rem;
    transition: all 0.3s;
}

.nav-links a:hover {
    color: var(--white);
}

.cart-btn {
    background: var(--primary);
    padding: 8px 20px;
    border-radius: 99px;
    color: white !important;
    font-weight: 600;
    box-shadow: 0 4px 14px 0 rgba(79, 70, 229, 0.39);
}

.cart-btn:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
}

/* Hero Section */
.hero {
    background: linear-gradient(rgba(15, 23, 42, 0.7), rgba(15, 23, 42, 0.8)), url('https://images.unsplash.com/photo-1607082348824-0a96f2a4b9da?auto=format&fit=crop&w=2070&q=80');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    color: var(--white);
    padding: 160px 20px 120px;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hero-content {
    max-width: 800px;
    animation: fadeInUp 1s ease-out;
}

.badge {
    display: inline-block;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 6px 16px;
    border-radius: 99px;
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 1px;
    margin-bottom: 20px;
    color: #a5b4fc;
}

.hero h1 {
    font-size: 3.5rem;
    margin: 0 0 20px 0;
    font-weight: 700;
    line-height: 1.1;
}

.hero p {
    font-size: 1.25rem;
    margin-bottom: 40px;
    color: #cbd5e1;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.btn-hero {
    background-color: var(--white);
    color: var(--primary);
    padding: 16px 40px;
    font-size: 1.1rem;
    border-radius: 99px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.btn-hero:hover {
    background-color: #f8fafc;
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
}

/* Hero Slider */
.hero-slider {
    position: relative;
    height: 600px;
    overflow: hidden;
    margin-bottom: 0;
}

.slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 1s ease-in-out;
    text-align: center;
    color: var(--white);
}

.slide.active {
    opacity: 1;
    z-index: 1;
}

.hero-slider .hero-content {
    z-index: 2;
    position: relative;
    max-width: 800px;
    padding: 20px;
    animation: fadeInUp 1s ease-out;
}

/* Slider Controls */
.slider-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    font-size: 2rem;
    padding: 10px 15px;
    cursor: pointer;
    z-index: 10;
    transition: background 0.3s;
    border-radius: 50%;
}

.slider-btn:hover {
    background: rgba(255,255,255,0.4);
}

.prev { left: 20px; }
.next { right: 20px; }

.slider-dots {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
    z-index: 10;
}

.dot {
    width: 12px;
    height: 12px;
    background: rgba(255,255,255,0.5);
    border-radius: 50%;
    cursor: pointer;
    transition: background 0.3s;
}

.dot.active, .dot:hover {
    background: white;
}

/* Features Section */
.features {
    background: var(--white);
    padding: 80px 0;
    margin-top: -50px;
    position: relative;
    z-index: 10;
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
}

.feature-item {
    text-align: center;
    padding: 30px;
    background: var(--light-bg);
    border-radius: var(--radius);
    transition: transform 0.3s;
}

.feature-item:hover {
    transform: translateY(-5px);
}

.feature-item .icon {
    font-size: 2.5rem;
    margin-bottom: 20px;
}

.feature-item h3 {
    margin: 0 0 10px;
    color: var(--secondary);
}

.feature-item p {
    color: var(--text-light);
    margin: 0;
}

/* About Section */
.about-section {
    padding: 100px 0;
    background-color: var(--white);
    text-align: center; /* Centrar todo el texto */
}

.about-container {
    display: flex;
    flex-direction: column; /* Cambiar a columna para centrar todo */
    align-items: center;
    gap: 40px;
    max-width: 1000px; /* Limitar ancho para que se vea compacto */
    margin: 0 auto;
    padding: 0 20px;
}

.about-content {
    max-width: 800px;
}

.about-content h2 {
    font-size: 2.8rem;
    color: var(--secondary);
    margin-bottom: 25px;
    font-weight: 700;
    position: relative;
    display: inline-block;
}

/* Decoración debajo del título */
.about-content h2::after {
    content: '';
    display: block;
    width: 60px;
    height: 4px;
    background: var(--primary);
    margin: 15px auto 0;
    border-radius: 2px;
}

.about-content p {
    color: var(--text-light);
    margin-bottom: 30px;
    font-size: 1.15rem;
    line-height: 1.9;
}

.about-image {
    width: 100%;
    max-width: 600px;
    position: relative;
    margin-top: 20px;
}

.about-image img {
    width: 100%;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    transition: transform 0.3s;
}

.about-image img:hover {
    transform: scale(1.02);
}

@media (min-width: 1024px) {
    .about-container {
        flex-direction: row; /* Volver a fila en pantallas muy grandes si se prefiere, o dejar columna para "centrado total" */
        text-align: left; /* Alinear a la izquierda en desktop para diseño clásico, o mantener centro */
    }
    
    /* Si el usuario pidió "centrar todo", mantendremos el diseño centrado incluso en desktop */
    .about-container {
        flex-direction: column;
        text-align: center;
    }
}

/* Layout */
.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 20px;
}

#productos {
    padding: 80px 20px;
}

.section-title {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 60px;
    color: var(--secondary);
    font-weight: 700;
}

/* Products */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); /* Un poco más estrecho para más productos */
    gap: 30px;
    justify-content: center; /* Centrar grid */
}

.product-card {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    border: 1px solid #f1f5f9;
    text-align: center; /* Centrar contenido de la tarjeta */
}

.product-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-lg);
}

.img-container {
    height: 250px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    padding: 20px;
    position: relative;
    border-bottom: 1px solid #f8fafc;
}

.product-card img {
    max-width: 80%;
    max-height: 80%;
    object-fit: contain;
    transition: transform 0.5s;
}

.product-card:hover img {
    transform: scale(1.1);
}

.card-body {
    padding: 25px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    align-items: center; /* Centrar elementos flex */
}

.card-body h3 {
    margin: 0 0 10px 0;
    font-size: 1.25rem;
    color: var(--secondary);
    font-weight: 600;
}

.card-body .desc {
    font-size: 0.95rem;
    color: var(--text-light);
    margin-bottom: 20px;
    flex-grow: 1;
}

.price-row {
    display: flex;
    flex-direction: column; /* Cambiar a columna para centrar precio y botón */
    gap: 15px;
    width: 100%;
    align-items: center;
    margin-top: auto;
    padding-top: 20px;
    border-top: 1px solid #f1f5f9;
}

.price {
    font-size: 1.75rem;
    color: var(--secondary);
    font-weight: 700;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 30px; /* Botones más grandes */
    background-color: var(--primary);
    color: var(--white);
    text-decoration: none;
    border-radius: 99px; /* Botones redondeados */
    border: none;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s;
    width: 100%; /* Botón ancho completo en tarjeta */
    max-width: 200px;
}

.btn:hover {
    background-color: var(--primary-dark);
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
}

/* Tables */
.cart-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: var(--white);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    margin-bottom: 30px;
}

.cart-table th, .cart-table td {
    padding: 15px 20px;
    text-align: left;
    border-bottom: 1px solid #f1f5f9;
}

.cart-table th {
    background-color: var(--light-bg);
    font-weight: 600;
    color: var(--secondary);
}

.cart-table tr:last-child td {
    border-bottom: none;
}

/* Newsletter */
.newsletter {
    background: linear-gradient(135deg, var(--primary) 0%, #312e81 100%);
    color: var(--white);
    padding: 80px 20px;
    text-align: center;
    margin-top: 80px;
}

.newsletter h2 {
    font-size: 2rem;
    margin-bottom: 10px;
}

.newsletter p {
    color: #e0e7ff;
    margin-bottom: 30px;
}

.newsletter-form {
    max-width: 500px;
    margin: 0 auto;
    display: flex;
    gap: 10px;
}

.newsletter-form input {
    flex: 1;
    padding: 12px 20px;
    border-radius: 99px;
    border: none;
    outline: none;
}

.newsletter-form button {
    border-radius: 99px;
    background: var(--secondary);
    white-space: nowrap;
}

/* Footer */
.footer {
    background-color: var(--secondary);
    color: #94a3b8;
    padding: 80px 0 30px;
    text-align: center; /* Centrar texto del footer */
}

.footer-content {
    max-width: 1280px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 60px;
    padding: 0 20px;
    justify-items: center; /* Centrar elementos del grid */
}

.footer-section h3 {
    color: var(--white);
    margin-bottom: 25px;
    font-size: 1.1rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    position: relative;
    display: inline-block;
}

.footer-section h3::after {
    content: '';
    display: block;
    width: 30px;
    height: 2px;
    background: var(--primary);
    margin: 10px auto 0; /* Centrar la línea decorativa */
}

.footer-section p {
    margin-bottom: 15px;
    line-height: 1.8;
}

.footer-section a {
    display: inline-block; /* Cambiar a inline-block para que el hover funcione bien centrado */
    color: #94a3b8;
    text-decoration: none;
    margin-bottom: 12px;
    transition: color 0.3s;
}

.footer-section a:hover {
    color: var(--primary);
    transform: translateY(-2px); /* Mover hacia arriba en lugar de derecha */
}

.footer-bottom {
    text-align: center;
    margin-top: 80px;
    padding-top: 30px;
    border-top: 1px solid rgba(255,255,255,0.05);
    font-size: 0.9rem;
}

/* Keyframes */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive */
@media (max-width: 768px) {
    .hero h1 { font-size: 2.5rem; }
    .newsletter-form { flex-direction: column; }
    .navbar { flex-direction: column; gap: 15px; }
    .nav-links a { margin: 0 10px; }
    .cart-table { display: block; overflow-x: auto; }
}

/* Alerts */
.alert {
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 8px;
    font-weight: 500;
}

.alert.success {
    background-color: #d1fae5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.alert.error {
    background-color: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

/* Forms generic */
.form-group { margin-bottom: 20px; }
.form-group label { display: block; margin-bottom: 8px; font-weight: 500; }
.form-group input, .form-group textarea {
    width: 100%; padding: 12px; border: 1px solid #e2e8f0; border-radius: 8px;
    font-family: inherit; transition: border-color 0.3s;
}
.form-group input:focus { outline: none; border-color: var(--primary); }

/* Toast Notification */
#toast {
    visibility: hidden;
    min-width: 250px;
    background-color: var(--secondary);
    color: #fff;
    text-align: center;
    border-radius: var(--radius);
    padding: 16px;
    position: fixed;
    z-index: 9999; /* Ensure it's on top */
    right: 30px;
    bottom: 30px;
    box-shadow: var(--shadow-lg);
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transform: translateY(20px);
    transition: all 0.5s ease;
    opacity: 0;
}

#toast.show {
    visibility: visible;
    transform: translateY(0);
    opacity: 1;
}

#toast .icon {
    font-size: 1.5rem;
}
