/* ==========================================================================
   Catálogo PWA — Tema "Azul Marino & Dorado"
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@600;700;800&family=Inter:wght@400;500;600;700&display=swap');

:root {
    /* Colores configurables desde el panel de administración */
    --primary-color: #c9a227;    /* dorado — acento, precios, botones principales */
    --secondary-color: #0b1f3f; /* azul marino — header, superficies oscuras */

    /* Paleta fija de soporte */
    --navy-deep: #081527;
    --navy-mid: #142c52;
    --navy-line: rgba(11, 31, 63, 0.12);
    --gold-light: #e7c766;
    --gold-deep: #8a6d1f;
    --ivory: #f7f4ec;
    --card-bg: #ffffff;
    --text-dark: #16233b;
    --text-muted: #5c6a86;
    --border-color: #e7e2d4;
    --danger-color: #b3432f;
    --success-color: #1f7a4d;

    --radius-sm: 6px;
    --radius-md: 12px;
    --radius-lg: 18px;
    --shadow-sm: 0 2px 8px rgba(11, 31, 63, 0.08);
    --shadow-md: 0 10px 24px rgba(11, 31, 63, 0.14);
    --shadow-lg: 0 20px 48px rgba(8, 21, 39, 0.28);
    --shadow-gold: 0 10px 24px rgba(201, 162, 39, 0.25);

    --font-display: 'Playfair Display', Georgia, serif;
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

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

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
        scroll-behavior: auto !important;
    }
}

body {
    font-family: var(--font-family);
    background-color: var(--ivory);
    color: var(--text-dark);
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
}

a {
    color: var(--gold-deep);
    text-decoration: none;
}

button {
    font-family: inherit;
    cursor: pointer;
}

::selection {
    background: var(--primary-color);
    color: var(--navy-deep);
}

/* --------------------------------------------------------------------------
   Reveal de entrada — un único momento orquestado (header + hero)
   -------------------------------------------------------------------------- */
@keyframes revealUp {
    from { opacity: 0; transform: translateY(14px); }
    to   { opacity: 1; transform: translateY(0); }
}

.app-header { animation: revealUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) both; }
.carousel-section { animation: revealUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) 0.1s both; }
.categories-section { animation: revealUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) 0.18s both; }

/* --------------------------------------------------------------------------
   Header
   -------------------------------------------------------------------------- */
.app-header {
    background: linear-gradient(180deg, var(--secondary-color) 0%, var(--navy-deep) 100%);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-md);
    padding: 14px 20px;
    border-bottom: 2px solid var(--primary-color);
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.brand-logo-area {
    display: flex;
    align-items: center;
    gap: 12px;
}

.app-logo {
    height: 40px;
    width: auto;
    object-fit: contain;
    border-radius: 6px;
}

.app-logo-fallback {
    font-size: 26px;
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(201, 162, 39, 0.15);
    border: 1px solid var(--primary-color);
    border-radius: 10px;
}

.brand-title {
    font-family: var(--font-display);
    font-size: 1.4rem;
    font-weight: 700;
    color: #fdfaf0;
    letter-spacing: 0.02em;
    white-space: nowrap;
}

.header-search-bar {
    flex: 1;
    max-width: 600px;
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.96);
    border-radius: 999px;
    padding: 3px 6px;
    box-shadow: inset 0 0 0 1px rgba(201, 162, 39, 0.3);
    transition: box-shadow 0.2s ease;
}

.header-search-bar:focus-within {
    box-shadow: inset 0 0 0 2px var(--primary-color);
}

.header-search-bar input {
    flex: 1;
    border: none;
    outline: none;
    background: transparent;
    padding: 10px 14px;
    font-size: 0.95rem;
    font-family: var(--font-family);
}

.header-search-bar .btn-search {
    background: var(--secondary-color);
    color: var(--primary-color);
    border: none;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease, background 0.2s ease;
}

.header-search-bar .btn-search:hover {
    background: var(--primary-color);
    color: var(--navy-deep);
    transform: scale(1.06);
}

.header-search-mobile {
    display: none;
    margin-top: 12px;
    background: #fff;
    border-radius: 999px;
    padding: 3px 6px;
}

.header-search-mobile input {
    width: 85%;
    border: none;
    background: transparent;
    padding: 9px 12px;
    font-size: 0.9rem;
    outline: none;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 14px;
}

.btn-install-pwa {
    background: transparent;
    color: var(--primary-color);
    border: 1px solid var(--primary-color);
    padding: 7px 14px;
    border-radius: 20px;
    font-size: 0.82rem;
    font-weight: 600;
    transition: background 0.2s ease, color 0.2s ease;
}

.btn-install-pwa:hover {
    background: var(--primary-color);
    color: var(--navy-deep);
}

.cart-trigger {
    position: relative;
    cursor: pointer;
    font-size: 1.5rem;
    padding: 6px 10px;
    color: #fdfaf0;
    transition: transform 0.15s ease;
}

.cart-trigger:hover {
    transform: translateY(-2px);
}

.cart-badge {
    position: absolute;
    top: -2px;
    right: 0px;
    background-color: var(--primary-color);
    color: var(--navy-deep);
    font-size: 0.72rem;
    font-weight: 700;
    border-radius: 10px;
    padding: 2px 6px;
    min-width: 18px;
    text-align: center;
    transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.cart-badge.bump {
    animation: badgeBump 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes badgeBump {
    0%   { transform: scale(1); }
    40%  { transform: scale(1.5); }
    100% { transform: scale(1); }
}

/* --------------------------------------------------------------------------
   Layout & Sections
   -------------------------------------------------------------------------- */
.main-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 24px 20px 16px;
}

.offline-banner {
    background-color: #f3ebd2;
    color: var(--gold-deep);
    text-align: center;
    padding: 10px 16px;
    font-weight: 600;
    border-radius: var(--radius-sm);
    border: 1px solid var(--primary-color);
    margin-bottom: 16px;
}

/* --------------------------------------------------------------------------
   Carrusel Horizontal (Productos Destacados)
   -------------------------------------------------------------------------- */
.carousel-section {
    background: linear-gradient(180deg, #ffffff 0%, #fdfbf5 100%);
    border-radius: var(--radius-lg);
    padding: 22px;
    margin-bottom: 28px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 18px;
}

.section-header h2 {
    font-family: var(--font-display);
    font-size: 1.35rem;
    color: var(--secondary-color);
    font-weight: 700;
}

.carousel-controls {
    display: flex;
    gap: 8px;
}

.carousel-arrow {
    background: var(--ivory);
    border: 1px solid var(--primary-color);
    color: var(--secondary-color);
    border-radius: 50%;
    width: 38px;
    height: 38px;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.carousel-arrow:hover {
    background: var(--secondary-color);
    color: var(--primary-color);
    border-color: var(--secondary-color);
    transform: scale(1.05);
}

.carousel-wrapper {
    overflow: hidden;
    position: relative;
    width: 100%;
}

.carousel-track {
    display: flex;
    gap: 18px;
    transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
    will-change: transform;
}

.carousel-card {
    min-width: 220px;
    max-width: 220px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    cursor: pointer;
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.carousel-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-gold);
    border-color: var(--primary-color);
}

.carousel-card-img {
    width: 100%;
    height: 160px;
    object-fit: cover;
    background-color: var(--ivory);
}

.carousel-card-body {
    padding: 14px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.carousel-card-title {
    font-size: 0.9rem;
    font-weight: 600;
    line-height: 1.35;
    height: 2.6em;
    overflow: hidden;
    margin-bottom: 10px;
    color: var(--text-dark);
}

.carousel-card-price {
    font-family: var(--font-display);
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--gold-deep);
    margin-top: auto;
}

.carousel-dots {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin-top: 16px;
}

.dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: var(--border-color);
    cursor: pointer;
    transition: all 0.25s ease;
}

.dot.active {
    background-color: var(--primary-color);
    width: 20px;
    border-radius: 4px;
}

/* --------------------------------------------------------------------------
   Barra de Categorías
   -------------------------------------------------------------------------- */
.categories-section {
    margin-bottom: 28px;
}

.categories-bar {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding-bottom: 8px;
    scrollbar-width: none;
}

.categories-bar::-webkit-scrollbar {
    display: none;
}

.cat-pill {
    background-color: #fff;
    border: 1px solid var(--border-color);
    padding: 9px 18px;
    border-radius: 20px;
    white-space: nowrap;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-dark);
    transition: all 0.2s ease;
}

.cat-pill:hover {
    border-color: var(--primary-color);
    color: var(--gold-deep);
}

.cat-pill.active {
    background-color: var(--secondary-color);
    color: var(--primary-color);
    border-color: var(--secondary-color);
    font-weight: 600;
}

/* --------------------------------------------------------------------------
   Grilla de Productos
   -------------------------------------------------------------------------- */
.catalog-section {
    margin-bottom: 36px;
}

.section-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 18px;
}

.section-title-row h3 {
    font-family: var(--font-display);
    font-size: 1.25rem;
    color: var(--secondary-color);
}

.product-count-badge {
    background-color: var(--navy-mid);
    color: #fdfaf0;
    font-size: 0.8rem;
    padding: 4px 12px;
    border-radius: 12px;
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 20px;
}

.product-card {
    background: var(--card-bg);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: box-shadow 0.25s ease, transform 0.25s ease, border-color 0.25s ease;
    cursor: pointer;
    position: relative;
}

.product-card:hover {
    box-shadow: var(--shadow-gold);
    transform: translateY(-5px);
    border-color: var(--primary-color);
}

.card-img-wrapper {
    width: 100%;
    height: 180px;
    position: relative;
    background-color: var(--ivory);
    overflow: hidden;
}

.product-card-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

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

.badge-featured {
    position: absolute;
    top: 10px;
    left: 10px;
    background: linear-gradient(135deg, var(--gold-light), var(--primary-color));
    color: var(--navy-deep);
    font-size: 0.7rem;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    box-shadow: var(--shadow-sm);
}

.product-card-body {
    padding: 14px;
    display: flex;
    flex-direction: column;
    flex: 1;
    gap: 4px;
}

.product-category-text {
    font-size: 0.72rem;
    color: var(--gold-deep);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.product-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-dark);
    line-height: 1.35;
    margin-bottom: 4px;
}

.product-price {
    font-family: var(--font-display);
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--secondary-color);
    margin-top: auto;
    margin-bottom: 10px;
}

.btn-add-cart-sm {
    background-color: transparent;
    color: var(--secondary-color);
    border: 1.5px solid var(--secondary-color);
    padding: 9px 12px;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-weight: 600;
    width: 100%;
    margin-top: auto;
    position: relative;
    overflow: hidden;
    transition: color 0.25s ease, border-color 0.25s ease;
}

.btn-add-cart-sm::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(120deg, var(--secondary-color), var(--navy-mid));
    transform: translateX(-101%);
    transition: transform 0.3s ease;
    z-index: 0;
}

.btn-add-cart-sm span, .btn-add-cart-sm {
    position: relative;
}

.btn-add-cart-sm:hover {
    color: #fdfaf0;
    border-color: var(--secondary-color);
}

.btn-add-cart-sm:hover::before {
    transform: translateX(0);
}

/* --------------------------------------------------------------------------
   Modales
   -------------------------------------------------------------------------- */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(8, 21, 39, 0.72);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    padding: 16px;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-card {
    background: #fff;
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 540px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    padding: 28px;
    box-shadow: var(--shadow-lg);
    border-top: 3px solid var(--primary-color);
    transform: scale(0.94) translateY(10px);
    opacity: 0;
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s ease;
}

.modal-overlay.active .modal-card {
    transform: scale(1) translateY(0);
    opacity: 1;
}

.modal-detail-card {
    max-width: 800px;
}

.modal-close-btn {
    position: absolute;
    top: 16px;
    right: 16px;
    background: var(--ivory);
    border: 1px solid var(--border-color);
    font-size: 1.3rem;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    color: var(--secondary-color);
    transition: all 0.2s ease;
}

.modal-close-btn:hover {
    background: var(--secondary-color);
    color: var(--primary-color);
    transform: rotate(90deg);
}

/* Detalle de Producto */
.modal-body-detail {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 28px;
    margin-top: 12px;
}

.detail-gallery {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.gallery-main-container {
    width: 100%;
    height: 280px;
    background-color: var(--ivory);
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.gallery-main-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.gallery-thumbnails {
    display: flex;
    gap: 8px;
    overflow-x: auto;
}

.thumb-mini {
    width: 60px;
    height: 60px;
    border: 2px solid transparent;
    border-radius: 6px;
    object-fit: cover;
    cursor: pointer;
    transition: border-color 0.2s ease;
}

.thumb-mini.active {
    border-color: var(--primary-color);
}

.detail-info {
    display: flex;
    flex-direction: column;
}

.detail-category-badge {
    font-size: 0.78rem;
    color: var(--gold-deep);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.detail-title {
    font-family: var(--font-display);
    font-size: 1.5rem;
    margin: 8px 0;
    color: var(--secondary-color);
}

.detail-price {
    font-family: var(--font-display);
    font-size: 1.9rem;
    font-weight: 700;
    color: var(--gold-deep);
    margin-bottom: 8px;
}

.detail-stock {
    font-size: 0.85rem;
    color: var(--success-color);
    font-weight: 600;
    margin-bottom: 18px;
}

.detail-description h4 {
    font-size: 0.95rem;
    margin-bottom: 6px;
    color: var(--secondary-color);
}

.detail-description p {
    font-size: 0.9rem;
    color: var(--text-muted);
    max-height: 120px;
    overflow-y: auto;
}

.detail-actions {
    margin-top: auto;
    display: flex;
    gap: 12px;
    align-items: center;
    padding-top: 18px;
}

.quantity-selector {
    display: flex;
    align-items: center;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
}

.quantity-selector button {
    background: var(--ivory);
    border: none;
    width: 36px;
    height: 36px;
    font-size: 1.1rem;
    color: var(--secondary-color);
}

.quantity-selector input {
    width: 40px;
    text-align: center;
    border: none;
    font-size: 1rem;
    background: transparent;
}

.btn-add-cart-lg {
    flex: 1;
    background: linear-gradient(135deg, var(--primary-color), var(--gold-deep));
    color: var(--navy-deep);
    border: none;
    padding: 13px;
    border-radius: var(--radius-sm);
    font-size: 1rem;
    font-weight: 700;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn-add-cart-lg:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-gold);
}

/* --------------------------------------------------------------------------
   Carrito Lateral
   -------------------------------------------------------------------------- */
.cart-drawer-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(8, 21, 39, 0.6);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

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

.cart-drawer {
    position: fixed;
    top: 0;
    right: -400px;
    width: 100%;
    max-width: 380px;
    height: 100%;
    background-color: #fff;
    display: flex;
    flex-direction: column;
    box-shadow: -8px 0 32px rgba(8, 21, 39, 0.25);
    transition: right 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    border-left: 3px solid var(--primary-color);
}

.cart-drawer-overlay.active .cart-drawer {
    right: 0;
}

.cart-header {
    background: var(--secondary-color);
    color: #fdfaf0;
    padding: 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.cart-header h3 {
    font-family: var(--font-display);
}

.close-cart-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #fdfaf0;
}

.cart-body {
    flex: 1;
    overflow-y: auto;
    padding: 18px;
}

.cart-item {
    display: flex;
    gap: 12px;
    padding-bottom: 14px;
    margin-bottom: 14px;
    border-bottom: 1px solid var(--border-color);
}

.cart-item-img {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 6px;
    border: 1px solid var(--border-color);
}

.cart-item-info {
    flex: 1;
}

.cart-item-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-dark);
}

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

.cart-item-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 6px;
}

.cart-footer {
    padding: 18px;
    background-color: var(--ivory);
    border-top: 1px solid var(--border-color);
}

.cart-total-row {
    display: flex;
    justify-content: space-between;
    font-size: 1.15rem;
    margin-bottom: 14px;
    color: var(--secondary-color);
    font-weight: 600;
}

.btn-checkout {
    width: 100%;
    background: linear-gradient(135deg, var(--primary-color), var(--gold-deep));
    color: var(--navy-deep);
    border: none;
    padding: 15px;
    border-radius: var(--radius-sm);
    font-size: 1rem;
    font-weight: 700;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn-checkout:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: var(--shadow-gold);
}

.btn-checkout:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Formularios y Botones */
.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 5px;
    color: var(--secondary-color);
}

.form-control {
    padding: 11px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    font-family: var(--font-family);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(201, 162, 39, 0.18);
}

.btn-confirm-order,
.btn-primary-lg {
    width: 100%;
    background: linear-gradient(135deg, var(--secondary-color), var(--navy-mid));
    color: #fdfaf0;
    border: none;
    padding: 13px;
    border-radius: var(--radius-sm);
    font-weight: 700;
    font-size: 1rem;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn-confirm-order:hover,
.btn-primary-lg:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

@keyframes popIn {
    0%   { transform: scale(0.6); opacity: 0; }
    60%  { transform: scale(1.08); opacity: 1; }
    100% { transform: scale(1); }
}

.success-icon {
    font-size: 3.5rem;
    margin-bottom: 10px;
    animation: popIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.order-receipt-card {
    background-color: var(--ivory);
    border: 1px dashed var(--primary-color);
    padding: 16px;
    border-radius: var(--radius-sm);
    margin-top: 16px;
    text-align: left;
    font-size: 0.9rem;
}

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */
.app-footer {
    background: linear-gradient(180deg, var(--secondary-color) 0%, var(--navy-deep) 100%);
    color: #c7cede;
    padding: 40px 20px 20px;
    margin-top: 48px;
    border-top: 2px solid var(--primary-color);
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 24px;
}

.footer-col h4 {
    font-family: var(--font-display);
    color: var(--primary-color);
    margin-bottom: 12px;
}

.link-admin {
    color: var(--primary-color);
    font-weight: 600;
    transition: opacity 0.2s ease;
}

.link-admin:hover {
    opacity: 0.8;
}

.footer-bottom {
    max-width: 1200px;
    margin: 28px auto 0;
    padding-top: 18px;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    text-align: center;
    font-size: 0.85rem;
}

/* --------------------------------------------------------------------------
   Íconos (Lucide)
   -------------------------------------------------------------------------- */
.icon-inline {
    width: 1em;
    height: 1em;
    stroke-width: 2;
    vertical-align: -0.15em;
    display: inline-block;
}

.cart-trigger .icon-inline,
.btn-search .icon-inline {
    width: 22px;
    height: 22px;
}

.carousel-arrow .icon-inline {
    width: 18px;
    height: 18px;
}

.modal-close-btn .icon-inline,
.close-cart-btn .icon-inline {
    width: 20px;
    height: 20px;
}

.success-icon .icon-inline {
    width: 56px;
    height: 56px;
    stroke-width: 1.5;
    color: var(--primary-color);
}

.app-logo-fallback .icon-inline {
    width: 22px;
    height: 22px;
    color: var(--primary-color);
}

@media (max-width: 768px) {
    .header-search-bar {
        display: none;
    }
    .header-search-mobile {
        display: flex;
    }
    .modal-body-detail {
        grid-template-columns: 1fr;
    }
    .app-header {
        padding: 12px 14px;
    }
    .brand-title {
        font-size: 1.15rem;
    }
    .main-content {
        padding: 16px 14px 12px;
    }
    .carousel-section {
        padding: 16px;
    }
    .carousel-card {
        min-width: 168px;
        max-width: 168px;
    }
    .carousel-card-img {
        height: 120px;
    }
    .product-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 12px;
    }
    .card-img-wrapper {
        height: 130px;
    }
    .product-title {
        font-size: 0.85rem;
    }
    .product-price {
        font-size: 1.05rem;
    }
    .cart-drawer {
        max-width: 100%;
    }
    .modal-card {
        padding: 20px 16px;
        max-height: 92vh;
    }
    .footer-container {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 18px;
    }
    .section-header h2, .section-title-row h3 {
        font-size: 1.05rem;
    }
}

@media (max-width: 420px) {
    .product-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .carousel-card {
        min-width: 148px;
        max-width: 148px;
    }
    .btn-add-cart-sm, .btn-add-cart-lg, .btn-checkout, .btn-confirm-order {
        min-height: 44px;
    }
    .cart-trigger, .btn-search, .carousel-arrow, .modal-close-btn, .close-cart-btn {
        min-width: 40px;
        min-height: 40px;
    }
}

/* Respeta el "notch"/áreas seguras en celulares (iOS) */
.cart-drawer {
    padding-bottom: env(safe-area-inset-bottom);
}

.app-header {
    padding-top: max(14px, env(safe-area-inset-top));
}

/* --------------------------------------------------------------------------
   Utilidades y estados varios
   -------------------------------------------------------------------------- */
.mb-3 { margin-bottom: 16px; }
.mt-3 { margin-top: 16px; }
.text-center { text-align: center; }
.text-right { text-align: right; }

.cart-icon { display: inline-block; }

.loading-spinner,
.carousel-skeleton {
    width: 100%;
    text-align: center;
    padding: 40px 16px;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.error-msg {
    width: 100%;
    text-align: center;
    padding: 24px 16px;
    color: var(--danger-color);
    background: #fbeae5;
    border-radius: var(--radius-sm);
    font-weight: 600;
}

.modal-header-simple {
    margin-bottom: 18px;
}

.modal-header-simple h3 {
    font-family: var(--font-display);
    color: var(--secondary-color);
    font-size: 1.3rem;
    margin-bottom: 4px;
}

.modal-header-simple p {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.checkout-summary-box {
    background: var(--ivory);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 14px;
}

.checkout-summary-box h4 {
    color: var(--secondary-color);
    font-size: 0.95rem;
    margin-bottom: 10px;
}

.checkout-items-list {
    font-size: 0.88rem;
    color: var(--text-muted);
    margin-bottom: 10px;
}

.checkout-total {
    display: flex;
    justify-content: space-between;
    font-weight: 700;
    color: var(--secondary-color);
    padding-top: 10px;
    border-top: 1px dashed var(--border-color);
}
