:root {
    --primary-color: #003366;
    --secondary-color: #007bff;
    --accent-color: #25D366;
    --background-light: #f4f6f9;
    --text-dark: #333;
    --card-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: var(--background-light);
    color: var(--text-dark);
}

/* Header & Nav */
header {
    background: white;
    padding: 0; /* Padding moved to container */
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    display: flex;
    justify-content: center; /* Center the container */
    align-items: center;
    position: relative;
    z-index: 100;
    height: 80px; /* Slightly taller */
    border-bottom: 1px solid #eee;
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 95%; /* Use most of the width */
    max-width: 1400px;
    height: 100%;
}

.logo img {
    height: 50px; /* Ensure logo size */
    object-fit: contain;
}

.main-nav ul {
    display: flex;
    list-style: none;
    gap: 30px;
    margin: 0;
    padding: 0;
}

.main-nav > ul > li {
    position: relative;
    padding: 25px 0; /* Para que el hover no se pierda al bajar */
}

.main-nav a {
    text-decoration: none;
    color: #444;
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.main-nav a i {
    font-size: 0.7rem;
    margin-left: 2px;
}

/* Dropdown Menu Style */
.dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: white;
    min-width: 220px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    border-radius: 0 0 4px 4px;
    padding: 10px 0;
    z-index: 200;
    border-top: 2px solid var(--secondary-color);
}

.main-nav li:hover .dropdown-menu {
    display: block;
}

.dropdown-menu li {
    padding: 0;
}

.dropdown-menu a {
    padding: 10px 20px;
    color: #555;
    font-size: 0.8rem;
    text-transform: none;
    display: block;
    transition: background 0.2s, color 0.2s;
}

.dropdown-menu a:hover {
    background: #f5f5f5;
    color: var(--secondary-color);
}

.main-nav a:hover, .main-nav a.active {
    color: var(--primary-color);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 20px;
    flex: 0 0 auto;
    margin-left: 40px;
}

.tc-display {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    border-radius: 999px;
    border: 1px solid rgba(0, 34, 68, 0.18);
    background: rgba(0, 51, 102, 0.06);
    color: #002244;
    font-size: 0.85rem;
    font-weight: 600;
    line-height: 1;
    white-space: nowrap;
}

.icon-btn {
    background: none;
    border: none;
    font-size: 2rem; /* Aumentado significativamente */
    cursor: pointer;
    color: #002244; /* Azul muy oscuro para máximo contraste */
    position: relative;
    padding: 8px;
    transition: transform 0.2s, color 0.2s;
}

.icon-btn:hover {
    color: var(--secondary-color);
    transform: scale(1.1);
}

.cart-count {
    position: absolute;
    top: -5px;
    right: -5px;
    background: var(--primary-color);
    color: white;
    font-size: 0.7rem;
    padding: 2px 6px;
    border-radius: 50%;
}

/* Hero Section */
.hero {
    background: linear-gradient(135deg, var(--primary-color) 0%, #004c99 100%);
    color: white;
    padding: 60px 20px;
    text-align: center;
    margin-bottom: 40px;
    position: relative;
    overflow: hidden;
}

.hero::after {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: url('https://www.transparenttextures.com/patterns/cubes.png');
    opacity: 0.1;
    pointer-events: none;
}

.hero h1 { 
    font-size: 2.5rem; 
    margin-bottom: 15px; 
    font-weight: 800;
}
.hero p { 
    font-size: 1.1rem; 
    margin-bottom: 30px; 
    opacity: 0.9; 
    max-width: 700px;
    margin-left: auto; 
    margin-right: auto;
}

.search-bar {
    display: flex;
    max-width: 450px; /* Reducido para pantallas grandes */
    margin: 0 auto;
    position: relative;
    width: 80%; /* Reducido en móvil */
}

@media (min-width: 768px) {
    .search-bar {
        width: 40%; /* Más compacto en desktop */
        max-width: 500px;
    }
}

.search-bar input {
    width: 100%;
    padding: 12px 20px;
    border: none;
    border-radius: 25px 0 0 25px;
    outline: none;
    font-size: 1rem;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.search-bar button {
    background: var(--secondary-color);
    color: white;
    border: none;
    padding: 0 25px;
    border-radius: 0 25px 25px 0;
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    transition: background 0.2s;
}

.search-bar button:hover {
    background: #0056b3;
}

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

.cart-icon {
    position: relative;
    font-size: 1.2rem;
    cursor: pointer;
    color: var(--primary-color);
}

.cart-count {
    position: absolute;
    top: -8px;
    right: -8px;
    background: red;
    color: white;
    font-size: 0.7rem;
    padding: 2px 6px;
    border-radius: 50%;
}

/* Config Panel */
.config-panel {
    display: none;
    position: absolute;
    top: 70px;
    right: 20px;
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
    z-index: 200;
    width: 300px;
}

.config-panel.active { display: block; }

.form-group { margin-bottom: 15px; }
.form-group label { display: block; margin-bottom: 5px; font-size: 0.9rem; color: #555; }
.form-group input { width: 100%; padding: 8px; border: 1px solid #ddd; border-radius: 4px; }

.action-btn {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 10px 15px;
    border-radius: 5px;
    cursor: pointer;
    width: 100%;
}

.mini-btn {
    background: #eee;
    border: none;
    padding: 5px 10px;
    border-radius: 4px;
    cursor: pointer;
}

/* Main Layout Strict */
.main-layout {
    display: flex !important;
    flex-direction: row !important;
    align-items: flex-start !important;
    gap: 15px; /* Reducido de 20px */
    padding: 15px 1%; /* Reducido padding lateral */
    max-width: 1920px;
    margin: 0 auto;
    width: 99%; /* Aumentado para usar más pantalla */
}

/* Sidebar Fixed Width - Ultra Compact */
.filters-sidebar {
    width: 190px;
    background: white;
    padding: 8px; /* Reducido */
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    height: fit-content;
    position: sticky;
    top: 90px;
    max-height: calc(100vh - 100px);
    overflow-y: auto;
    font-size: 0.8rem; /* Fuente base reducida */
}

/* Collapse Logic */
.filter-options {
    max-height: 300px;
    overflow-y: auto;
    overflow-x: hidden;
    transition: max-height 0.3s ease-out, opacity 0.3s ease-out, padding 0.3s;
    opacity: 1;
}

.filter-section.collapsed .filter-options {
    max-height: 0 !important;
    opacity: 0;
    overflow: hidden;
    padding: 0;
    margin: 0;
}

.filter-section.collapsed .filter-title i {
    transform: rotate(-90deg);
}

.filter-title i {
    transition: transform 0.2s;
}

.filter-section {
    margin-bottom: 5px; /* Más compacto */
    padding-bottom: 5px; /* Más compacto */
    border-bottom: 1px solid #eee;
}

.filter-title {
    font-size: 0.75rem; /* Fuente más pequeña */
    font-weight: 700;
    margin-bottom: 3px;
    color: var(--primary-color);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    padding: 2px 0;
}

.filter-options {
    max-height: 200px; /* Reducido altura máxima */
    overflow-y: auto;
    padding-right: 5px;
}

.filter-item {
    display: flex;
    align-items: center;
    margin-bottom: 2px; /* Ultra compacto */
    font-size: 0.7rem; /* Fuente más pequeña */
    color: #555;
    line-height: 1.1;
}

.filter-item input {
    margin-right: 5px;
    accent-color: var(--secondary-color);
    transform: scale(0.8); /* Checkbox más pequeño */
}

.btn-buscar-filtros {
    background: var(--secondary-color);
    color: white;
    width: 100%;
    padding: 4px; /* Ultra compacto */
    border: none;
    border-radius: 12px; 
    font-weight: 600;
    font-size: 0.7rem; /* Fuente más pequeña */
    cursor: pointer;
    margin-top: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.btn-buscar-filtros:hover {
    background: #0056b3;
}

/* Estilos para el Carrito Tipo Drawer (Lateral) */
.side-drawer {
    position: absolute;
    top: 0;
    right: -450px; /* Hidden initially */
    width: 400px;
    height: 100vh;
    background: white;
    box-shadow: -5px 0 15px rgba(0,0,0,0.1);
    transition: right 0.3s ease-in-out;
    display: flex;
    flex-direction: column;
}

#cart-modal {
    display: block; 
    background: rgba(0,0,0,0.5);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
    z-index: 1000;
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
}

/* Sort & Controls Bar */
.sort-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: transparent;
    padding: 10px 0;
    margin-bottom: 20px;
    box-shadow: none;
    border-bottom: 1px solid #eee;
}

.sort-controls h2 {
    display: none; /* Ocultar título redundante */
}

.pagination-info {
    font-size: 0.9rem;
    color: #333;
    font-weight: 600;
}

.controls-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.view-toggles {
    display: flex;
    gap: 5px;
    border-right: 1px solid #eee;
    padding-right: 20px;
}

.view-btn {
    background: transparent;
    border: none;
    padding: 5px;
    color: #999;
    font-size: 1.1rem;
    cursor: pointer;
}

.view-btn.active {
    color: #333;
    background: transparent;
    border: none;
}

.sort-select-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
}

.sort-select-wrapper label {
    font-size: 0.85rem;
    color: #333;
    font-weight: 600;
}

.sort-select-wrapper select {
    padding: 5px;
    border: none;
    background: transparent;
    font-size: 0.85rem;
    color: #333;
    font-weight: 600;
    cursor: pointer;
    text-align: right;
}

/* Product Grid */
.products-container {
    flex: 1;
}

#cart-modal.active {
    opacity: 1;
    pointer-events: auto;
}

#cart-modal.active .side-drawer {
    right: 0; /* Deslizar adentro */
}

.cart-header {
    padding: 20px;
    background: var(--primary-color);
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.cart-header h3 { margin: 0; color: white; font-size: 1.2rem; }
.cart-header .close { color: white; opacity: 0.8; font-size: 1.5rem; }

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

.cart-total-section {
    padding: 20px;
    background: #f9f9f9;
    border-top: 1px solid #eee;
}

.quotation-form {
    padding: 20px;
    background: white;
    border-top: 1px solid #eee;
}

/* Modal Redesign (Referencia TP-Link) */
.modal-content.detail-content {
    width: 95%;
    max-width: 900px; /* Ancho ajustado */
    height: auto;
    max-height: 90vh;
    border-radius: 8px;
    padding: 0;
    background: white;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

#product-detail-body {
    overflow-y: auto;
}

#tech-specs-container {
    max-height: 45vh;
    overflow-y: auto;
    padding-right: 8px;
}

.detail-container {
    display: flex;
    flex-wrap: nowrap;
    height: auto;
    overflow-y: auto; /* Scroll si es necesario */
}

.detail-left {
    flex: 1.2;
    padding: 40px;
    background: #fff;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    position: relative;
}

.detail-right {
    flex: 1;
    padding: 40px 30px;
    background: #fff;
    display: flex;
    flex-direction: column;
    border-left: 1px solid #f0f0f0;
}

/* Imagen Principal Grande */
#main-detail-img {
    max-height: 400px;
    width: auto;
    max-width: 100%;
    object-fit: contain;
}

/* Galería Miniaturas */
.detail-gallery {
    margin-top: 20px;
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
    position: absolute; /* Flotante abajo a la izquierda */
    bottom: 20px;
    left: 20px;
}

.gallery-thumb {
    width: 50px;
    height: 50px;
    object-fit: contain;
    border: 1px solid #ddd;
    border-radius: 2px;
    cursor: pointer;
    padding: 2px;
}

.gallery-thumb:hover {
    border-color: #003366;
}

/* Título y Precio Derecha */
.detail-right h2 {
    font-size: 1.6rem;
    font-weight: 600;
    color: #333;
    line-height: 1.3;
    margin-bottom: 15px;
}

.detail-brand-logo {
    max-height: 30px;
    margin-bottom: 10px;
}

.detail-meta {
    font-size: 0.85rem;
    color: #888;
    margin-bottom: 20px;
    border-bottom: 1px solid #eee;
    padding-bottom: 15px;
}

.detail-price {
    font-size: 2.2rem;
    font-weight: 700;
    color: #333;
    margin-bottom: 5px;
}

.detail-iva {
    font-size: 1rem;
    font-weight: 400;
    color: #666;
}

.detail-stock-section {
    margin-top: 20px;
}

.detail-stock-title {
    font-weight: 600;
    margin-bottom: 10px;
    font-size: 1rem;
}

/* Radio Buttons Estilizados para Almacén */
.stock-radio-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.stock-option {
    display: flex;
    align-items: center;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
}

.stock-option:hover {
    border-color: #bbb;
}

.stock-option input[type="radio"] {
    margin-right: 10px;
    accent-color: #333;
    transform: scale(1.2);
}

.stock-label {
    flex: 1;
    font-weight: 600;
    color: #333;
}

.stock-qty {
    background: #e8f5e9;
    color: #2e7d32;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.85rem;
    font-weight: 600;
}

.stock-qty.empty {
    background: #ffebee;
    color: #c62828;
}

.detail-specs {
    padding: 30px 40px;
    background: #fcfcfc;
    border-top: 1px solid #eee;
}

@media (max-width: 768px) {
    .detail-container {
        flex-direction: column;
    }
    .detail-left {
        padding: 20px;
        border-right: none;
        border-bottom: 1px solid #eee;
    }
    .detail-right {
        padding: 20px;
        border-left: none;
    }
    .detail-gallery {
        position: static;
        margin-top: 15px;
    }
}

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

/* View Toggles */
.view-toggles {
    display: flex;
    gap: 10px;
}

.view-btn {
    background: white;
    border: 1px solid #ddd;
    padding: 8px 12px;
    border-radius: 4px;
    cursor: pointer;
    color: #666;
    transition: all 0.2s;
}

.view-btn.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

/* Products Grid Responsive (Auto-fill) */
.products-grid {
    display: grid;
    /* Ajuste automático según resolución: mínimo 200px por tarjeta (más pequeño para ver más) */
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); 
    gap: 12px; /* Gap reducido */
    padding-bottom: 40px;
}

@media (max-width: 768px) {
    .main-layout {
        flex-direction: column !important;
    }
    .filters-sidebar {
        width: 100% !important;
        position: relative;
        top: 0;
        height: auto;
    }
    .products-container {
        width: 100% !important;
    }
}

/* Card Style Mercado Libre-ish */
.product-card {
    border: 1px solid #f0f0f0;
    border-radius: 8px;
    padding: 10px; /* Padding reducido */
    background: white;
    position: relative;
    box-shadow: none;
    display: flex;
    flex-direction: column;
    text-align: left;
    transition: box-shadow 0.2s;
    height: 100%;
}

.product-image {
    width: 100%;
    height: 160px; /* Altura reducida */
    object-fit: contain;
    margin-bottom: 10px;
}

.product-title {
    font-size: 0.85rem; /* Fuente más pequeña */
    line-height: 1.3;
    height: 36px; /* Altura fija para 2 líneas */
    overflow: hidden;
    margin-bottom: 5px;
    color: #333;
}

.price-container {
    margin-top: 5px;
    margin-bottom: 8px;
}

.price {
    font-size: 1.1rem; /* Precio ajustado */
    font-weight: 600;
    color: #333;
}
.product-card:hover {
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

/* Estilos limpios para botones de tarjeta */
.btn-ver-detalle:hover {
    background: #f0f0f0 !important;
}

.btn-add-cart:hover {
    opacity: 0.9;
}

.btn-buy-now:hover {
    opacity: 0.9;
}

/* Paginación */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-top: 40px;
    padding: 20px 0;
}

.pagination-numbers {
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-page {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #e0e0e0;
    background: white;
    border-radius: 50%;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s;
    color: #555;
}

.btn-page:hover {
    border-color: var(--secondary-color);
    color: var(--secondary-color);
}

.btn-page.active {
    background: var(--secondary-color);
    color: white;
    border-color: var(--secondary-color);
}

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

/* Modal Backdrop Fix */
.modal-backdrop {
    display: none;
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 2000;
}

.modal-container {
    display: none;
    position: fixed;
    z-index: 3000;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    width: 90%;
    max-width: 400px;
}

#auth-forms {
    text-align: center;
}

#auth-forms h2 {
    margin-bottom: 20px;
    color: var(--primary-color);
}

#auth-forms .form-group {
    text-align: left;
    margin-bottom: 15px;
}

#auth-forms input {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

#auth-forms button {
    width: 100%;
    padding: 12px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 4px;
    font-weight: bold;
    cursor: pointer;
    margin-top: 10px;
}

#auth-forms button:hover {
    background: #002244;
}

#auth-forms a {
    color: var(--secondary-color);
    text-decoration: none;
    font-weight: 600;
}

/* User Menu Dropdown */
.user-menu-wrapper {
    display: flex;
    align-items: center;
}

.user-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    background: white;
    min-width: 220px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    border-radius: 8px;
    padding: 0;
    z-index: 1000;
    border: 1px solid #eee;
    margin-top: 15px;
    overflow: hidden;
}

.user-dropdown::before {
    content: '';
    position: absolute;
    top: -6px;
    right: 14px;
    width: 12px;
    height: 12px;
    background: white;
    transform: rotate(45deg);
    border-top: 1px solid #eee;
    border-left: 1px solid #eee;
    z-index: 1001;
}

.user-info-header {
    padding: 15px;
    background-color: #f8f9fa;
    border-bottom: 1px solid #eee;
}

.user-menu-list {
    list-style: none;
    padding: 5px 0;
    margin: 0;
}

.user-menu-list li a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 15px;
    color: #333;
    text-decoration: none;
    transition: background 0.2s;
    font-size: 0.9rem;
}

.user-menu-list li a:hover {
    background-color: #f0f0f0;
}

/* Estado Logueado */
.icon-btn.logged-in {
    color: var(--secondary-color);
}

.icon-btn.logged-in::after {
    content: '';
    position: absolute;
    bottom: 5px;
    right: 5px;
    width: 8px;
    height: 8px;
    background: #28a745;
    border-radius: 50%;
    border: 1px solid white;
}

/* Toast Notification System */
#toast-container {
    position: fixed;
    top: 20px;
    right: 20px; /* Changed to right for better visibility */
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    background: white;
    min-width: 300px;
    padding: 15px 20px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    display: flex;
    align-items: center;
    gap: 15px;
    border-left: 5px solid #ccc;
    font-size: 0.95rem;
    color: #333;
    opacity: 0;
    transform: translateX(100%);
    transition: all 0.3s ease-out;
}

.toast.show {
    opacity: 1;
    transform: translateX(0);
}

.toast.success { border-left-color: var(--accent-color); }
.toast.success i { color: var(--accent-color); }

.toast.error { border-left-color: #d32f2f; }
.toast.error i { color: #d32f2f; }

.toast.warning { border-left-color: #f57c00; }
.toast.warning i { color: #f57c00; }

.toast.info { border-left-color: var(--secondary-color); }
.toast.info i { color: var(--secondary-color); }

.toast span {
    flex: 1;
    font-weight: 500;
}

.toast-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease-out;
    padding: 20px;
}

.toast-modal-overlay.show {
    opacity: 1;
    pointer-events: auto;
}

.toast-modal {
    width: min(520px, 92vw);
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 12px 40px rgba(0,0,0,0.25);
    display: flex;
    gap: 14px;
    padding: 18px 18px;
    border-top: 6px solid var(--secondary-color);
}

.toast-modal-icon {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.04);
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
}

.toast-modal-icon i {
    font-size: 1.2rem;
    color: var(--secondary-color);
}

.toast-modal-content {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.toast-modal-message {
    font-size: 1rem;
    color: #222;
    font-weight: 600;
    line-height: 1.35;
}

.toast-modal-actions {
    display: flex;
    justify-content: flex-end;
}

.toast-modal-btn {
    width: auto;
    padding: 10px 16px;
}

.toast-modal-success { border-top-color: var(--accent-color); }
.toast-modal-success .toast-modal-icon i { color: var(--accent-color); }

.toast-modal-error { border-top-color: #d32f2f; }
.toast-modal-error .toast-modal-icon i { color: #d32f2f; }

.toast-modal-warning { border-top-color: #f57c00; }
.toast-modal-warning .toast-modal-icon i { color: #f57c00; }

.toast-modal-info { border-top-color: var(--secondary-color); }
.toast-modal-info .toast-modal-icon i { color: var(--secondary-color); }

.confirm-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: 10001;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease-out;
    padding: 20px;
}

.confirm-modal-overlay.show {
    opacity: 1;
    pointer-events: auto;
}

.confirm-modal {
    width: min(520px, 92vw);
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 12px 40px rgba(0,0,0,0.25);
    display: flex;
    gap: 14px;
    padding: 18px 18px;
    border-top: 6px solid var(--secondary-color);
}

.confirm-modal-icon {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.04);
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
}

.confirm-modal-icon i {
    font-size: 1.2rem;
    color: var(--secondary-color);
}

.confirm-modal-content {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.confirm-modal-message {
    font-size: 1rem;
    color: #222;
    font-weight: 600;
    line-height: 1.35;
}

.confirm-modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.confirm-modal-success { border-top-color: var(--accent-color); }
.confirm-modal-success .confirm-modal-icon i { color: var(--accent-color); }

.confirm-modal-error { border-top-color: #d32f2f; }
.confirm-modal-error .confirm-modal-icon i { color: #d32f2f; }

.confirm-modal-warning { border-top-color: #f57c00; }
.confirm-modal-warning .confirm-modal-icon i { color: #f57c00; }

.confirm-modal-info { border-top-color: var(--secondary-color); }
.confirm-modal-info .confirm-modal-icon i { color: var(--secondary-color); }

/* Order History Styles */
.history-list {
    background: #f9f9f9;
}

.order-card {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    margin-bottom: 15px;
    overflow: hidden;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.order-header {
    background: #fff;
    padding: 15px;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.order-id {
    font-weight: 700;
    color: var(--primary-color);
    margin-right: 10px;
}

.order-date {
    color: #666;
    font-size: 0.9rem;
}

.order-status {
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
}

.status-pending { background: #fff3cd; color: #f57c00; }
.status-paid { background: #d4edda; color: #155724; }
.status-shipped { background: #cce5ff; color: #004085; }
.status-completed { background: #e8f5e9; color: #1b5e20; }
.status-cancelled { background: #ffebee; color: #b71c1c; }
.status-invoice { background: #ede7f6; color: #4527a0; }

.admin-panel {
    display: block;
    width: 100%;
}

.admin-layout {
    display: flex;
    gap: 16px;
    align-items: stretch;
    padding: 18px 0;
}

.admin-sidebar {
    width: 260px;
    min-width: 260px;
    background: #fff;
    border: 1px solid #eee;
    border-radius: 12px;
    padding: 14px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 2px 6px rgba(0,0,0,0.04);
}

.admin-sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 12px;
    border-bottom: 1px solid #f0f0f0;
    margin-bottom: 12px;
}

.admin-content {
    flex: 1;
    min-width: 0;
}

.admin-card {
    width: min(720px, 100%);
    background: #fff;
    border: 1px solid #eee;
    border-radius: 10px;
    padding: 16px 16px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.04);
}

.admin-toolbar {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

.admin-nav {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 0;
}

.admin-tab {
    padding: 10px 12px;
    border-radius: 8px;
    border: 1px solid #d7d7d7;
    background: #fff;
    cursor: pointer;
    font-weight: 800;
    color: #003366;
    text-align: left;
    width: 100%;
}

.admin-tab.active {
    background: var(--secondary-color);
    border-color: var(--secondary-color);
    color: #fff;
}

.admin-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.admin-input {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.95rem;
}

body.admin-mode #shop-hero,
body.admin-mode #shop-main,
body.admin-mode #cart-modal,
body.admin-mode .whatsapp-float {
    display: none !important;
}

body.admin-mode #admin-main {
    display: block !important;
}

body:not(.admin-mode) #admin-main {
    display: none !important;
}

body.admin-mode #btn-cart,
body.admin-mode #btn-header-search,
body.admin-mode .user-menu-wrapper {
    display: none !important;
}

.admin-toolbar-left {
    display: flex;
    gap: 10px;
    align-items: flex-end;
}

.admin-toolbar-right {
    display: flex;
    gap: 10px;
    align-items: center;
}

.admin-logout-btn {
    width: 100%;
    border-color: #d32f2f !important;
    color: #d32f2f !important;
}

.admin-subtitle {
    font-weight: 900;
    color: #003366;
    margin: 6px 0 10px 0;
}

.admin-billing-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.pdf-modal-content {
    overflow: hidden;
}

@media (max-width: 980px) {
    .admin-layout {
        flex-direction: column;
    }
    .admin-sidebar {
        width: 100%;
        min-width: 0;
        flex-direction: row;
        gap: 12px;
        align-items: center;
    }
    .admin-sidebar-header {
        border-bottom: none;
        margin-bottom: 0;
        padding-bottom: 0;
    }
    .admin-nav {
        flex-direction: row;
        gap: 10px;
        flex: 1;
    }
    .admin-tab {
        text-align: center;
        width: auto;
        flex: 1;
    }
    .admin-billing-grid {
        grid-template-columns: 1fr;
    }
}

.admin-order-meta {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px 12px;
    padding: 12px 15px;
    border-top: 1px solid #f0f0f0;
    background: #fff;
}

.admin-order-meta div {
    font-size: 0.88rem;
    color: #444;
}

.admin-order-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    padding: 12px 15px 15px 15px;
    background: #fff;
}

.admin-action-btn {
    padding: 10px 12px;
    border-radius: 6px;
    border: 1px solid #d7d7d7;
    background: #fff;
    cursor: pointer;
    font-weight: 700;
    font-size: 0.88rem;
}

.admin-action-btn:hover {
    background: #f3f3f3;
}

.admin-action-primary {
    background: var(--secondary-color);
    border-color: var(--secondary-color);
    color: #fff;
}

.admin-action-primary:hover {
    filter: brightness(0.95);
}

.order-items {
    padding: 15px;
}

.order-item-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid #f9f9f9;
}

.order-item-row:last-child {
    border-bottom: none;
}

.order-footer {
    padding: 15px;
    background: #fcfcfc;
    border-top: 1px solid #f0f0f0;
    text-align: right;
    font-weight: 600;
    color: #333;
}

.order-total {
    font-size: 1.1rem;
    margin-left: 10px;
    color: var(--primary-color);
}

.profile-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
}

.profile-card {
    border: 1px solid #eee;
    border-radius: 10px;
    background: #fff;
    overflow: hidden;
}

.profile-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px;
    background: #f8f9fa;
    border-bottom: 1px solid #eee;
}

.profile-card-title {
    font-weight: 700;
    color: #003366;
}

.btn-small {
    padding: 8px 10px;
    border-radius: 6px;
    border: 1px solid #d7d7d7;
    background: #fff;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.85rem;
}

.btn-small:hover {
    background: #f3f3f3;
}

.profile-table {
    width: 100%;
    border-collapse: collapse;
}

.profile-table tr + tr {
    border-top: 1px solid #f0f0f0;
}

.profile-td-key {
    width: 45%;
    padding: 10px 14px;
    color: #444;
    background: #fcfcfc;
    font-weight: 600;
}

.profile-td-val {
    padding: 10px 14px;
    color: #222;
    text-align: right;
}

.profile-card form {
    padding: 12px 14px 16px 14px;
}

.profile-actions {
    display: flex;
    gap: 10px;
    margin-top: 12px;
}

.btn-ghost {
    width: 100%;
    padding: 12px;
    background: #f0f0f0;
    color: #333;
    border: none;
    border-radius: 4px;
    font-weight: 700;
    cursor: pointer;
}

.btn-ghost:hover {
    background: #e7e7e7;
}

@media (max-width: 900px) {
    .profile-grid {
        grid-template-columns: 1fr;
    }
    .profile-td-val {
        text-align: left;
    }
}

.profile-modal-content {
    max-width: 980px;
    width: 95%;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
}

/* History Modal Specifics */
.history-modal-content {
    max-width: 800px;
    width: 95%;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
}

#history-list {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background-color: #f8f9fa;
}
