@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,300..700;1,9..40,300..700&family=Outfit:wght@400;500;600;700&display=swap');

:root {
    --bg: #f4f7fb;
    --surface: #ffffff;
    --text: #0f172a;
    --text-muted: #64748b;
    --accent: #0ea5e9;
    --accent-hover: #0284c7;
    --accent-light: #e0f2fe;
    --border: #e2e8f0;
    --danger: #dc2626;
    --danger-hover: #b91c1c;
    --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.06), 0 1px 2px rgba(15, 23, 42, 0.04);
    --shadow-md: 0 4px 12px rgba(15, 23, 42, 0.08), 0 2px 4px rgba(15, 23, 42, 0.04);
    --shadow-lg: 0 12px 32px rgba(15, 23, 42, 0.1), 0 4px 8px rgba(15, 23, 42, 0.04);
    --radius: 12px;
    --radius-pill: 999px;
    --header-height: 4rem;
    --font-body: 'DM Sans', sans-serif;
    --font-heading: 'Outfit', sans-serif;
    --product-image-bg: #f0f9ff;
}

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

body {
    font-family: var(--font-body);
    background-color: var(--bg);
    color: var(--text);
    line-height: 1.5;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 600;
}

ul {
    list-style-type: none;
}

a {
    text-decoration: none;
    color: inherit;
}

button {
    font-family: var(--font-body);
    cursor: pointer;
}

.disabled {
    display: none;
}

/* ── Header ── */

.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background-color: var(--surface);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
}

.header-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
    height: var(--header-height);
    display: flex;
    align-items: center;
    gap: 2rem;
}

.brand {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text);
    white-space: nowrap;
    flex-shrink: 0;
}

.brand:hover {
    color: var(--accent);
}

.brand-accent {
    color: var(--accent);
}

.nav-desktop {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    flex: 1;
}

.btn-nav {
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-size: 0.875rem;
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-pill);
    transition: color 0.2s, background-color 0.2s;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.btn-nav:hover {
    color: var(--text);
    background-color: var(--bg);
}

.btn-nav.active,
.btn-category.active {
    background-color: var(--accent);
    color: var(--surface);
}

.btn-nav.active:hover,
.btn-category.active:hover {
    background-color: var(--accent-hover);
    color: var(--surface);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-left: auto;
}

.nav-cart {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-muted);
    padding: 0.5rem 1rem;
    border-radius: var(--radius-pill);
    transition: color 0.2s, background-color 0.2s;
}

.nav-cart:hover {
    color: var(--text);
    background-color: var(--bg);
}

.nav-cart.active {
    color: var(--accent);
    background-color: var(--accent-light);
}

.number-items {
    background-color: var(--accent);
    color: var(--surface);
    font-size: 0.7rem;
    font-weight: 600;
    padding: 0.1rem 0.45rem;
    border-radius: var(--radius-pill);
    min-width: 1.25rem;
    text-align: center;
}

.nav-toggle {
    display: none;
    border: none;
    background: transparent;
    color: var(--text);
    font-size: 1.5rem;
    padding: 0.25rem;
    line-height: 1;
}

.nav-mobile {
    display: none;
    flex-direction: column;
    gap: 0.25rem;
    padding: 0.75rem 1.5rem 1.25rem;
    border-top: 1px solid var(--border);
    background-color: var(--surface);
    position: relative;
}

.nav-mobile.open {
    display: flex;
}

.nav-mobile-close {
    align-self: flex-end;
    margin-bottom: 0.25rem;
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-size: 1.4rem;
    line-height: 1;
    padding: 0.25rem;
    cursor: pointer;
}

.nav-mobile .btn-nav {
    width: 100%;
    justify-content: flex-start;
    padding: 0.75rem 1rem;
}

/* ── Page layout ── */

.page {
    flex: 1;
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    padding: 2rem 1.5rem 3rem;
}

/* ── Hero ── */

.hero {
    position: relative;
    text-align: center;
    padding: 3rem 1rem 3.5rem;
    margin: -2rem -1.5rem 2rem;
    background: linear-gradient(180deg, var(--accent-light) 0%, var(--bg) 100%);
    border-bottom: 1px solid var(--border);
}

.hero::after {
    content: "";
    position: absolute;
    bottom: -1px;
    left: 0;
    right: 0;
    height: 24px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1200 24' preserveAspectRatio='none'%3E%3Cpath fill='%23f4f7fb' d='M0 12 Q150 0 300 12 T600 12 T900 12 T1200 12 V24 H0 Z'/%3E%3C/svg%3E") center bottom / 100% 100% no-repeat;
}

.hero-title {
    font-size: clamp(2rem, 5vw, 2.75rem);
    font-weight: 700;
    color: var(--text);
    letter-spacing: -0.02em;
    margin-bottom: 0.5rem;
}

.hero-subtitle {
    font-size: 1.1rem;
    color: var(--text-muted);
    font-weight: 400;
}

/* ── Catalog ── */

.catalog {
    margin-bottom: 2rem;
}

.catalog-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.main-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 0;
    letter-spacing: -0.01em;
}

.catalog-sort {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: var(--text-muted);
}

.catalog-sort-select {
    border: 1px solid var(--border);
    background-color: var(--surface);
    color: var(--text);
    border-radius: var(--radius);
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    font-family: inherit;
    cursor: pointer;
}

.catalog-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.catalog-view-toggle {
    display: none;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    background-color: var(--surface);
}

.view-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background-color: transparent;
    color: var(--text-muted);
    padding: 0.5rem 0.65rem;
    cursor: pointer;
    transition: background-color 0.2s, color 0.2s;
}

.view-btn + .view-btn {
    border-left: 1px solid var(--border);
}

.view-btn[aria-pressed="true"] {
    background-color: var(--accent);
    color: var(--surface);
}

.products-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 1.5rem;
}

/* ── Product cards ── */

.product {
    background-color: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

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

.product-image-container {
    position: relative;
    aspect-ratio: 1 / 1;
    background-color: var(--product-image-bg);
    padding: 1.25rem;
    overflow: hidden;
}

.product-image-container.image-error::before {
    content: '\F4C8';
    font-family: 'bootstrap-icons';
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    color: var(--accent);
    opacity: 0.5;
}

.product-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.product-image.image-error {
    opacity: 0;
}

.product-category {
    position: absolute;
    top: 0.75rem;
    left: 0.75rem;
    background-color: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(4px);
    color: var(--text-muted);
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 0.25rem 0.6rem;
    border-radius: var(--radius-pill);
}

.product-discount-badge {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    background-color: var(--danger);
    color: var(--surface);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    padding: 0.3rem 0.55rem;
    border-radius: var(--radius-pill);
    box-shadow: var(--shadow-sm);
}

.product-details {
    padding: 1rem 1.1rem 1.1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    flex: 1;
}

.product-title {
    font-family: var(--font-heading);
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text);
    line-height: 1.3;
}

.product-pricing,
.cart-pricing {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.product-price-original,
.cart-price-original {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-muted);
    text-decoration: line-through;
}

.product-price {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--accent);
}

.product-coming-soon {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-muted);
}

.product-price--sale,
.cart-price--sale {
    color: var(--danger);
}

.cart-price {
    font-weight: 600;
    margin-top: 0.15rem;
}

.product-add {
    margin-top: auto;
    border: none;
    background-color: var(--accent);
    color: var(--surface);
    padding: 0.6rem 1rem;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    border-radius: var(--radius-pill);
    transition: background-color 0.2s;
    width: 100%;
}

.product-add:hover {
    background-color: var(--accent-hover);
}

.product-add:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.product-add:disabled:hover {
    background-color: var(--accent);
}

/* ── Cart ── */

.cart-section {
    max-width: 900px;
}

.cart-container {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.empty-cart,
.purchased-cart {
    text-align: center;
    padding: 3rem 1.5rem;
    background-color: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    color: var(--text-muted);
}

.empty-cart-icon,
.purchased-cart-icon {
    font-size: 2.5rem;
    display: block;
    margin-bottom: 0.75rem;
    color: var(--accent);
}

.purchased-cart-icon {
    color: #16a34a;
}

.empty-cart p,
.purchased-cart p {
    font-size: 1rem;
}

.products-cart {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.product-cart {
    display: flex;
    align-items: center;
    gap: 1rem;
    background-color: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    padding: 0.75rem 1rem;
    color: var(--text);
}

.cart-image-container {
    width: 5rem;
    height: 5rem;
    flex-shrink: 0;
    background-color: var(--product-image-bg);
    border-radius: 8px;
    padding: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.image-product-cart {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.product-cart small {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
    font-weight: 600;
}

.cart-product-title,
.cart-product-quantity,
.cart-product-price,
.cart-product-subtotal {
    flex: 1;
    text-align: center;
}

.cart-product-title {
    flex: 2;
    text-align: left;
}

.cart-product-title h3 {
    font-size: 0.9rem;
    font-weight: 600;
    margin-top: 0.15rem;
}

.cart-product-quantity p,
.cart-product-price p,
.cart-product-subtotal p {
    font-weight: 600;
    margin-top: 0.15rem;
}

.cart-product-price .cart-pricing {
    margin-top: 0.15rem;
}

.cart-product-price .cart-price-original {
    margin-top: 0;
    font-weight: 500;
}

.delete-product-cart {
    border: none;
    background-color: transparent;
    color: var(--danger);
    cursor: pointer;
    flex-shrink: 0;
    font-size: 1.1rem;
    padding: 0.4rem;
    border-radius: 8px;
    transition: background-color 0.2s, color 0.2s;
}

.delete-product-cart:hover {
    background-color: #fef2f2;
    color: var(--danger-hover);
}

.actions-cart {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding-top: 0.5rem;
}

.products-cart.disabled,
.actions-cart.disabled,
.empty-cart.disabled {
    display: none;
}

.empty-actions-cart {
    border: 1.5px solid var(--border);
    background-color: transparent;
    padding: 0.75rem 1.25rem;
    border-radius: var(--radius-pill);
    color: var(--text-muted);
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    transition: border-color 0.2s, color 0.2s;
}

.empty-actions-cart:hover {
    border-color: var(--danger);
    color: var(--danger);
}

.right-actions-cart {
    display: flex;
    align-items: stretch;
    gap: 0;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.total-actions-cart {
    display: flex;
    align-items: center;
    background-color: var(--surface);
    border-right: 1px solid var(--border);
    padding: 0.75rem 1.5rem;
    gap: 0.75rem;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
}

.total-actions-cart p:last-child {
    color: var(--accent);
    font-size: 1rem;
}

.btn-whatsapp {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    border: none;
    border-radius: var(--radius-pill);
    background-color: #25D366;
    padding: 0.75rem 1.5rem;
    color: var(--surface);
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    cursor: pointer;
    transition: background-color 0.2s;
}

.btn-whatsapp:hover {
    background-color: #1da851;
}

.whatsapp-actions-cart {
    display: flex;
    border-radius: 0;
    padding: 0.75rem 1.5rem;
}

/* ── Help CTA ── */

.help-cta {
    text-align: center;
    padding: 2.5rem 1.5rem;
    margin-bottom: 2rem;
    background: linear-gradient(180deg, var(--accent-light) 0%, var(--surface) 100%);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}

.help-cta-icon {
    font-size: 2rem;
    display: block;
    margin-bottom: 0.75rem;
    color: var(--accent);
}

.help-cta-title {
    font-family: var(--font-heading);
    font-size: clamp(1.25rem, 3vw, 1.5rem);
    font-weight: 600;
    color: var(--text);
    margin-bottom: 0.5rem;
}

.help-cta-text {
    font-size: 0.95rem;
    color: var(--text-muted);
    max-width: 32rem;
    margin: 0 auto 1.25rem;
    line-height: 1.5;
}

.help-cta-cart {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 1rem;
    padding: 1.25rem 1.5rem;
    margin-bottom: 0;
    margin-top: 0.5rem;
    background: var(--surface);
}

.help-cta-cart .help-cta-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 2.75rem;
    height: 2.75rem;
    margin-bottom: 0;
    font-size: 1.25rem;
    border-radius: 50%;
    background-color: var(--accent-light);
}

.help-cta-cart .help-cta-body {
    flex: 1;
    min-width: 0;
}

.help-cta-cart .help-cta-title {
    font-size: 1rem;
    margin-bottom: 0.25rem;
}

.help-cta-cart .help-cta-text {
    font-size: 0.85rem;
    max-width: none;
    margin: 0;
    line-height: 1.45;
}

@media screen and (min-width: 640px) {
    .help-cta-cart {
        flex-direction: row;
        text-align: left;
        align-items: center;
    }

    .help-cta-cart .help-cta-whatsapp {
        flex-shrink: 0;
        width: auto;
    }
}

/* ── Footer ── */

.site-footer {
    border-top: 1px solid var(--border);
    background-color: var(--surface);
    padding: 1.75rem 1.5rem;
    text-align: center;
}

.footer-brand {
    font-family: var(--font-heading);
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text);
    letter-spacing: -0.01em;
    margin-bottom: 0.25rem;
}

.footer-tagline {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.footer-social {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.footer-social-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    color: var(--text-muted);
    font-size: 1.25rem;
    transition: color 0.2s;
}

.footer-social-link:hover {
    color: var(--accent);
}

.footer-copy {
    font-size: 0.7rem;
    color: var(--text-muted);
    letter-spacing: 0.02em;
    opacity: 0.85;
}

/* ── Notifications ── */

.toast-aquatic {
    font-family: var(--font-body) !important;
    text-transform: none !important;
}

.swal-aquatic-popup {
    border-radius: var(--radius) !important;
    font-family: var(--font-body) !important;
    box-shadow: var(--shadow-lg) !important;
}

.swal-aquatic-confirm,
.swal-aquatic-cancel {
    border-radius: var(--radius-pill) !important;
    font-family: var(--font-body) !important;
    font-weight: 500 !important;
    font-size: 0.875rem !important;
    padding: 0.5rem 1.25rem !important;
}

/* ── Responsive ── */

@media screen and (max-width: 768px) {
    .nav-desktop {
        display: none;
    }

    .catalog-view-toggle {
        display: flex;
    }

    .nav-toggle {
        display: block;
    }

    .header-inner {
        gap: 1rem;
        padding: 0 1rem;
    }

    .nav-mobile {
        padding: 0.75rem 1rem 1.25rem;
    }

    .site-footer {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    .page {
        padding: 1.5rem 1rem 2.5rem;
    }

    .hero {
        padding: 2rem 0.5rem 2.5rem;
        margin: -1.5rem -1rem 1.5rem;
    }

    .product-cart {
        display: grid;
        grid-template-columns: auto 1fr 1fr auto;
        column-gap: 1rem;
        row-gap: 0.75rem;
        align-items: center;
    }

    .cart-image-container {
        grid-row: 1 / span 2;
        grid-column: 1;
    }

    .cart-product-title {
        grid-row: 1;
        grid-column: 2 / 4;
        text-align: left;
    }

    .delete-product-cart {
        grid-row: 1;
        grid-column: 4;
    }

    .cart-product-quantity {
        grid-row: 2;
        grid-column: 2;
    }

    .cart-product-price {
        grid-row: 2;
        grid-column: 3;
    }

    .cart-product-quantity,
    .cart-product-price {
        text-align: left;
    }

    .cart-product-subtotal {
        display: none;
    }

    .actions-cart {
        flex-direction: column;
        align-items: stretch;
    }

    .right-actions-cart {
        width: 100%;
    }

    .total-actions-cart {
        flex: 1;
        justify-content: center;
    }

    .whatsapp-actions-cart {
        flex: 1;
    }

    .help-cta-whatsapp {
        width: 100%;
    }
}

@media screen and (max-width: 480px) {
    .products-container {
        grid-template-columns: 1fr;
    }

    .products-container--compact {
        grid-template-columns: 1fr 1fr;
        gap: 0.75rem;
    }

    .products-container--compact .product-image-container {
        padding: 0.75rem;
    }

    .products-container--compact .product-category {
        display: none;
    }

    .products-container--compact .product-details {
        padding: 0.65rem 0.7rem 0.7rem;
        gap: 0.35rem;
    }

    .products-container--compact .product-title {
        font-size: 0.8rem;
    }

    .products-container--compact .product-price {
        font-size: 0.95rem;
    }

    .products-container--compact .product-price-original {
        font-size: 0.75rem;
    }

    .products-container--compact .product-add {
        padding: 0.5rem 0.6rem;
        font-size: 0.7rem;
    }

    .nav-cart span:not(.number-items) {
        display: none;
    }

    .header-actions .nav-cart {
        padding: 0.5rem;
    }
}
