/* ============================================
   ZonaStand - CSS App Shell
   Mobile First Design
   ============================================ */

/* -------------------------------------------
   CSS Variables
   ------------------------------------------- */
:root {
    /* Colores Principales */
    --primary: #d9534f;
    --primary-dark: #c9302c;
    --primary-light: #e67573;

    /* WhatsApp */
    --whatsapp: #25D366;
    --whatsapp-dark: #1ebe57;

    /* Fondos */
    --bg-body: #f4f6f8;
    --bg-card: #ffffff;
    --bg-input: #ffffff;

    /* Textos */
    --text-main: #333333;
    --text-muted: #6c757d;
    --text-light: #757575;
    /* Antes: #999999 (2.8:1) -> Ahora: 4.6:1 WCAG AA */

    /* Bordes y Efectos */
    --border-color: #e0e0e0;
    --radius: 12px;
    --radius-sm: 8px;
    --radius-full: 50px;
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    --shadow-lg: 0 4px 16px rgba(0, 0, 0, 0.1);

    /* Espaciado */
    --spacing-xs: 4px;
    --spacing-sm: 8px;
    --spacing-md: 16px;
    --spacing-lg: 24px;
    --spacing-xl: 32px;

    /* Navegación */
    --nav-height: 60px;
    --header-height: 56px;

    /* Z-Index Hierarchy (escala semántica normalizada) */
    --z-header: 800;
    /* Header sticky */
    --z-nav: 900;
    /* Navegación inferior */
    --z-active-bar: 950;
    /* Barra de carrito flotante */
    --z-cart: 950;
    /* Carrito flotante (alias de active-bar) */
    --z-overlay: 1000;
    /* Fondos oscuros de modal */
    --z-modal: 1200;
    /* Modales y overlays */
    --z-toast: 1500;
    /* Notificaciones toast (siempre arriba) */
}

/* -------------------------------------------
   Spinner Animation (for save indicators)
   ------------------------------------------- */
.spin {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

/* -------------------------------------------
   Reset & Base
   ------------------------------------------- */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: 1rem;
    line-height: 1.5;
    color: var(--text-main);
    background-color: var(--bg-body);
    padding-bottom: 80px;
    /* Espacio para la barra inferior */
    min-height: 100vh;
    overflow-x: hidden;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: var(--primary-dark);
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

ul,
ol {
    list-style: none;
}

/* Accesibilidad: Indicador de foco para navegación por teclado */
:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

/* -------------------------------------------
   App Header
   ------------------------------------------- */
.app-header {
    position: sticky;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    background: var(--primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 var(--spacing-md);
    z-index: 999;
    box-shadow: var(--shadow);
}

.app-header h1 {
    font-size: 1.125rem;
    font-weight: 600;
}

.header-icon {
    width: 24px;
    height: 24px;
    cursor: pointer;
    opacity: 0.9;
    transition: opacity 0.2s;
}

.header-icon:hover {
    opacity: 1;
}

/* Back button with label (icon + text on desktop) */
.header-back {
    display: flex;
    align-items: center;
    gap: 4px;
    color: white;
    text-decoration: none;
    opacity: 0.9;
    transition: opacity 0.2s;
}

.header-back:hover {
    opacity: 1;
    color: white;
}

.header-back svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.header-back-label {
    display: none;
    font-size: 0.875rem;
    font-weight: 500;
}

/* Show label on desktop */
@media (min-width: 768px) {
    .header-back-label {
        display: inline;
    }
}

/* -------------------------------------------
   Breadcrumbs
   ------------------------------------------- */
.breadcrumbs {
    display: none;
    /* Hidden on mobile - limited space */
    padding: 0 var(--spacing-md);
    margin-bottom: var(--spacing-sm);
}

.breadcrumbs-list {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.breadcrumbs-item {
    display: flex;
    align-items: center;
    gap: 4px;
}

.breadcrumbs-link {
    color: var(--text-muted);
    font-size: 0.8125rem;
    text-decoration: none;
    transition: color 0.2s ease;
}

.breadcrumbs-link:hover {
    color: var(--primary);
}

.breadcrumbs-separator {
    color: var(--text-light);
    display: flex;
    align-items: center;
}

.breadcrumbs-current {
    color: var(--text-main);
    font-size: 0.8125rem;
    font-weight: 500;
}

/* Show breadcrumbs on desktop */
@media (min-width: 768px) {
    .breadcrumbs {
        display: block;
        margin-top: var(--spacing-md);
    }
}

/* -------------------------------------------
   Bottom Navigation (App Shell)
   ------------------------------------------- */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: var(--nav-height);
    background: var(--bg-card);
    display: flex;
    justify-content: space-around;
    align-items: center;
    border-top: 1px solid var(--border-color);
    z-index: 1000;
    padding-bottom: env(safe-area-inset-bottom, 0);
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: var(--text-muted);
    font-size: 10px;
    font-weight: 500;
    padding: var(--spacing-xs) var(--spacing-sm);
    transition: color 0.2s ease;
    min-width: 64px;
}

.nav-item svg,
.nav-item .nav-icon {
    width: 24px;
    height: 24px;
    margin-bottom: 2px;
    stroke: currentColor;
    fill: none;
}

.nav-item span {
    margin-top: 2px;
}

.nav-item:hover,
.nav-item.active {
    color: var(--primary);
}

.nav-item.active svg,
.nav-item.active .nav-icon {
    stroke: var(--primary);
}

/* -------------------------------------------
   Container & Layout
   ------------------------------------------- */
.container {
    width: 100%;
    max-width: 480px;
    margin: 0 auto;
    padding: var(--spacing-md);
}

.page-content {
    padding-top: var(--spacing-md);
}

/* -------------------------------------------
   Cards
   ------------------------------------------- */
.card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow);
    margin-bottom: 15px;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-md);
}

.card-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-main);
}

.card-body {
    color: var(--text-main);
}

.card-footer {
    margin-top: var(--spacing-md);
    padding-top: var(--spacing-md);
    border-top: 1px solid var(--border-color);
}

/* -------------------------------------------
   Buttons
   ------------------------------------------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 24px;
    border: none;
    border-radius: var(--radius-full);
    font-size: 1rem;
    font-weight: 600;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    width: 100%;
    text-decoration: none;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Feedback táctil para móviles */
.btn:active {
    transform: scale(0.98);
    filter: brightness(0.95);
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark);
}

.btn-secondary {
    background: var(--bg-body);
    color: var(--text-main);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: var(--border-color);
}

.btn-whatsapp {
    background: var(--whatsapp);
    color: white;
}

.btn-whatsapp:hover {
    background: var(--whatsapp-dark);
}

.btn-outline {
    background: transparent;
    color: var(--primary);
    border: 2px solid var(--primary);
}

.btn-outline:hover {
    background: var(--primary);
    color: white;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 0.875rem;
}

.btn-lg {
    padding: 16px 32px;
    font-size: 1.125rem;
}

.btn-icon {
    width: 44px;
    height: 44px;
    padding: 0;
    border-radius: 50%;
}

/* Ghost Buttons (icon-only on mobile, text on desktop) */
.btn-ghost {
    background: transparent;
    color: var(--text-muted);
    border: none;
    padding: 8px;
    min-width: 40px;
    width: auto;
}

.btn-ghost:hover {
    background: var(--bg-body);
    color: var(--text-main);
}

.btn-ghost .btn-icon {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.btn-ghost .btn-label {
    display: none;
}

/* Ghost Danger variant */
.btn-ghost-danger {
    color: var(--text-muted);
}

.btn-ghost-danger:hover {
    background: rgba(217, 83, 79, 0.1);
    color: var(--primary);
}

/* Show labels on desktop */
@media (min-width: 768px) {
    .btn-ghost {
        padding: 8px 12px;
        gap: 6px;
    }

    .btn-ghost .btn-label {
        display: inline;
    }
}

/* -------------------------------------------
   Forms
   ------------------------------------------- */
.form-group {
    margin-bottom: var(--spacing-md);
}

.form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-main);
    margin-bottom: var(--spacing-xs);
}

.form-input {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: var(--radius-sm);
    font-size: 1rem;
    color: var(--text-main);
    background: var(--bg-input);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(217, 83, 79, 0.15);
}

.form-input::placeholder {
    color: var(--text-light);
}

.form-input.error {
    border-color: var(--primary);
}

.form-textarea {
    min-height: 100px;
    resize: vertical;
}

.form-select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23333' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 40px;
}

.form-error {
    font-size: 0.75rem;
    color: var(--primary);
    margin-top: var(--spacing-xs);
}

.form-hint {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: var(--spacing-xs);
}

/* -------------------------------------------
   Product Grid
   ------------------------------------------- */
.product-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--spacing-md);
}

.product-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: transform 0.2s, box-shadow 0.2s;
}

.product-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.product-image {
    position: relative;
    aspect-ratio: 1;
    background: var(--bg-body);
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.product-info {
    padding: var(--spacing-sm);
}

.product-name {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-main);
    margin-bottom: var(--spacing-xs);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-price {
    font-size: 1rem;
    font-weight: 700;
    color: var(--primary);
}

/* -------------------------------------------
   Badge
   ------------------------------------------- */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: var(--radius-full);
}

.badge-primary {
    background: rgba(217, 83, 79, 0.1);
    color: var(--primary);
}

.badge-success {
    background: rgba(37, 211, 102, 0.1);
    color: var(--whatsapp);
}

.badge-pending {
    background: rgba(255, 193, 7, 0.15);
    color: #c69500;
}

/* -------------------------------------------
   Empty State
   ------------------------------------------- */
.empty-state {
    text-align: center;
    padding: var(--spacing-xl) var(--spacing-md);
    color: var(--text-muted);
}

.empty-state svg {
    width: 64px;
    height: 64px;
    margin: 0 auto var(--spacing-md);
    opacity: 0.4;
}

.empty-state h3 {
    font-size: 1.125rem;
    color: var(--text-main);
    margin-bottom: var(--spacing-sm);
}

.empty-state p {
    font-size: 0.875rem;
}

/* -------------------------------------------
   Toast / Notifications
   ------------------------------------------- */
.toast {
    position: fixed;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--text-main);
    color: white;
    padding: 12px 24px;
    border-radius: var(--radius-full);
    font-size: 0.875rem;
    z-index: 1100;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.toast.show {
    opacity: 1;
    visibility: visible;
}

.toast.toast-success {
    background: var(--whatsapp);
}

.toast.toast-error {
    background: var(--primary);
}

/* -------------------------------------------
   Utility Classes
   ------------------------------------------- */

/* Text Alignment */
.text-center {
    text-align: center;
}

.text-left {
    text-align: left;
}

.text-right {
    text-align: right;
}

/* Text Colors */
.text-primary {
    color: var(--primary);
}

.text-muted {
    color: var(--text-muted);
}

.text-white {
    color: white;
}

/* Font Weight */
.font-bold {
    font-weight: 700;
}

.font-medium {
    font-weight: 500;
}

/* Display */
.d-none {
    display: none;
}

.d-flex {
    display: flex;
}

.d-block {
    display: block;
}

.d-inline-block {
    display: inline-block;
}

/* Flexbox */
.flex-column {
    flex-direction: column;
}

.justify-center {
    justify-content: center;
}

.justify-between {
    justify-content: space-between;
}

.justify-around {
    justify-content: space-around;
}

.align-center {
    align-items: center;
}

.flex-wrap {
    flex-wrap: wrap;
}

.gap-1 {
    gap: var(--spacing-sm);
}

.gap-2 {
    gap: var(--spacing-md);
}

/* Margins */
.m-0 {
    margin: 0;
}

.mt-1 {
    margin-top: var(--spacing-sm);
}

.mt-2 {
    margin-top: var(--spacing-md);
}

.mt-3 {
    margin-top: var(--spacing-lg);
}

.mb-1 {
    margin-bottom: var(--spacing-sm);
}

.mb-2 {
    margin-bottom: var(--spacing-md);
}

.mb-3 {
    margin-bottom: var(--spacing-lg);
}

.mx-auto {
    margin-left: auto;
    margin-right: auto;
}

/* Padding */
.p-0 {
    padding: 0;
}

.p-1 {
    padding: var(--spacing-sm);
}

.p-2 {
    padding: var(--spacing-md);
}

.p-3 {
    padding: var(--spacing-lg);
}

.py-1 {
    padding-top: var(--spacing-sm);
    padding-bottom: var(--spacing-sm);
}

.py-2 {
    padding-top: var(--spacing-md);
    padding-bottom: var(--spacing-md);
}

.px-1 {
    padding-left: var(--spacing-sm);
    padding-right: var(--spacing-sm);
}

.px-2 {
    padding-left: var(--spacing-md);
    padding-right: var(--spacing-md);
}

/* Width */
.w-100 {
    width: 100%;
}

.w-auto {
    width: auto;
}

/* Visibility */
.hidden {
    display: none !important;
}

.visible {
    visibility: visible;
}

.invisible {
    visibility: hidden;
}

/* Border Radius */
.rounded {
    border-radius: var(--radius);
}

.rounded-sm {
    border-radius: var(--radius-sm);
}

.rounded-full {
    border-radius: var(--radius-full);
}

/* Overflow */
.overflow-hidden {
    overflow: hidden;
}

.overflow-auto {
    overflow: auto;
}

/* Spinner Animation (unified) */
.spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(0, 0, 0, 0.1);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.spinner-sm {
    width: 16px;
    height: 16px;
    border-width: 2px;
}

.spinner-lg {
    width: 24px;
    height: 24px;
    border-width: 3px;
}

.spinner-white {
    border-color: rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
}

/* -------------------------------------------
   Responsive (Tablet+)
   ------------------------------------------- */
@media (min-width: 768px) {
    .container {
        max-width: 720px;
    }

    .product-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    /* Ocultar navegación móvil en desktop */
    .bottom-nav {
        display: none;
    }

    body {
        padding-bottom: 0;
    }
}

@media (min-width: 1024px) {
    .container {
        max-width: 960px;
    }

    .product-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* -------------------------------------------
   Switch Toggle
   ------------------------------------------- */
.switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 28px;
    flex-shrink: 0;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

/* Slider MUST be scoped to .switch to prevent layout breaking */
.switch .slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: 0.3s;
    border-radius: 28px;
}

.switch .slider:before {
    position: absolute;
    content: "";
    height: 22px;
    width: 22px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.switch input:checked+.slider {
    background-color: var(--whatsapp);
}

.switch input:checked+.slider:before {
    transform: translateX(22px);
}

.switch-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 4px;
    display: block;
    text-align: center;
}

.switch-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--spacing-md);
}

/* -------------------------------------------
   Product Row (Horizontal Card)
   ------------------------------------------- */
.product-row {
    padding: var(--spacing-sm);
}

.product-row-content {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.product-row-image {
    width: 70px;
    height: 70px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    flex-shrink: 0;
    background: var(--bg-body);
}

.product-row-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.placeholder-image {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-light);
}

.product-row-info {
    flex: 1;
    min-width: 0;
}

.product-row-name {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-main);
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.product-row-price {
    font-size: 1rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 4px;
}

.product-row-actions {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 60px;
}

.product-row-menu {
    display: flex;
    gap: var(--spacing-sm);
    margin-top: var(--spacing-sm);
    padding-top: var(--spacing-sm);
    border-top: 1px solid var(--border-color);
}

.product-row-menu .btn {
    flex: 1;
    width: auto;
}

/* -------------------------------------------
   Image Upload
   ------------------------------------------- */
.image-upload-wrapper {
    width: 100%;
}

.image-upload-label {
    display: block;
    cursor: pointer;
}

.image-preview {
    width: 100%;
    aspect-ratio: 1;
    max-width: 200px;
    margin: 0 auto;
    border: 2px dashed var(--border-color);
    border-radius: var(--radius);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 0.875rem;
    text-align: center;
    transition: border-color 0.2s, background 0.2s;
    overflow: hidden;
    background: var(--bg-body);
}

.image-preview:hover {
    border-color: var(--primary);
    background: rgba(217, 83, 79, 0.05);
}

.image-preview svg {
    margin-bottom: var(--spacing-sm);
    opacity: 0.5;
}

.image-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Current Images (Edit) */
.current-images {
    display: flex;
    gap: var(--spacing-sm);
    flex-wrap: wrap;
}

.current-image-item {
    position: relative;
    width: 80px;
    height: 80px;
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.current-image-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.delete-image-btn {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 24px;
    height: 24px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* -------------------------------------------
   Alerts
   ------------------------------------------- */
.alert {
    padding: var(--spacing-sm) var(--spacing-md);
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
}

.alert-success {
    background: rgba(37, 211, 102, 0.1);
    color: var(--whatsapp-dark);
    border: 1px solid rgba(37, 211, 102, 0.3);
}

.alert-error {
    background: rgba(217, 83, 79, 0.1);
    color: var(--primary);
    border: 1px solid rgba(217, 83, 79, 0.3);
}

/* -------------------------------------------
   Pagination
   ------------------------------------------- */
.pagination-wrapper {
    display: flex;
    justify-content: center;
}

.pagination-wrapper nav {
    display: flex;
    gap: var(--spacing-xs);
}

.pagination-wrapper a,
.pagination-wrapper span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    background: var(--bg-card);
    color: var(--text-main);
    border: 1px solid var(--border-color);
}

.pagination-wrapper a:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.pagination-wrapper span[aria-current="page"] {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* -------------------------------------------
   Floating Elements (Z-Index Hierarchy)
   ------------------------------------------- */

/* Bottom Navigation Bar */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: var(--nav-height);
    background: var(--bg-card);
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: space-around;
    align-items: center;
    z-index: var(--z-nav);
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.05);
}

/* Floating Cart Bar */
.cart-bar,
.floating-cart {
    position: fixed;
    bottom: calc(var(--nav-height) + 10px);
    left: var(--spacing-md);
    right: var(--spacing-md);
    background: var(--primary);
    color: white;
    padding: var(--spacing-md);
    border-radius: var(--radius);
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: var(--z-cart);
    box-shadow: var(--shadow-lg);
}

/* Modal Overlay */
.modal-overlay,
.overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: var(--z-modal);
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Modal Content */
.modal {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: var(--spacing-lg);
    max-width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    z-index: calc(var(--z-modal) + 1);
}

/* Toast Notifications */
.toast {
    position: fixed;
    bottom: calc(var(--nav-height) + 80px);
    left: 50%;
    transform: translateX(-50%);
    background: #333;
    color: white;
    padding: var(--spacing-sm) var(--spacing-lg);
    border-radius: var(--radius-full);
    font-size: 0.875rem;
    z-index: var(--z-toast);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
}

.toast.show {
    opacity: 1;
    visibility: visible;
}

.toast-success {
    background: #28a745;
}

.toast-error {
    background: #dc3545;
}

.toast-warning {
    background: #ffc107;
    color: #333;
}

/* ===========================================
   Owner Toolbar (visible solo para dueño)
   =========================================== */
.owner-toolbar {
    position: sticky;
    top: 0;
    z-index: 1000;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    color: white;
    font-size: 0.8rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.owner-toolbar-left {
    display: flex;
    align-items: center;
}

.owner-toolbar-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(255, 255, 255, 0.15);
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
}

.owner-toolbar-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.owner-toolbar-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 10px;
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.1);
    color: white;
    text-decoration: none;
    font-size: 0.75rem;
    border: none;
    cursor: pointer;
    transition: background 0.2s;
}

.owner-toolbar-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.owner-toolbar-toggle.is-open {
    background: rgba(37, 211, 102, 0.3);
    color: #7fff9b;
}

.owner-toolbar-toggle.is-closed {
    background: rgba(220, 53, 69, 0.3);
    color: #ff8a8a;
}

/* ===========================================
   Edit Overlay Buttons (Edición Visual)
   =========================================== */
.edit-overlay-btn {
    position: absolute;
    bottom: 10px;
    right: 10px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    border: 2px solid white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    z-index: 10;
    opacity: 0.8;
}

.edit-overlay-btn:hover {
    opacity: 1;
    transform: scale(1.1);
    background: var(--primary);
}

.edit-logo-btn {
    width: 28px;
    height: 28px;
    bottom: -5px;
    right: -5px;
}

.edit-product-btn {
    top: 10px;
    right: 10px;
    bottom: auto;
    width: 32px;
    height: 32px;
}

/* ===========================================
   Edit Image Modal
   =========================================== */
.edit-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.edit-modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
}

.edit-modal-content {
    position: relative;
    background: var(--bg-card);
    border-radius: var(--radius);
    width: 90%;
    max-width: 400px;
    max-height: 90vh;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
}

.edit-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    border-bottom: 1px solid var(--border-color);
}

.edit-modal-header h3 {
    margin: 0;
    font-size: 1.1rem;
}

.edit-modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-muted);
    cursor: pointer;
    line-height: 1;
}

.edit-modal-close:hover {
    color: var(--text-main);
}

.edit-modal-body {
    padding: 16px;
}

.edit-image-preview {
    width: 100%;
    height: 180px;
    border: 2px dashed var(--border-color);
    border-radius: var(--radius);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    overflow: hidden;
    background: var(--bg-body);
}

.edit-image-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.edit-image-preview p {
    margin-top: 8px;
    font-size: 0.85rem;
}

.edit-modal-footer {
    display: flex;
    gap: 12px;
    padding: 16px;
    border-top: 1px solid var(--border-color);
}

.edit-modal-footer .btn {
    flex: 1;
}

/* -------------------------------------------
   Toast Notifications
   ------------------------------------------- */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 14px 20px;
    border-radius: var(--radius-sm);
    background: var(--text-main);
    color: white;
    font-size: 0.9rem;
    font-weight: 500;
    box-shadow: var(--shadow-lg);
    z-index: var(--z-toast);
    animation: slideInRight 0.3s ease-out, fadeOut 0.3s ease-in 2.7s forwards;
    max-width: 320px;
    word-wrap: break-word;
}

.notification-success {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
}

.notification-error {
    background: linear-gradient(135deg, #dc3545 0%, #e74c3c 100%);
}

.notification-warning {
    background: linear-gradient(135deg, #ffc107 0%, #fd7e14 100%);
    color: var(--text-main);
}

.notification-info {
    background: linear-gradient(135deg, #17a2b8 0%, #3498db 100%);
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
    }

    to {
        opacity: 0;
    }
}