/* 
 * Catálogo App - Premium Design System 
 * Mobile First | Dark Mode Support
 */

:root {
    /* Colors - Default Green Brand (Overwritten by JS) */
    --caw-primary: #25D366;
    --caw-primary-dark: #128C7E;
    --caw-bg: #f8f9fa;
    --caw-surface: #ffffff;
    --caw-text: #1f2937;
    --caw-text-light: #6b7280;
    --caw-border: #e5e7eb;
    --caw-danger: #ef4444;
    --caw-warning: #f59e0b;
    --caw-success: #10b981;

    /* Typography */
    --caw-font: 'Inter', system-ui, -apple-system, sans-serif;

    /* Spacing */
    --caw-spacing-xs: 4px;
    --caw-spacing-sm: 8px;
    --caw-spacing-md: 16px;
    --caw-spacing-lg: 24px;

    /* UI Elements */
    --caw-radius-sm: 8px;
    --caw-radius-md: 12px;
    --caw-radius-lg: 16px;
    --caw-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --caw-logo-pc: 150px;
    --caw-logo-mob: 100px;
}

/* Base */
.caw-app-container {
    font-family: var(--caw-font);
    background: var(--caw-bg);
    color: var(--caw-text);
    max-width: 480px;
    /* Mobile View Constraint */
    margin: 0 auto;
    min-height: 100vh;
    /* Elementor Canvas Fix */
    position: relative;
    overflow-x: hidden;
    padding-bottom: 80px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.05);
    box-sizing: border-box;
}

/* Ensure full screen on mobile */
@media (max-width: 480px) {
    .caw-app-container {
        max-width: 100%;
        min-height: 100vh;
        border-radius: 0;
    }

    .caw-brand-logo {
        width: var(--caw-logo-mob) !important;
    }
}

@media (min-width: 481px) {
    .caw-brand-logo {
        width: var(--caw-logo-pc) !important;
    }
}

/* Header */
.caw-header {
    background: var(--caw-surface);
    position: sticky;
    top: 0;
    z-index: 50;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    padding: var(--caw-spacing-md);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.caw-brand-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--caw-primary);
    margin: 0;
}

/* Search Bar */
.caw-search-bar {
    padding: 0 var(--caw-spacing-md) var(--caw-spacing-md);
    background: var(--caw-surface);
    position: sticky;
    top: 60px;
    /* Adjust based on header height */
    z-index: 40;
}

.caw-search-input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--caw-border);
    border-radius: 50px;
    background: var(--caw-bg);
    font-size: 1rem;
    transition: all 0.2s;
    outline: none;
}

.caw-search-input:focus {
    border-color: var(--caw-primary);
    box-shadow: 0 0 0 2px var(--caw-primary);
    /* Use primary color with opacity in implementation if possible, or just solid */
}

/* Category Tabs (Sticky) */
.caw-tabs {
    display: flex;
    overflow-x: auto;
    gap: var(--caw-spacing-sm);
    padding: var(--caw-spacing-sm) var(--caw-spacing-md);
    background: var(--caw-surface);
    position: sticky;
    top: 110px;
    /* Adjust */
    z-index: 30;
    scrollbar-width: none;
    /* Hide scrollbar Firefox */
    border-bottom: 1px solid var(--caw-border);
}

.caw-tabs::-webkit-scrollbar {
    display: none;
}

.caw-tab {
    white-space: nowrap;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--caw-text-light);
    background: transparent;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.2s;
}

.caw-tab.active {
    background: var(--caw-primary);
    color: white;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

/* Product Grid */
.caw-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    /* 2 columns mobile */
    gap: var(--caw-spacing-md);
    padding: var(--caw-spacing-md);
}

.caw-card {
    background: var(--caw-surface);
    border-radius: var(--caw-radius-md);
    overflow: hidden;
    border: 1px solid var(--caw-border);
    display: flex;
    flex-direction: column;
    position: relative;
    transition: transform 0.1s;
}

.caw-card:active {
    transform: scale(0.98);
}

.caw-card-image {
    aspect-ratio: 1/1;
    width: 100%;
    object-fit: cover;
    background: #eee;
}

.caw-card-body {
    padding: var(--caw-spacing-sm);
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.caw-card-title {
    font-size: 0.95rem;
    font-weight: 600;
    margin: 0 0 4px 0;
    line-height: 1.3;
}

.caw-card-price {
    font-weight: 700;
    color: var(--caw-text);
    margin-top: auto;
}

/* Add Button Update */
.caw-btn-add {
    background: var(--caw-primary);
    color: white;
    border: none;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    position: absolute;
    bottom: 15px;
    right: 15px;
    font-size: 1.2rem;
    transition: transform 0.2s;
    box-shadow: 0 4px 6px rgba(var(--caw-primary-rgb), 0.3);
    /* Assuming rgb var or simple shadow */
}

.caw-btn-add:hover {
    background: var(--caw-primary-dark);
    transform: scale(1.1);
}

/* Skeletons */
.caw-skeleton {
    background: #e1e3e5;
    background-image: linear-gradient(90deg,
            rgba(255, 255, 255, 0) 0,
            rgba(255, 255, 255, 0.4) 50%,
            rgba(255, 255, 255, 0) 100%);
    background-size: 200px 100%;
    background-repeat: no-repeat;
    animation: shine 1.5s infinite ease-in-out;
    border-radius: 4px;
}

@keyframes shine {
    0% {
        background-position: -200px 0;
    }

    100% {
        background-position: calc(200px + 100%) 0;
    }
}

.caw-skeleton-card {
    height: 200px;
    border-radius: var(--caw-radius-md);
    background: #fff;
    border: 1px solid #eee;
}

/* Product Modal specific */
.caw-product-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 300;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
}

.caw-product-modal-overlay.open {
    opacity: 1;
    pointer-events: auto;
}

.caw-product-modal {
    border-radius: var(--caw-radius-lg);
    /* Override bottom sheet style for product detail if desired, or keep generic */
    transform: scale(0.95);
    transition: transform 0.3s;
    max-width: 500px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    background: white;
    padding: 25px;
}

.caw-product-modal-overlay.open .caw-product-modal {
    transform: scale(1);
}

/* Floating Cart */
.caw-floating-cart {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--caw-text);
    /* Usually dark */
    color: white;
    padding: 12px 24px;
    border-radius: 50px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    z-index: 100;
    width: 90%;
    max-width: 550px;
    cursor: pointer;
    justify-content: space-between;
}

.caw-cart-count {
    background: var(--caw-primary);
    padding: 2px 8px;
    border-radius: 12px;
    font-weight: 700;
    font-size: 0.9rem;
}