:root {
    --verde-natural: #43A047;
    --blanco: #FFFFFF;
    --azul-confianza: #1D6FD8;
    --azul-marino: #16213E;
    --gris-azulado: #D5DEE8;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* DESLIZAMIENTO SUAVE */
html {
    scroll-behavior: smooth;
    scroll-padding-top: 90px;
}

body {
    background-color: var(--blanco);
    color: var(--azul-marino);
    overflow-x: hidden;
}

/* ANIMACIONES DE ENTRADA AL CARGAR LA PÁGINA */
@keyframes slideDownNav {
    from {
        opacity: 0;
        transform: translateY(-100%);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideUpCard {
    from {
        opacity: 0;
        transform: translateY(40px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInContent {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* NAVBAR VIDRIO ESMERILADO (Con animación) */
.navbar {
    padding: 10px 5%;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    flex-direction: column;
    gap: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.05);
    animation: slideDownNav 0.7s ease-out forwards;
    /* Animación 1 */
}

.navbar::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, var(--azul-confianza), var(--verde-natural));
}

.nav-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    position: relative;
}

.logo {
    max-height: 60px;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.05));
}

.nav-links {
    list-style: none;
    display: flex;
    justify-content: center;
    gap: 20px;
    width: 100%;
    padding-bottom: 5px;
}

.nav-links a {
    text-decoration: none;
    color: var(--azul-marino);
    font-weight: bold;
    transition: color 0.3s;
    font-size: 0.95rem;
}

.nav-links a:hover {
    color: var(--verde-natural);
}

.cart-icon {
    font-size: 1.5rem;
    cursor: pointer;
    position: relative;
    padding-right: 10px;
    transition: transform 0.2s;
}

.cart-icon:hover {
    transform: scale(1.1);
}

.cart-badge {
    background-color: var(--verde-natural);
    color: var(--blanco);
    font-size: 0.75rem;
    font-weight: bold;
    padding: 2px 6px;
    border-radius: 50%;
    position: absolute;
    top: -5px;
    right: 0;
    box-shadow: 0 2px 5px rgba(67, 160, 71, 0.4);
}

/* HERO GLASSMORPHISM */
.hero {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 80px 15px;
    min-height: 85vh;
    background: linear-gradient(rgba(22, 33, 62, 0.4), rgba(22, 33, 62, 0.8)),
        url('https://images.unsplash.com/photo-1534438327276-14e5300c3a48?auto=format&fit=crop&w=1920&q=80') center/cover no-repeat;
    background-attachment: fixed;
    border-bottom: 1px solid var(--gris-azulado);
}

.hero-glass-card {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    padding: 40px 20px;
    max-width: 700px;
    text-align: center;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    opacity: 0;
    /* Inicia oculto para la animación */
    animation: slideUpCard 0.8s ease-out 0.3s forwards;
    /* Animación 2 (con delay) */
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(29, 111, 216, 0.2);
    border: 1px solid var(--azul-confianza);
    color: var(--blanco);
    padding: 6px 15px;
    border-radius: 30px;
    font-size: 0.85rem;
    font-weight: bold;
    margin-bottom: 20px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.pulse-dot {
    width: 8px;
    height: 8px;
    background-color: var(--verde-natural);
    border-radius: 50%;
    box-shadow: 0 0 8px var(--verde-natural);
    animation: pulse 1.5s infinite;
}

.hero h1 {
    color: var(--blanco);
    font-size: 2.2rem;
    margin-bottom: 20px;
    line-height: 1.2;
    text-shadow: 2px 2px 10px rgba(0, 0, 0, 0.5);
}

.hero h1 span {
    background: linear-gradient(90deg, var(--verde-natural), #1D6FD8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    display: inline-block;
}

.hero p {
    color: #E2E8F0;
    font-size: 1rem;
    margin: 0 auto 30px auto;
    line-height: 1.5;
}

.hero-actions {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.btn-hero-primary {
    background: linear-gradient(45deg, var(--azul-confianza), var(--verde-natural));
    background-size: 200% 200%;
    color: var(--blanco);
    padding: 14px 25px;
    border-radius: 30px;
    font-size: 1rem;
    font-weight: bold;
    text-decoration: none;
    text-transform: uppercase;
    box-shadow: 0 10px 20px rgba(67, 160, 71, 0.3);
    transition: all 0.4s ease;
    animation: gradientShift 3s ease infinite;
    width: 100%;
}

.btn-hero-primary:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 15px 25px rgba(29, 111, 216, 0.4);
}

.hero-trust {
    display: flex;
    flex-direction: column;
    gap: 5px;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.8);
    margin-top: 5px;
}

/* GRID PRODUCTOS Y FILTROS */
.products-section {
    padding: 40px 15px;
    min-height: 50vh;
    opacity: 0;
    /* Inicia oculto para la animación */
    animation: fadeInContent 0.8s ease-out 0.6s forwards;
    /* Animación 3 (última en aparecer) */
}

.section-title {
    text-align: center;
    margin-bottom: 25px;
    color: var(--azul-confianza);
    font-size: 1.8rem;
}

.filtros-container {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.btn-filtro {
    background-color: var(--blanco);
    color: var(--azul-marino);
    border: 2px solid var(--gris-azulado);
    padding: 6px 15px;
    border-radius: 20px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s;
    font-size: 0.9rem;
}

.btn-filtro.activo {
    background-color: var(--azul-confianza);
    color: var(--blanco);
    border-color: var(--azul-confianza);
}

.product-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
}

.product-card {
    border: 1px solid var(--gris-azulado);
    border-radius: 10px;
    padding: 15px;
    text-align: center;
    background: var(--blanco);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.product-card img {
    max-width: 100%;
    height: 180px;
    object-fit: contain;
    margin-bottom: 10px;
}

.product-card h3 {
    font-size: 1.1rem;
    margin-bottom: 5px;
}

.product-price {
    color: var(--verde-natural);
    font-size: 1.4rem;
    font-weight: bold;
    margin: 10px 0;
}

/* BOTONES Y FORMULARIOS */
.btn-primary {
    background-color: var(--verde-natural);
    color: var(--blanco);
    border: none;
    padding: 12px 20px;
    font-weight: bold;
    cursor: pointer;
    text-decoration: none;
    width: 100%;
    font-size: 1rem;
    transition: background-color 0.3s;
}

.btn-primary:hover {
    background-color: #358039;
}

.form-input {
    width: 100%;
    padding: 10px;
    margin-bottom: 10px;
    border: 1px solid var(--gris-azulado);
    border-radius: 5px;
    font-size: 0.95rem;
}

/* CARRITO LATERAL Y FLOTANTE */
.cart-float {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background-color: var(--azul-marino);
    color: white;
    width: 55px;
    height: 55px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.3rem;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    z-index: 99;
    transition: transform 0.2s;
}

.cart-float:hover {
    transform: scale(1.1);
}

.cart-sidebar {
    position: fixed;
    top: 0;
    right: -100%;
    width: 100%;
    height: 100vh;
    background-color: var(--blanco);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    transition: right 0.3s ease;
}

.cart-sidebar.open {
    right: 0;
}

.cart-header {
    padding: 15px 20px;
    background-color: var(--azul-marino);
    color: var(--blanco);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.close-btn {
    background: none;
    border: none;
    color: var(--blanco);
    font-size: 1.5rem;
    transition: transform 0.2s;
    cursor: pointer;
}

.close-btn:hover {
    transform: rotate(90deg);
}

.cart-items {
    flex-grow: 1;
    overflow-y: auto;
    padding: 15px;
}

.cart-footer {
    padding: 15px;
    background-color: #f8fbff;
    border-top: 1px solid var(--gris-azulado);
}

.cart-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--gris-azulado);
}

.cart-item img {
    width: 50px;
    height: 50px;
    object-fit: contain;
}

.cart-item-info {
    flex-grow: 1;
    margin-left: 10px;
}

.cart-item-info h4 {
    font-size: 0.9rem;
    margin-bottom: 2px;
}

.btn-borrar {
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    color: red;
    transition: transform 0.2s;
}

.btn-borrar:hover {
    transform: scale(1.2);
}

.cart-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: rgba(0, 0, 0, 0.6);
    z-index: 999;
    display: none;
    opacity: 0;
    transition: opacity 0.3s;
}

.cart-overlay.open {
    display: block;
    opacity: 1;
}

/* PANEL ADMIN */
.admin-container {
    max-width: 450px;
    margin: 50px auto;
    background: var(--blanco);
    padding: 40px;
    border-radius: 10px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.admin-form,
.admin-list {
    margin-top: 20px;
    border-top: 1px solid var(--gris-azulado);
    padding-top: 20px;
}

footer {
    text-align: center;
    padding: 30px 15px;
    background-color: var(--azul-marino);
    color: var(--blanco);
}

/* ANIMACIONES EXTRAS */
@keyframes pulse {
    0% {
        transform: scale(0.95);
        opacity: 0.5;
    }

    50% {
        transform: scale(1.2);
        opacity: 1;
    }

    100% {
        transform: scale(0.95);
        opacity: 0.5;
    }
}

@keyframes gradientShift {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

/* MEDIA QUERIES (PC y Tablets) */
@media (min-width: 768px) {
    .navbar {
        flex-direction: row;
        padding: 10px 5%;
        align-items: center;
    }

    .nav-top {
        width: auto;
        flex-grow: 1;
    }

    .nav-links {
        width: auto;
        justify-content: flex-end;
        padding-bottom: 0;
        margin-right: 20px;
        margin-top: 0;
    }

    .logo {
        max-height: 70px;
    }

    .hero {
        min-height: 90vh;
    }

    .hero h1 {
        font-size: 4rem;
    }

    .hero p {
        font-size: 1.25rem;
    }

    .hero-glass-card {
        padding: 60px 50px;
    }

    .hero-badge {
        font-size: 1rem;
        padding: 8px 20px;
    }

    .hero-trust {
        flex-direction: row;
        gap: 25px;
    }

    .btn-hero-primary {
        font-size: 1.2rem;
        padding: 18px 45px;
        width: auto;
    }

    .products-section {
        padding: 60px 5%;
    }

    .section-title {
        font-size: 2.2rem;
    }

    .product-grid {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
        gap: 30px;
    }

    .product-card img {
        height: 220px;
    }

    .cart-float {
        bottom: 30px;
        right: 30px;
        width: 65px;
        height: 65px;
        font-size: 1.5rem;
        transition: transform 0.2s;
    }

    .cart-float:hover {
        transform: scale(1.1);
    }

    .cart-sidebar {
        width: 400px;
        right: -400px;
        box-shadow: -5px 0 15px rgba(0, 0, 0, 0.2);
    }
}