/* =================================================================
   PROA — estilos estáticos y overrides
   ================================================================= */

/* Variables fallback (se sobreescriben en <style> inline del index.php) */
:root {
    --theme-color-primary: #1F1F1F;
    --theme-color-primary-text: #FFFFFF;
    --theme-color-sidebar-bg: #1A1A1A;
    --theme-color-sidebar-text: #D1D5DB;
    --theme-color-sidebar-hover-bg: #2D2D2D;
    --theme-color-sidebar-hover-text: #FFFFFF;
    --theme-color-background: #F3F4F6;
    --theme-color-primary-rgb: 31, 31, 31;
    --theme-color-primary-light: rgba(31,31,31,0.08);
    --theme-color-primary-dark: #000000;
    --theme-font-family: 'Inter', sans-serif;
}

/* Etiquetas de formulario */
.form-label {
    display: block;
    font-size: 0.75rem;
    line-height: 1rem;
    color: #8e8e8e;
    text-transform: uppercase;
    letter-spacing: 0.025em;
    margin-bottom: 0.25rem;
    font-weight: 400;
}

body {
    font-family: var(--theme-font-family);
    background-color: var(--theme-color-background);
    accent-color: var(--theme-color-primary);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* --------- Botones y colores de marca --------- */
.btn-primary {
    background-color: var(--theme-color-primary);
    color: var(--theme-color-primary-text);
    transition: background-color 0.2s ease-in-out, transform 0.05s ease-in;
}
.btn-primary:hover:not(:disabled) { filter: brightness(115%); }
.btn-primary:active:not(:disabled) { transform: translateY(1px); }
.btn-primary:disabled { opacity: 0.6; cursor: not-allowed; }

.bg-primary       { background-color: var(--theme-color-primary); }
.text-primary     { color: var(--theme-color-primary); }
.text-primary-text{ color: var(--theme-color-primary-text); }
.border-primary   { border-color: var(--theme-color-primary); }

input:focus,
select:focus,
textarea:focus {
    outline: none !important;
    border-color: var(--theme-color-primary) !important;
    box-shadow: 0 0 0 3px rgba(var(--theme-color-primary-rgb), 0.15) !important;
}

/* --------- Sidebar --------- */
#sidebar { background-color: var(--theme-color-sidebar-bg); }
.sidebar-link { color: var(--theme-color-sidebar-text); }
.sidebar-link:hover {
    background-color: var(--theme-color-sidebar-hover-bg);
    color: var(--theme-color-sidebar-hover-text) !important;
}
.sidebar-link-active {
    background-color: var(--theme-color-primary) !important;
    color: var(--theme-color-primary-text) !important;
}

#app-dashboard.sidebar-collapsed .sidebar-link span { display: none; }
#app-dashboard.sidebar-collapsed .sidebar-link { justify-content: center; padding-left: .5rem; padding-right: .5rem; }
#app-dashboard.sidebar-collapsed .sidebar-link > i { width: 1.5rem; height: 1.5rem; }
#app-dashboard.sidebar-collapsed #sidebar-collapse-btn svg { transform: rotate(180deg); }

.logo-expanded  { display: block; }
.logo-collapsed { display: none; }
#app-dashboard.sidebar-collapsed .logo-expanded { display: none; }
#app-dashboard.sidebar-collapsed .logo-collapsed { display: block; }

#app-dashboard:not(.sidebar-collapsed) .logo-container {
    padding: 10px 20px;
    border-radius: 15px;
    border: 1px solid #595959;
}
#app-dashboard.sidebar-collapsed .logo-container {
    width: 48px; height: 48px; padding: 4px;
    border-radius: 8px;
}

@media (min-width: 768px) {
    #app-dashboard.sidebar-collapsed #sidebar { width: 5rem; }
}

#app-dashboard.sidebar-collapsed .sidebar-category-title { display: none; }
#main-nav { overflow-y: auto; }

/* --------- Scrollbars --------- */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: #f1f1f1; }
#main-nav::-webkit-scrollbar-track { background: var(--theme-color-sidebar-bg); }
::-webkit-scrollbar-thumb { background: #888; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #555; }

/* --------- Categorías del header --------- */
#category-nav-header {
    display: flex;
    align-items: flex-end;
    flex-wrap: wrap;
    margin-left: 1rem;
    height: 100%;
    padding-top: 10px;
    border-bottom: 1px solid #e5e7eb;
}
.category-link {
    display: flex;
    align-items: center;
    padding: 0.5rem 1rem;
    margin-right: 0.5rem;
    font-size: 0.9rem;
    font-weight: 500;
    color: #6b7280;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all 0.2s ease-in-out;
    border-top-left-radius: 10px;
    border-top-right-radius: 10px;
}
.category-link:hover { color: #111827; background-color: #f3f4f6; }
.category-link.active {
    color: var(--theme-color-primary);
    font-weight: 600;
    background-color: var(--theme-color-background);
    border-color: #e5e7eb;
    border-bottom-color: var(--theme-color-background);
    margin-bottom: -1px;
}
.category-link.active i { color: var(--theme-color-primary); }

@media (max-width: 767px) {
    #category-nav-header { display: none; }
    .sidebar-category-title { display: block !important; }
}

/* --------- Modales --------- */
.modal-overlay   { transition: opacity 0.3s ease; opacity: 1; }
.modal-container { transition: transform 0.3s ease, opacity 0.3s ease; }
.modal-hidden    { display: none; }
#app-modal.modal-open .modal-overlay   { opacity: 1; }
#app-modal.modal-open .modal-container { opacity: 1; transform: scale(1); }

.alert-modal-overlay { transition: opacity 0.2s ease; }
#alert-modal.modal-enter .alert-modal-container { transform: scale(0.95); opacity: 0; }
#alert-modal.modal-leave .alert-modal-container { transform: scale(0.95); opacity: 0; transition: transform 0.2s ease, opacity 0.2s ease; }

/* --------- Toasts --------- */
.toast { transition: transform 0.3s ease, opacity 0.3s ease; }
.toast-enter    { opacity: 0; transform: translateX(100%); }
.toast-leave-to { opacity: 0; transform: translateX(100%); }

/* --------- Tabs --------- */
.tabs-nav { display: flex; border-bottom: 1px solid #e5e7eb; }
.tab-link {
    padding: 0.5rem 1rem;
    margin-bottom: -1px;
    font-size: 0.875rem;
    font-weight: 500;
    color: #6b7280;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    display: flex; align-items: center;
    border: 1px solid #cccbcb;
    border-radius: 10px 10px 0 0;
    margin-right: 5px;
    margin-top: 10px;
}
.tab-link:hover  { color: #374151; }
.tab-link.active {
    color: var(--theme-color-primary);
    border-color: var(--theme-color-primary);
}
.tab-link > svg { margin-right: 0.4rem; width: 0.875rem; height: 0.875rem; }
.tabs-content > .tab-pane { display: none; }
.tabs-content > .tab-pane.active { display: grid; }
.tabs-content { padding-top: 1.5rem; }

/* --------- Paginación --------- */
.pagination-btn:disabled { cursor: not-allowed; }

/* =================================================================
   Módulo EMISIÓN DE TICKETS — estilos específicos del POS
   ================================================================= */

/* Grid de 9 botones de tipos de ticket */
.tt-button {
    aspect-ratio: 1 / 1;
    min-height: 96px;
    border-radius: 14px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 0.5rem;
    cursor: pointer;
    user-select: none;
    border: 2px solid rgba(0,0,0,0.06);
    transition: transform 0.08s ease-out, box-shadow 0.15s ease, filter 0.15s ease;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    text-align: center;
}
.tt-button:hover:not(.tt-disabled)  { transform: translateY(-2px); box-shadow: 0 8px 16px rgba(0,0,0,0.08); filter: brightness(1.02); }
.tt-button:active:not(.tt-disabled) { transform: translateY(0); filter: brightness(0.97); }
.tt-button .tt-letter {
    font-family: 'Inter', sans-serif;
    font-weight: 800;
    font-size: 2.25rem;
    line-height: 1;
    margin-bottom: 0.25rem;
}
.tt-button .tt-name    { font-size: 0.8rem; font-weight: 600; }
.tt-button .tt-price   { font-size: 0.8rem; font-weight: 500; opacity: 0.85; margin-top: 0.15rem; }
.tt-button.tt-disabled { opacity: 0.35; cursor: not-allowed; filter: grayscale(30%); background: #F5F5F5 !important; color: #9CA3AF !important; border-style: dashed; }
.tt-button.tt-disabled .tt-letter { color: #9CA3AF; }

/* Carrito del POS */
.pos-cart-item {
    display: grid;
    grid-template-columns: auto 1fr auto auto;
    align-items: center;
    gap: .5rem;
    padding: .5rem .75rem;
    border-radius: 8px;
    transition: background-color .15s ease;
}
.pos-cart-item:hover { background-color: #F9FAFB; }

.pos-total {
    background: linear-gradient(135deg, #E8F5E9 0%, #C8E6C9 100%);
    border: 2px solid #81C784;
    color: #1B5E20;
    padding: 1rem 1.25rem;
    border-radius: 12px;
    font-size: 1.5rem;
    font-weight: 700;
    text-align: right;
}

.pos-header {
    background: linear-gradient(135deg, #1F1F1F, #2D2D2D);
    color: #FFFFFF;
    padding: 0.75rem 1rem;
    border-radius: 12px;
}
