@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,400..900;1,400..900&family=Plus+Jakarta+Sans:ital,wght@0,200..800;1,200..800&display=swap');

/* Storefront Design System - JuanpaWeb.com (Botánico Editorial) */
:root {
    --color-primary: #2d5a27;    /* Verde Bosque Profundo */
    --color-secondary: #c96f53;  /* Terracotta Cálida */
    --color-accent: #e2a85c;     /* Mostaza / Oro Apagado */
    
    /* Mapeo de variables para retrocompatibilidad */
    --bg-dark: #fbfaf7;          /* Fondo beige claro */
    --surface: #f5f3ed;          /* Arena suave para tarjetas */
    --surface-elevated: #ffffff; /* Blanco puro para elevar elementos */
    
    --border: rgba(45, 90, 39, 0.08); /* Borde sutil verdoso */
    --text-main: #1c2826;        /* Carbón Orgánico */
    --text-muted: #6b7774;       /* Verde Grisáceo Muted */
    
    /* Glassmorphism en Claro */
    --glass: rgba(255, 255, 255, 0.7);
    --glass-border: rgba(45, 90, 39, 0.05);
    
    --shadow-soft: 0 8px 30px rgba(28, 40, 38, 0.04);
    --shadow-medium: 0 12px 40px rgba(28, 40, 38, 0.08);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    font-family: 'Plus Jakarta Sans', sans-serif;
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, .brand-font {
    font-family: 'Playfair Display', serif;
    font-weight: 700;
    color: var(--text-main);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* Glassmorphism */
.glass-card {
    background: var(--glass);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    box-shadow: var(--shadow-soft);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.glass-card:hover {
    background: rgba(255, 255, 255, 0.95);
    border-color: rgba(45, 90, 39, 0.15);
    transform: translateY(-5px);
    box-shadow: var(--shadow-medium);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.8rem 1.6rem;
    border-radius: 14px;
    font-weight: 600;
    font-family: 'Plus Jakarta Sans', sans-serif;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
    border: none;
}

.btn-primary {
    background: var(--color-primary);
    color: #ffffff;
    box-shadow: 0 4px 14px rgba(45, 90, 39, 0.2);
}

.btn-primary:hover {
    background: #23471e;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(45, 90, 39, 0.3);
}

.btn-secondary {
    background: var(--color-secondary);
    color: #ffffff;
    box-shadow: 0 4px 14px rgba(201, 111, 83, 0.2);
}

.btn-secondary:hover {
    background: #b2583e;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(201, 111, 83, 0.3);
}

.btn-outline {
    background: transparent;
    border: 1.5px solid var(--color-primary);
    color: var(--color-primary);
}

.btn-outline:hover {
    background: rgba(45, 90, 39, 0.05);
    transform: translateY(-2px);
}

/* Navbar */
.navbar {
    height: 80px;
    display: flex;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(251, 250, 247, 0.8);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    transition: all 0.3s;
}

.nav-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.logo {
    font-size: 1.6rem;
    font-family: 'Playfair Display', serif;
    font-weight: 800;
    color: var(--color-primary);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 2rem;
    list-style: none;
}

.nav-links a {
    color: var(--text-main);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    position: relative;
    padding: 0.25rem 0;
    transition: color 0.2s;
}

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

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--color-secondary);
    transition: width 0.3s ease;
}

.nav-links a:hover::after {
    width: 100%;
}

.nav-content > div a {
    color: var(--text-main) !important;
    text-decoration: none;
    transition: color 0.2s;
}

.nav-content > div a:hover {
    color: var(--color-secondary) !important;
}

.nav-content > div a.active {
    color: var(--color-primary) !important;
    font-weight: 700;
}

/* Icons */
.nav-actions {
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

.nav-btn {
    background: transparent;
    border: none;
    color: var(--text-main);
    font-size: 1.35rem;
    cursor: pointer;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem;
    border-radius: 50%;
    transition: all 0.2s;
}

.nav-btn:hover {
    background: var(--surface);
    color: var(--color-primary);
}

.badge-count {
    position: absolute;
    top: -2px;
    right: -2px;
    background: var(--color-secondary);
    color: white;
    font-size: 0.7rem;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
}

/* Product Card */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2rem;
}

.product-card {
    background: var(--surface-elevated);
    border: 1px solid var(--border);
    border-radius: 24px;
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    height: 100%;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-soft);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.product-card:hover {
    transform: translateY(-6px);
    border-color: rgba(45, 90, 39, 0.15);
    box-shadow: var(--shadow-medium);
}

.product-img-wrapper {
    position: relative;
    width: 100%;
    aspect-ratio: 1;
    border-radius: 16px;
    overflow: hidden;
    margin-bottom: 1.25rem;
    background: var(--surface);
}

.product-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

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

.product-title {
    font-size: 1.2rem;
    font-family: 'Playfair Display', serif;
    margin-bottom: 0.5rem;
    color: var(--text-main);
    text-decoration: none;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    height: 3.2rem;
}

.product-title:hover {
    color: var(--color-primary);
}

.product-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
    padding-top: 1rem;
    border-top: 1px solid rgba(45, 90, 39, 0.05);
}

.product-price {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--color-primary);
    font-family: 'Plus Jakarta Sans', sans-serif;
}

.product-price-old {
    font-size: 0.95rem;
    text-decoration: line-through;
    color: var(--text-muted);
    margin-right: 0.5rem;
}

.badge-stock {
    position: absolute;
    top: 1.25rem;
    right: 1.25rem;
    background: var(--glass);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: var(--color-primary);
    padding: 0.35rem 0.75rem;
    border-radius: 30px;
    font-size: 0.75rem;
    font-weight: 700;
    box-shadow: 0 4px 10px rgba(0,0,0,0.02);
}

.badge-stock.preorder {
    color: var(--color-secondary);
    border-color: rgba(201, 111, 83, 0.3);
}

/* Card Button Overlay / Quick Actions */
.product-actions-hover {
    position: absolute;
    bottom: -60px;
    left: 0;
    right: 0;
    background: linear-gradient(180deg, rgba(255,255,255,0) 0%, rgba(251,250,247,0.95) 40%);
    padding: 1.25rem 1rem 1rem 1rem;
    display: flex;
    gap: 0.5rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 0;
}

.product-card:hover .product-actions-hover {
    bottom: 0;
    opacity: 1;
}

/* Utility */
.text-gradient {
    background: linear-gradient(45deg, var(--color-primary), var(--color-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.toast {
    background: rgba(255, 255, 255, 0.75);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.55);
    color: var(--text-main);
    padding: 1rem 1.5rem;
    border-radius: 16px;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    box-shadow: 0 10px 30px rgba(28, 40, 38, 0.06);
    animation: slideIn 0.3s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

.toast.fade-out {
    animation: fadeOut 0.3s ease-in forwards;
}

@keyframes fadeOut {
    from { transform: translateX(0); opacity: 1; }
    to { transform: translateX(100%); opacity: 0; }
}

/* Page Builder Blocks & Layouts */
.page-block-section {
    padding: 6rem 0;
    position: relative;
}

.section-title-wrap {
    text-align: center;
    margin-bottom: 3.5rem;
}

.section-title-wrap h2 {
    font-size: 2.5rem;
    margin-bottom: 0.75rem;
}

.section-title-wrap p {
    color: var(--text-muted);
    font-size: 1.1rem;
    max-width: 600px;
    margin: 0 auto;
}

/* USP Grid */
.usp-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.usp-card {
    padding: 2.5rem 2rem;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.25rem;
    border-radius: 24px;
    background: var(--surface-elevated);
    border: 1px solid var(--border);
    transition: all 0.3s ease;
}

.usp-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-soft);
    border-color: rgba(45, 90, 39, 0.12);
}

.usp-icon-wrapper {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: rgba(45, 90, 39, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-primary);
    font-size: 1.6rem;
    transition: all 0.3s ease;
}

.usp-card:hover .usp-icon-wrapper {
    background: var(--color-primary);
    color: white;
    transform: scale(1.08);
}

.usp-card h3 {
    font-size: 1.3rem;
    font-family: 'Playfair Display', serif;
}

.usp-card p {
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.5;
}

/* Promotional Banner */
.banner-promo {
    position: relative;
    border-radius: 36px;
    overflow: hidden;
    min-height: 400px;
    display: flex;
    align-items: center;
    padding: 4rem;
    background-size: cover;
    background-position: center;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-medium);
}

.banner-promo::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: linear-gradient(90deg, rgba(251, 250, 247, 0.98) 0%, rgba(251, 250, 247, 0.8) 50%, rgba(251, 250, 247, 0.1) 100%);
    z-index: 1;
}

.banner-promo-content {
    position: relative;
    z-index: 2;
    max-width: 500px;
}

.banner-promo h2 {
    font-size: 3rem;
    line-height: 1.15;
    margin-bottom: 1rem;
    color: var(--text-main);
}

.banner-promo p {
    color: var(--text-muted);
    margin-bottom: 2.25rem;
    font-size: 1.15rem;
}

@media (max-width: 768px) {
    .banner-promo {
        padding: 3rem 1.5rem;
        min-height: 320px;
    }
    .banner-promo::before {
        background: rgba(251, 250, 247, 0.9);
    }
    .banner-promo h2 {
        font-size: 2rem;
    }
}

/* Organic Footer */
.footer {
    background: var(--color-primary);
    color: #ffffff;
    padding: 5rem 0 2rem 0;
    margin-top: 6rem;
    border-top: 1px solid rgba(255,255,255,0.05);
}

.footer h1, .footer h2, .footer h3, .footer h4 {
    color: #ffffff;
}

.footer-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr 1.5fr;
    gap: 3rem;
    margin-bottom: 4rem;
}

.footer-col {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.footer-logo {
    font-size: 1.8rem;
    font-family: 'Playfair Display', serif;
    font-weight: 800;
    color: #ffffff;
    text-decoration: none;
}

.footer-about-text {
    color: rgba(255, 255, 255, 0.75);
    font-size: 0.95rem;
    line-height: 1.6;
}

.footer-socials {
    display: flex;
    gap: 1rem;
    margin-top: 0.5rem;
}

.footer-social-link {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-size: 1.1rem;
    text-decoration: none;
    transition: all 0.25s ease;
    border: 1px solid rgba(255,255,255,0.05);
}

.footer-social-link:hover {
    background: var(--color-secondary);
    color: #ffffff;
    transform: translateY(-3px);
}

.footer-col-title {
    font-size: 1.2rem;
    font-family: 'Playfair Display', serif;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.footer-links {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.footer-links a {
    color: rgba(255, 255, 255, 0.75);
    text-decoration: none;
    font-size: 0.95rem;
    transition: all 0.2s;
    display: inline-block;
}

.footer-links a:hover {
    color: var(--color-accent);
    transform: translateX(4px);
}

/* Newsletter */
.footer-newsletter-text {
    color: rgba(255, 255, 255, 0.75);
    font-size: 0.95rem;
    line-height: 1.5;
}

.newsletter-form {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.newsletter-input {
    flex: 1;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    padding: 0.75rem 1rem;
    border-radius: 12px;
    color: #ffffff;
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 0.9rem;
    outline: none;
    transition: all 0.2s;
}

.newsletter-input::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

.newsletter-input:focus {
    border-color: var(--color-secondary);
    background: rgba(255, 255, 255, 0.12);
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1.5rem;
}

.footer-copyright {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.85rem;
}

.footer-payments {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.footer-payments img {
    max-height: 22px;
    width: auto;
    object-fit: contain;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    vertical-align: middle;
}

.footer-payments img:hover {
    transform: scale(1.08);
}

.footer-payment-logo {
    filter: none !important;
    opacity: 1 !important;
}

@media (max-width: 992px) {
    .footer-grid {
        grid-template-columns: 1fr 1fr;
        gap: 2.5rem;
    }
}

@media (max-width: 576px) {
    .footer-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    .footer-bottom {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* Detail Split Layout 50/50 */
.detail-layout-50-50 {
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: 3.5rem;
    align-items: start;
    margin-top: 2.5rem;
}

.detail-left {
    position: sticky;
    top: 100px;
}

.detail-right {
    display: flex;
    flex-direction: column;
    gap: 1.75rem;
}

@media (max-width: 992px) {
    .detail-layout-50-50 {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    .detail-left {
        position: static;
    }
}

/* Form inputs storefront */
.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1.25rem;
}

.form-group label {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-main);
}

.form-control {
    width: 100%;
    padding: 0.8rem 1rem;
    background: var(--surface-elevated);
    border: 1.5px solid var(--border);
    border-radius: 12px;
    color: var(--text-main);
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 0.95rem;
    outline: none;
    transition: all 0.25s ease;
}

.form-control:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(45, 90, 39, 0.15);
}

.form-control::placeholder {
    color: var(--text-muted);
    opacity: 0.7;
}

.mobile-nav-drawer,
.mobile-menu-overlay {
    display: none;
}

@media (max-width: 768px) {
    /* Hide brand name text next to logo */
    .logo #brand-name {
        display: none !important;
    }
    
    /* Adjust header items spacing */
    .nav-content > div {
        gap: 1rem !important;
    }
    
    /* Hide standard menu links on mobile to prevent horizontal scrolling */
    .nav-content > div > a:not(#user-menu-link):not([href*="cart.html"]) {
        display: none !important;
    }
    
    /* Hamburger Button styles */
    .mobile-menu-toggle {
        display: flex !important;
        align-items: center;
        justify-content: center;
        background: transparent;
        border: none;
        color: var(--text-main);
        cursor: pointer;
        padding: 0.5rem;
        z-index: 1001;
        outline: none;
    }
    
    /* Mobile Nav Drawer */
    .mobile-nav-drawer {
        position: fixed;
        top: 0;
        right: -280px;
        width: 280px;
        height: 100vh;
        background: var(--surface-elevated);
        box-shadow: var(--shadow-medium);
        z-index: 1000;
        padding: 6rem 2rem 2rem;
        display: flex;
        flex-direction: column;
        gap: 1.5rem;
        transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }
    
    .mobile-nav-drawer.open {
        right: 0;
    }
    
    .mobile-nav-drawer a {
        font-size: 1.15rem;
        font-weight: 600;
        color: var(--text-main);
        text-decoration: none;
        padding: 0.75rem 0;
        border-bottom: 1px solid var(--border);
        display: flex;
        align-items: center;
        gap: 0.5rem;
    }
    
    .mobile-nav-drawer a.active {
        color: var(--color-primary);
    }
    
    .mobile-menu-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100vw;
        height: 100vh;
        background: rgba(0, 0, 0, 0.3);
        backdrop-filter: blur(4px);
        z-index: 999;
        display: none;
    }
    
    .mobile-menu-overlay.show {
        display: block;
    }
}

/* Spinner logic for loading states */
.spin {
    animation: spin 1s linear infinite;
    display: inline-block;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Hero Section & Glassmorphism Card */
.hero {
    position: relative;
    padding: 8rem 0;
    text-align: center;
    background: radial-gradient(circle at top right, rgba(77, 155, 111, 0.1), transparent);
    background-size: cover;
    background-position: center;
}

.hero-card {
    background: rgba(251, 250, 247, 0.45);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(45, 90, 39, 0.08);
    border-radius: 32px;
    padding: 4rem 3rem;
    max-width: 800px;
    margin: 0 auto;
    box-shadow: var(--shadow-medium);
    display: flex;
    flex-direction: column;
    align-items: center;
}

.hero-card h1 {
    font-size: 4rem;
    margin-bottom: 1.5rem;
    line-height: 1.1;
    filter: drop-shadow(0 2px 8px rgba(45, 90, 39, 0.12));
}

.hero-card p {
    font-size: 1.25rem;
    color: var(--text-main);
    max-width: 600px;
    margin: 0 auto 2.5rem;
    font-weight: 500;
}

@media (max-width: 768px) {
    .hero {
        padding: 5rem 0;
    }
    .hero-card {
        padding: 2.5rem 1.5rem;
        border-radius: 24px;
    }
    .hero-card h1 {
        font-size: 2.5rem;
    }
    .hero-card p {
        font-size: 1.1rem;
        margin-bottom: 2rem;
    }
}


