/* 
   AGUA PURIFICADA - MODERN GLOBAL DESIGN
   Philosophy: Clean, premium, dynamic, and accessible.
*/

:root {
    /* Color Palette */
    --primary: #0077b6;
    --primary-dark: #023e8a;
    --primary-light: #48cae4;
    --secondary: #00b4d8;
    --accent: #caf0f8;
    --success: #2ecc71;
    --warning: #f1c40f;
    --danger: #e74c3c;

    /* Neutral Colors */
    --bg-main: #f8fafc;
    --bg-card: #ffffff;
    --text-dark: #1e293b;
    --text-muted: #64748b;
    --border: #e2e8f0;

    /* Effects */
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --glass: rgba(255, 255, 255, 0.8);
    --glass-border: rgba(255, 255, 255, 0.2);

    /* Dimensions & Transitions */
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 1rem;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Base Resets */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-main);
    color: var(--text-dark);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 1rem;
}

a {
    transition: var(--transition);
    text-decoration: none;
    color: inherit;
}

/* Header & Navigation */
.main-header {
    background: var(--glass);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    padding: 16px 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    transition: var(--transition);
}

.main-header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo-text {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--primary);
    letter-spacing: -0.025em;
    text-transform: uppercase;
}

.logo-text span {
    color: var(--secondary);
}

.main-nav ul {
    display: flex;
    list-style: none;
    gap: 32px;
}

.main-nav a {
    font-weight: 600;
    color: var(--text-muted);
    font-size: 0.95rem;
}

.main-nav a:hover,
.main-nav a.active {
    color: var(--primary);
}

/* Buttons */
.btn-cart {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white !important;
    padding: 12px 24px;
    border-radius: var(--radius-lg);
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    box-shadow: var(--shadow-md);
}

.btn-cart:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    filter: brightness(1.1);
}

/* Hero Section */
.hero-section {
    position: relative;
    overflow: hidden;
    color: white;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(rgba(0, 0, 0, 0.6), rgba(0, 0, 0, 0.3));
    z-index: 1;
}

.hero-section .container {
    position: relative;
    z-index: 2;
}

/* Feature Cards */
.feature-card {
    background: var(--bg-card);
    padding: 40px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
    transition: var(--transition);
}

.feature-card:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-light);
}

.feature-card .icon {
    width: 64px;
    height: 64px;
    background: var(--accent);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
    font-size: 32px;
    margin: 0 auto 24px;
}

/* Footer Styles */
.main-footer {
    background: #0f172a;
    color: white;
    padding: 80px 0 0;
    margin-top: 100px;
}

.footer-bottom {
    background: #020617;
    padding: 24px 0;
    text-align: center;
    margin-top: 60px;
    font-size: 0.875rem;
    color: var(--text-muted);
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

[style*="animation: fadeInUp"] {
    animation: fadeInUp 0.8s ease-out forwards;
}

/* Utilities */
.grid-footer {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 32px;
}

/* Base Form Tweaks */
input,
textarea,
select {
    box-sizing: border-box;
}

/* ==============================================================
   RESPONSIVE DESIGN (MOBILE & TABLETS)
   ============================================================== */
@media screen and (max-width: 900px) {

    /* Header Mobile Hamburger UI */
    .main-header .container {
        flex-wrap: wrap;
        padding-top: 15px;
        padding-bottom: 15px;
    }

    .mobile-toggle {
        display: block !important;
    }

    .mobile-menu-wrapper {
        display: none;
        width: 100%;
        flex-direction: column;
        gap: 20px;
        margin-top: 20px;
        padding-top: 20px;
        border-top: 1px solid var(--border);
    }

    .mobile-menu-wrapper.active {
        display: flex;
        animation: fadeInUp 0.3s ease forwards;
    }

    .main-nav ul {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }

    .main-nav a {
        padding: 12px;
        display: block;
        text-align: center;
        background: var(--bg-card);
        border: 1px solid var(--border);
        border-radius: var(--radius-sm);
    }

    .header-actions {
        width: 100%;
        justify-content: center;
    }

    .logo-text {
        font-size: 1.3rem;
    }

    /* Make explicitly styled grids flow into 1 column */
    div[style*="grid-template-columns: 1fr 1fr"],
    div[style*="grid-template-columns:1fr 1fr"],
    .product-layout,
    .trust-indicators {
        grid-template-columns: 1fr !important;
        gap: 30px !important;
    }

    /* Make flex forms and boxes wrap naturally */
    form[style*="display: flex"],
    div[style*="display: flex; gap: 20px"] {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 15px !important;
    }

    /* Product detail specific overrides */
    .product-gallery .main-image {
        height: auto !important;
        min-height: 250px;
        padding: 20px !important;
    }

    .product-content h1 {
        font-size: 2rem !important;
    }

    .product-content .price-box span:first-child {
        font-size: 2rem !important;
    }

    .purchase-actions {
        padding: 20px !important;
    }

    .qty-selector {
        width: 100% !important;
    }

    /* Container padding tweaks */
    .container {
        padding: 0 15px;
    }

    /* Responsive Table support for Cart page */
    .cart-container {
        grid-template-columns: 1fr !important;
    }

    .cart-items table,
    .cart-items thead,
    .cart-items tbody,
    .cart-items th,
    .cart-items td,
    .cart-items tr {
        display: block;
    }

    .cart-items thead tr {
        position: absolute;
        top: -9999px;
        left: -9999px;
    }

    .cart-items tr {
        border-bottom: 2px solid var(--border) !important;
        margin-bottom: 15px;
        padding-bottom: 15px;
    }

    .cart-items td {
        border: none !important;
        position: relative;
        padding-left: 50% !important;
        padding-top: 10px !important;
        padding-bottom: 10px !important;
        text-align: right !important;
    }

    .cart-items td:before {
        position: absolute;
        left: 0;
        width: 45%;
        padding-right: 10px;
        white-space: nowrap;
        font-weight: bold;
        text-align: left;
    }

    /* Table headers mappings */
    .cart-items td:nth-of-type(1):before {
        content: "Producto";
    }

    .cart-items td:nth-of-type(2):before {
        content: "Precio";
    }

    .cart-items td:nth-of-type(3):before {
        content: "Cantidad";
    }

    .cart-items td:nth-of-type(4):before {
        content: "Subtotal";
    }

    .cart-items td:nth-of-type(5):before {
        content: "Quitar";
    }

    .cart-items td:nth-of-type(1) {
        display: flex;
        flex-direction: column;
        align-items: flex-end;
        gap: 5px;
    }

    /* Generic adjustments */
    section[style*="padding: 100px"] {
        padding-top: 50px !important;
        padding-bottom: 50px !important;
    }

    h1,
    h2,
    h3 {
        word-break: break-word;
        /* Prevent long words bleeding off edge */
    }
}