/* ═══════════════════════════════════════════
   AZULA TIENDA ONLINE — CSS
   Responsive: Desktop + Mobile + PWA/APK
   ═══════════════════════════════════════════ */

/* ─── VARIABLES ─── */
:root {
    --primary: #1a56db;
    --primary-hover: #1648b8;
    --primary-light: #e8effc;
    --secondary: #6366f1;
    --success: #16a34a;
    --warning: #f59e0b;
    --danger: #dc2626;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
    --white: #ffffff;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow: 0 1px 3px rgba(0,0,0,0.1), 0 1px 2px rgba(0,0,0,0.06);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.1), 0 2px 4px rgba(0,0,0,0.06);
    --shadow-lg: 0 10px 15px rgba(0,0,0,0.1), 0 4px 6px rgba(0,0,0,0.05);
    --shadow-xl: 0 20px 25px rgba(0,0,0,0.1), 0 10px 10px rgba(0,0,0,0.04);
    --radius: 12px;
    --radius-sm: 8px;
    --radius-lg: 16px;
    --transition: all 0.2s ease;
    --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* ─── RESET ─── */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font);
    color: var(--gray-800);
    background: var(--gray-50);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
    padding-bottom: 0;
}

img { max-width: 100%; display: block; }
a { color: var(--primary); text-decoration: none; }
input, select, textarea, button { font-family: inherit; font-size: inherit; }

/* ─── NAVBAR ─── */
.navbar {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--white);
    border-bottom: 1px solid var(--gray-200);
    box-shadow: var(--shadow-sm);
    backdrop-filter: blur(8px);
    background: rgba(255,255,255,0.95);
}

.navbar-container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 20px;
    height: 64px;
    display: flex;
    align-items: center;
    gap: 16px;
}

.navbar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    font-size: 1.2rem;
    color: var(--gray-900);
    white-space: nowrap;
    flex-shrink: 0;
}

.brand-icon {
    font-size: 1.6rem;
}

.navbar-search {
    flex: 1;
    max-width: 480px;
    position: relative;
    display: flex;
    align-items: center;
}

.navbar-search input {
    width: 100%;
    padding: 10px 16px 10px 42px;
    border: 2px solid var(--gray-200);
    border-radius: 50px;
    background: var(--gray-50);
    font-size: 0.95rem;
    transition: var(--transition);
    outline: none;
}

.navbar-search input:focus {
    border-color: var(--primary);
    background: var(--white);
    box-shadow: 0 0 0 3px rgba(26, 86, 219, 0.1);
}

.search-icon {
    position: absolute;
    left: 14px;
    width: 18px;
    height: 18px;
    color: var(--gray-400);
    pointer-events: none;
}

.search-clear {
    position: absolute;
    right: 10px;
    background: none;
    border: none;
    color: var(--gray-400);
    cursor: pointer;
    font-size: 1.1rem;
    padding: 4px 8px;
    border-radius: 50%;
}

.search-clear:hover { color: var(--gray-600); }

.navbar-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.btn-icon {
    width: 42px;
    height: 42px;
    border: none;
    background: var(--gray-100);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
    color: var(--gray-600);
}

.btn-icon:hover { background: var(--gray-200); color: var(--gray-800); }
.btn-icon svg { width: 20px; height: 20px; }

.btn-cart {
    position: relative;
    width: 42px;
    height: 42px;
    border: none;
    background: var(--primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
    color: var(--white);
}

.btn-cart:hover { background: var(--primary-hover); transform: scale(1.05); }
.btn-cart svg { width: 20px; height: 20px; }

.cart-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: var(--danger);
    color: white;
    font-size: 0.7rem;
    font-weight: 700;
    min-width: 20px;
    height: 20px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 5px;
    animation: badgePop 0.3s ease;
}

@keyframes badgePop {
    0% { transform: scale(0); }
    50% { transform: scale(1.3); }
    100% { transform: scale(1); }
}

/* ─── HERO ─── */
.hero {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    padding: 60px 20px;
    text-align: center;
    color: white;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 400px;
    height: 400px;
    background: rgba(255,255,255,0.1);
    border-radius: 50%;
}

.hero::after {
    content: '';
    position: absolute;
    bottom: -30%;
    left: -10%;
    width: 300px;
    height: 300px;
    background: rgba(255,255,255,0.05);
    border-radius: 50%;
}

.hero-content {
    position: relative;
    z-index: 1;
    max-width: 600px;
    margin: 0 auto;
}

.hero h1 {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 12px;
    letter-spacing: -0.02em;
}

.hero p {
    font-size: 1.2rem;
    opacity: 0.9;
    margin-bottom: 24px;
}

/* ─── BUTTONS ─── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border: 2px solid transparent;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    white-space: nowrap;
}

.btn-primary {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}
.btn-primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); transform: translateY(-1px); box-shadow: var(--shadow-md); }

.btn-outline {
    background: transparent;
    color: var(--gray-700);
    border-color: var(--gray-300);
}
.btn-outline:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-light); }

.btn-success {
    background: var(--success);
    color: white;
    border-color: var(--success);
}
.btn-success:hover { background: #15803d; }

.btn-danger {
    background: var(--danger);
    color: white;
    border-color: var(--danger);
}

.btn-lg { padding: 14px 28px; font-size: 1.05rem; border-radius: var(--radius); }
.btn-sm { padding: 6px 14px; font-size: 0.85rem; }
.btn-block { width: 100%; }

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

/* ─── SECTIONS ─── */
.section {
    max-width: 1280px;
    margin: 0 auto;
    padding: 40px 20px;
}

.section-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 24px;
    letter-spacing: -0.01em;
}

/* ─── DEPARTMENTS GRID ─── */
.departments-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
}

.dept-card {
    background: var(--white);
    border: 2px solid var(--gray-200);
    border-radius: var(--radius);
    padding: 24px;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.dept-card:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.dept-icon {
    width: 56px;
    height: 56px;
    background: var(--primary-light);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.dept-card h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--gray-800);
}

.dept-card .badge {
    font-size: 0.8rem;
    color: var(--gray-500);
    background: var(--gray-100);
    padding: 2px 10px;
    border-radius: 20px;
}

/* ─── PRODUCTS GRID ─── */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 20px;
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 20px;
}

.product-card {
    background: var(--white);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    cursor: pointer;
}

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

.product-img {
    width: 100%;
    height: 200px;
    background: var(--gray-100);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
}

.product-img img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 10px;
}

.product-img .no-img {
    color: var(--gray-400);
    font-size: 3rem;
}

.product-img .loading-img {
    animation: pulse-search 1.5s ease-in-out infinite;
}

@keyframes pulse-search {
    0%, 100% { opacity: 0.4; }
    50% { opacity: 1; }
}

.product-info {
    padding: 16px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.product-category {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 4px;
}

.product-name {
    font-size: 1rem;
    font-weight: 600;
    color: var(--gray-800);
    margin-bottom: 8px;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-price {
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--primary);
    margin-top: auto;
}

.product-unit {
    font-size: 0.8rem;
    color: var(--gray-500);
    font-weight: 400;
}

.product-actions {
    padding: 12px 16px 16px;
    display: flex;
    gap: 8px;
}

.product-actions .btn {
    flex: 1;
}

.btn-add-cart {
    background: var(--primary);
    color: white;
    border: none;
    padding: 10px 16px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
}

.btn-add-cart:hover { background: var(--primary-hover); }

.btn-add-cart svg {
    width: 18px;
    height: 18px;
}

/* ─── PRODUCT DETAIL ─── */
.product-detail {
    max-width: 1000px;
    margin: 0 auto;
    padding: 20px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    align-items: start;
}

.detail-image {
    width: 100%;
    max-height: 420px;
    background: var(--gray-100);
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.detail-image img {
    max-width: 100%;
    max-height: 400px;
    object-fit: contain;
    padding: 20px;
}

.detail-image .no-img {
    font-size: 6rem;
    color: var(--gray-300);
}

.detail-info h1 {
    font-size: 1.8rem;
    font-weight: 800;
    margin-bottom: 8px;
}

.detail-category {
    color: var(--primary);
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 16px;
}

.detail-description {
    color: var(--gray-600);
    margin-bottom: 24px;
    line-height: 1.7;
}

.detail-price {
    font-size: 2rem;
    font-weight: 800;
    color: var(--primary);
    margin-bottom: 8px;
}

.detail-stock {
    font-size: 0.9rem;
    color: var(--success);
    margin-bottom: 24px;
}

.detail-quantity {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
}

.qty-btn {
    width: 40px;
    height: 40px;
    border: 2px solid var(--gray-300);
    background: var(--white);
    border-radius: 50%;
    font-size: 1.2rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.qty-btn:hover { border-color: var(--primary); color: var(--primary); }

.qty-value {
    font-size: 1.3rem;
    font-weight: 700;
    min-width: 40px;
    text-align: center;
}

.detail-escalados,
.detail-ofertas {
    background: linear-gradient(135deg, #fff8e1 0%, #fff3e0 100%);
    border: 2px solid #ffcc02;
    border-radius: var(--radius);
    padding: 16px;
    margin-bottom: 24px;
}

.ofertas-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}

.ofertas-icon {
    font-size: 1.3rem;
}

.ofertas-header h4,
.detail-escalados h4 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--gray-800);
    margin: 0;
}

.oferta-card {
    display: flex;
    align-items: center;
    gap: 12px;
    background: white;
    border-radius: var(--radius-sm);
    padding: 12px;
    margin-bottom: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    transition: var(--transition);
}

.oferta-card:last-child {
    margin-bottom: 0;
}

.oferta-card:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}

.oferta-badge-detail {
    background: #e53935;
    color: white;
    font-weight: 800;
    font-size: 0.85rem;
    padding: 6px 10px;
    border-radius: var(--radius-sm);
    white-space: nowrap;
    min-width: 50px;
    text-align: center;
}

.oferta-info {
    flex: 1;
    min-width: 0;
}

.oferta-nombre {
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--gray-800);
}

.oferta-condicion {
    font-size: 0.8rem;
    color: var(--gray-500);
    margin-top: 2px;
}

.oferta-precios {
    text-align: right;
    flex-shrink: 0;
}

.oferta-precio {
    display: block;
    font-weight: 800;
    font-size: 1.1rem;
    color: #e53935;
}

.oferta-ahorro {
    display: block;
    font-size: 0.72rem;
    color: var(--success);
    font-weight: 600;
    margin-top: 2px;
}

/* ─── OFFER BADGE ON PRODUCT CARD ─── */
.offer-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background: #e53935;
    color: white;
    font-weight: 800;
    font-size: 0.85rem;
    padding: 4px 10px;
    border-radius: 20px;
    z-index: 2;
    box-shadow: 0 2px 6px rgba(229, 57, 53, 0.4);
    animation: pulse-badge 2s ease-in-out infinite;
}

@keyframes pulse-badge {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.product-card.has-offer {
    border: 2px solid #ffcc02;
}

.product-price-offer {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: auto;
}

.price-original {
    font-size: 0.95rem;
    color: var(--gray-400);
    text-decoration: line-through;
    font-weight: 500;
}

.price-offer {
    font-size: 1.3rem;
    font-weight: 800;
    color: #e53935;
}

.offer-label {
    font-size: 0.75rem;
    color: #e53935;
    font-weight: 600;
    margin-top: 4px;
}

.escalado-item {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
    font-size: 0.9rem;
}

.escalado-item span:last-child {
    font-weight: 600;
    color: var(--success);
}

/* ─── CATALOG HEADER ─── */
.catalog-header {
    max-width: 1280px;
    margin: 0 auto;
    padding: 20px;
}

.breadcrumb {
    font-size: 0.85rem;
    color: var(--gray-500);
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    padding: 12px 20px;
    max-width: 1280px;
    margin: 0 auto;
}

.breadcrumb a { color: var(--primary); }
.breadcrumb a:hover { text-decoration: underline; }

.catalog-filters {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.catalog-filters select {
    padding: 10px 16px;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-sm);
    background: var(--white);
    font-size: 0.9rem;
    color: var(--gray-700);
    cursor: pointer;
    min-width: 200px;
    outline: none;
}

.catalog-filters select:focus { border-color: var(--primary); }

/* ─── PAGINATION ─── */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 30px 20px;
    max-width: 1280px;
    margin: 0 auto;
}

#infoPagina {
    font-size: 0.9rem;
    color: var(--gray-500);
}

/* ─── CART DRAWER ─── */
.cart-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 200;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
}

.cart-overlay.open { opacity: 1; visibility: visible; }

.cart-drawer {
    position: fixed;
    top: 0;
    right: -400px;
    width: 400px;
    max-width: 100vw;
    height: 100vh;
    background: var(--white);
    z-index: 201;
    display: flex;
    flex-direction: column;
    transition: right 0.3s ease;
    box-shadow: var(--shadow-xl);
}

.cart-drawer.open { right: 0; }

.cart-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px;
    border-bottom: 1px solid var(--gray-200);
}

.cart-header h3 {
    font-size: 1.2rem;
    font-weight: 700;
}

.cart-items {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
}

.cart-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    color: var(--gray-400);
    gap: 16px;
    text-align: center;
}

.cart-item {
    display: flex;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--gray-100);
    align-items: center;
}

.cart-item-img {
    width: 60px;
    height: 60px;
    background: var(--gray-100);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
}

.cart-item-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.cart-item-img .no-img { font-size: 1.5rem; color: var(--gray-400); }

.cart-item-info {
    flex: 1;
    min-width: 0;
}

.cart-item-name {
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cart-item-price {
    color: var(--primary);
    font-weight: 700;
    font-size: 0.95rem;
}

.cart-item-qty {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 6px;
}

.cart-item-qty button {
    width: 28px;
    height: 28px;
    border: 1px solid var(--gray-300);
    background: var(--white);
    border-radius: 50%;
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cart-item-qty span {
    font-weight: 600;
    min-width: 24px;
    text-align: center;
}

.cart-item-remove {
    color: var(--gray-400);
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.1rem;
    padding: 4px;
    flex-shrink: 0;
}
.cart-item-remove:hover { color: var(--danger); }

.cart-footer {
    padding: 20px;
    border-top: 1px solid var(--gray-200);
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.cart-total {
    display: flex;
    justify-content: space-between;
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 4px;
}

/* ─── CHECKOUT ─── */
.checkout-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 30px 20px;
}

.checkout-grid {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 30px;
    margin-top: 24px;
}

.checkout-form h3, .checkout-summary h3 {
    font-size: 1.1rem;
    margin-bottom: 20px;
    color: var(--gray-800);
}

.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: 6px;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    transition: var(--transition);
    outline: none;
    background: var(--white);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(26, 86, 219, 0.1);
}

.form-group textarea { resize: vertical; min-height: 80px; }

.checkout-summary {
    background: var(--white);
    border: 2px solid var(--gray-200);
    border-radius: var(--radius);
    padding: 24px;
    position: sticky;
    top: 84px;
    height: fit-content;
}

.checkout-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid var(--gray-100);
    font-size: 0.9rem;
}

.checkout-item-img {
    flex-shrink: 0;
}

.checkout-item-detail {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.checkout-item-name {
    font-weight: 500;
}

.checkout-item-meta {
    color: var(--gray-500);
    font-size: 0.8rem;
}

.checkout-item-price {
    font-weight: 600;
    white-space: nowrap;
}

.checkout-totals {
    padding-top: 12px;
    border-top: 2px solid var(--gray-200);
    margin-top: 8px;
}

.checkout-line {
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
    color: var(--gray-600);
    padding: 4px 0;
}

.checkout-total {
    display: flex;
    justify-content: space-between;
    font-size: 1.3rem;
    font-weight: 800;
    padding-top: 8px;
    margin-top: 4px;
    color: var(--primary);
}

.checkout-delivery-badge {
    margin-top: 16px;
    padding: 10px 16px;
    background: var(--gray-50);
    border-radius: var(--radius);
    text-align: center;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--gray-700);
}

/* Delivery options */
.delivery-options, .payment-options {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.delivery-option, .payment-option {
    flex: 1;
    min-width: 140px;
    cursor: pointer;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius);
    padding: 12px;
    transition: all 0.2s;
    text-align: center;
}

.delivery-option input, .payment-option input {
    display: none;
}

.delivery-option.selected, .payment-option.selected {
    border-color: var(--primary);
    background: rgba(26, 86, 219, 0.05);
}

.delivery-option-content, .payment-option-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.delivery-icon, .payment-icon {
    font-size: 1.5rem;
}

.delivery-label {
    font-size: 0.85rem;
    font-weight: 600;
}

/* ─── TRACK ORDER ─── */
.track-container {
    max-width: 600px;
    margin: 60px auto;
    padding: 20px;
    text-align: center;
}

.track-container h2 {
    font-size: 1.8rem;
    margin-bottom: 8px;
}

.track-container p {
    color: var(--gray-500);
    margin-bottom: 24px;
}

.track-form {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
}

.input-lg {
    flex: 1;
    padding: 14px 18px;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-sm);
    font-size: 1rem;
    outline: none;
}

.input-lg:focus { border-color: var(--primary); }

.track-result {
    background: var(--white);
    border: 2px solid var(--gray-200);
    border-radius: var(--radius);
    padding: 24px;
    text-align: left;
}

.track-status {
    display: inline-block;
    padding: 4px 16px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 16px;
}

.status-pendiente { background: #fef3c7; color: #92400e; }
.status-procesado { background: #d1fae5; color: #065f46; }
.status-cancelado { background: #fee2e2; color: #991b1b; }
.status-entregado { background: #dbeafe; color: #1e40af; }

.track-info { font-size: 0.95rem; }
.track-info p { margin-bottom: 8px; text-align: left; }
.track-info strong { color: var(--gray-800); }

.track-items {
    margin-top: 16px;
    border-top: 1px solid var(--gray-200);
    padding-top: 16px;
}

.track-items h4 {
    font-size: 0.95rem;
    margin-bottom: 10px;
}

.track-item {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
    font-size: 0.9rem;
}

/* ─── SUCCESS PAGE ─── */
.success-container {
    max-width: 500px;
    margin: 60px auto;
    padding: 40px 20px;
    text-align: center;
}

.success-icon { font-size: 4rem; margin-bottom: 16px; }

.success-container h2 {
    font-size: 1.8rem;
    margin-bottom: 8px;
}

.success-container > p {
    color: var(--gray-500);
    margin-bottom: 24px;
}

.success-details {
    background: var(--white);
    border: 2px solid var(--gray-200);
    border-radius: var(--radius);
    padding: 24px;
    text-align: left;
    margin-bottom: 24px;
}

.success-details p {
    margin-bottom: 8px;
    font-size: 0.95rem;
}

.success-details strong { color: var(--gray-800); }

.success-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

/* ─── TOAST ─── */
.toast-container {
    position: fixed;
    bottom: 90px;
    right: 20px;
    z-index: 300;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toast {
    background: var(--gray-800);
    color: white;
    padding: 14px 20px;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-lg);
    font-size: 0.9rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 10px;
    animation: toastIn 0.3s ease;
    max-width: 360px;
}

.toast.success { background: var(--success); }
.toast.error { background: var(--danger); }

@keyframes toastIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ─── SKELETON ─── */
.skeleton-loader {
    text-align: center;
    padding: 40px;
    color: var(--gray-400);
    grid-column: 1 / -1;
}

/* ─── FOOTER ─── */
.footer {
    background: var(--gray-800);
    color: var(--gray-300);
    padding: 24px 20px;
    text-align: center;
    margin-top: 40px;
}

.footer strong { color: var(--white); }
.footer-info { font-size: 0.85rem; margin-top: 4px; opacity: 0.7; }

/* ─── BOTTOM NAV (MOBILE) ─── */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--white);
    border-top: 1px solid var(--gray-200);
    display: none;
    z-index: 150;
    padding: 6px 0;
    padding-bottom: env(safe-area-inset-bottom, 6px);
    box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
}

.bottom-nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 6px 4px;
    border: none;
    background: none;
    color: var(--gray-400);
    font-size: 0.7rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
}

.bottom-nav-item svg { width: 22px; height: 22px; }

.bottom-nav-item.active { color: var(--primary); }

.mobile-badge {
    position: absolute;
    top: 0;
    right: 50%;
    transform: translateX(14px);
    background: var(--danger);
    color: white;
    font-size: 0.65rem;
    min-width: 16px;
    height: 16px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
}

/* ─── EMPTY STATE ─── */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--gray-400);
    grid-column: 1 / -1;
}

.empty-state svg {
    margin-bottom: 16px;
}

.empty-state p {
    font-size: 1.1rem;
    margin-bottom: 16px;
}

/* ═══════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════ */

@media (max-width: 768px) {
    body {
        padding-bottom: 70px;
    }

    .bottom-nav {
        display: flex;
    }

    .navbar-container {
        height: 56px;
        padding: 0 12px;
        gap: 8px;
    }

    .navbar-brand span { display: none; }

    .navbar-search input {
        padding: 8px 14px 8px 36px;
        font-size: 0.85rem;
    }

    .btn-cart {
        width: 38px;
        height: 38px;
    }

    .hero {
        padding: 40px 16px;
    }

    .hero h1 { font-size: 1.6rem; }
    .hero p { font-size: 1rem; }

    .section {
        padding: 24px 16px;
    }

    .section-title {
        font-size: 1.2rem;
    }

    .departments-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 10px;
    }

    .dept-card {
        padding: 16px 12px;
    }

    .dept-icon {
        width: 44px;
        height: 44px;
        font-size: 1.2rem;
    }

    .products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
        padding: 0 12px;
    }

    .product-img {
        height: 150px;
    }

    .product-info {
        padding: 10px;
    }

    .product-name {
        font-size: 0.85rem;
    }

    .product-price {
        font-size: 1.1rem;
    }

    .product-actions {
        padding: 8px 10px 10px;
    }

    .btn-add-cart {
        padding: 8px 10px;
        font-size: 0.8rem;
    }

    .product-detail {
        grid-template-columns: 1fr;
        gap: 20px;
        padding: 12px;
    }

    .detail-info h1 {
        font-size: 1.3rem;
    }

    .detail-price {
        font-size: 1.5rem;
    }

    .cart-drawer {
        width: 100vw;
        right: -100vw;
    }

    .checkout-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .checkout-summary {
        position: static;
    }

    .track-form {
        flex-direction: column;
    }

    .catalog-filters {
        flex-direction: column;
    }

    .catalog-filters select {
        min-width: 100%;
    }

    .footer {
        margin-bottom: 0;
        padding-bottom: 20px;
    }

    .toast-container {
        bottom: 80px;
        right: 12px;
        left: 12px;
    }

    .toast {
        max-width: 100%;
    }

    .navbar-actions .btn-icon[title="Rastrear pedido"] {
        display: none;
    }
}

@media (max-width: 400px) {
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }

    .product-img { height: 120px; }
    .product-info { padding: 8px; }
    .product-name { font-size: 0.8rem; }
    .product-price { font-size: 1rem; }
}

@media (min-width: 769px) {
    .main-content {
        min-height: calc(100vh - 64px - 80px);
    }
}

/* ─── PWA / APK tweaks ─── */
@media (display-mode: standalone) {
    .navbar {
        padding-top: env(safe-area-inset-top, 0);
    }
}

/* ─── LOADING SPINNER ─── */
.spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255,255,255,0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 0.8s ease infinite;
}

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

/* ─── SCROLL TO TOP ─── */
.scroll-top {
    position: fixed;
    bottom: 80px;
    right: 20px;
    width: 44px;
    height: 44px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: var(--shadow-lg);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 50;
    transition: var(--transition);
}

.scroll-top:hover { transform: scale(1.1); }

@media (max-width: 768px) {
    .scroll-top { bottom: 80px; }
}
