/* ===== ZURXSTORE RESPONSIVE CSS UNIVERSAL ===== */
/* Este archivo se aplica a TODOS los archivos del proyecto */

/* Variables CSS para consistencia */
:root {
    --primary-color: #ff0040;
    --primary-gradient: linear-gradient(45deg, #ff0040, #ff0080);
    --secondary-color: #00ff00;
    --background-gradient: linear-gradient(135deg, #000000 0%, #1a0000 100%);
    --card-bg: rgba(255, 0, 64, 0.1);
    --border-color: #ff0040;
    --text-color: #fff;
    --text-muted: #ccc;
    --success-color: #00ff00;
    --error-color: #ff0000;
    --shadow-primary: 0 2px 20px rgba(255, 0, 64, 0.3);
    --shadow-hover: 0 10px 30px rgba(255, 0, 64, 0.3);
    --border-radius: 10px;
    --border-radius-large: 15px;
    --border-radius-button: 25px;
    --transition: all 0.3s ease;
}

/* Reset y base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Arial', sans-serif;
    background: var(--background-gradient);
    color: var(--text-color);
    min-height: 100vh;
    line-height: 1.6;
}

/* Contenedores principales */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

.main-content {
    padding: 2rem;
}

/* Headers y títulos */
h1, h2, h3, h4, h5, h6 {
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.page-title {
    text-align: center;
    color: var(--primary-color);
    margin-bottom: 3rem;
    font-size: 2.5rem;
}

/* Navegación y sidebar */
.header {
    background: rgba(255, 0, 0, 0.1);
    padding: 1rem;
    border-bottom: 2px solid var(--border-color);
    box-shadow: var(--shadow-primary);
}

.nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    flex-wrap: wrap;
    gap: 1rem;
}

.logo {
    display: flex;
    align-items: center;
    font-size: 1.8rem;
    font-weight: bold;
    color: var(--primary-color);
}

.logo img {
    height: 40px;
    margin-right: 10px;
    border-radius: 8px;
}

.nav-links {
    display: flex;
    gap: 1rem;
    align-items: center;
    flex-wrap: wrap;
}

.nav-links a {
    color: var(--text-color);
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 5px;
    transition: var(--transition);
    white-space: nowrap;
}

.nav-links a:hover {
    background: var(--primary-color);
    box-shadow: 0 0 15px rgba(255, 0, 64, 0.5);
}

/* Sidebar para admin */
.sidebar {
    width: 280px;
    background: rgba(255, 0, 0, 0.1);
    border-right: 2px solid var(--border-color);
    box-shadow: var(--shadow-primary);
    padding: 2rem 0;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    z-index: 1000;
}

.sidebar .nav-links {
    flex-direction: column;
    gap: 0.5rem;
}

.sidebar .nav-links a {
    padding: 1rem 2rem;
    border-left: 3px solid transparent;
    border-radius: 0;
}

.sidebar .nav-links a:hover,
.sidebar .nav-links a.active {
    background: rgba(255, 0, 64, 0.2);
    border-left: 3px solid var(--border-color);
    box-shadow: inset 0 0 15px rgba(255, 0, 64, 0.3);
}

.main-content.with-sidebar {
    margin-left: 280px;
}

/* Formularios */
.form-section {
    background: var(--card-bg);
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius-large);
    padding: 2rem;
    margin-bottom: 2rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--primary-color);
    font-weight: bold;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 1rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.5);
    color: var(--text-color);
    font-size: 1rem;
    transition: var(--transition);
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 10px rgba(255, 0, 64, 0.3);
}

.form-group textarea {
    resize: vertical;
    min-height: 120px;
}

/* Botones */
.btn {
    background: var(--primary-gradient);
    color: white;
    border: none;
    padding: 0.8rem 1.5rem;
    border-radius: var(--border-radius-button);
    cursor: pointer;
    font-weight: bold;
    font-size: 1rem;
    transition: var(--transition);
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

.btn:hover {
    transform: scale(1.05);
    box-shadow: 0 5px 20px rgba(255, 0, 64, 0.4);
}

.btn:disabled {
    background: #666;
    cursor: not-allowed;
    transform: none;
}

.btn-full {
    width: 100%;
}

.btn-danger {
    background: linear-gradient(45deg, #ff0000, #cc0000);
}

.btn-success {
    background: linear-gradient(45deg, #00ff00, #00cc00);
    color: black;
}

/* Cards y productos */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.product-card,
.card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.product-card:hover,
.card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
}

.product-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 1rem;
}

.product-name {
    font-size: 1.3rem;
    font-weight: bold;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.product-description {
    color: var(--text-muted);
    margin-bottom: 1rem;
    line-height: 1.4;
}

.product-price {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--success-color);
    margin-bottom: 1rem;
}

/* Badges y etiquetas */
.badge,
.stock,
.category-badge {
    padding: 0.3rem 0.8rem;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: bold;
    display: inline-block;
}

.stock {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(0, 255, 0, 0.8);
    color: black;
}

.category-badge {
    transition: var(--transition);
}

.category-badge:hover {
    transform: scale(1.05);
}

/* Mensajes */
.message {
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 2rem;
    text-align: center;
    font-weight: bold;
}

.message.success {
    background: rgba(0, 255, 0, 0.2);
    border: 1px solid var(--success-color);
    color: #66ff66;
}

.message.error {
    background: rgba(255, 0, 0, 0.2);
    border: 1px solid var(--error-color);
    color: #ff6666;
}

/* Tablas */
.table-container {
    overflow-x: auto;
    margin: 2rem 0;
}

table {
    width: 100%;
    border-collapse: collapse;
    background: var(--card-bg);
    border-radius: var(--border-radius);
    overflow: hidden;
}

th, td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid rgba(255, 0, 64, 0.2);
}

th {
    background: rgba(255, 0, 64, 0.2);
    color: var(--primary-color);
    font-weight: bold;
}

tr:hover {
    background: rgba(255, 0, 64, 0.1);
}

/* Modales */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 10000;
    justify-content: center;
    align-items: center;
}

.modal-content {
    background: var(--background-gradient);
    border: 3px solid var(--border-color);
    border-radius: 20px;
    padding: 3rem;
    max-width: 500px;
    width: 90%;
    text-align: center;
    position: relative;
    box-shadow: 0 20px 60px rgba(255, 0, 64, 0.5);
}

/* Footer */
footer {
    background: var(--card-bg);
    border-top: 1px solid var(--border-color);
    margin-top: 3rem;
    padding: 1rem 0;
    text-align: center;
}

/* Utilidades */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }

.p-1 { padding: 0.5rem; }
.p-2 { padding: 1rem; }
.p-3 { padding: 1.5rem; }
.p-4 { padding: 2rem; }

.d-flex { display: flex; }
.d-block { display: block; }
.d-none { display: none; }

.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.align-center { align-items: center; }

.flex-wrap { flex-wrap: wrap; }
.flex-column { flex-direction: column; }

.w-full { width: 100%; }
.h-full { height: 100%; }

/* ===== RESPONSIVE BREAKPOINTS ===== */

/* Tablets (768px y abajo) */
@media (max-width: 768px) {
    /* Navegación principal */
    .nav {
        flex-direction: column;
        gap: 1rem;
    }
    
    .nav-links {
        flex-wrap: wrap;
        justify-content: center;
        gap: 0.5rem;
    }
    
    .nav-links a {
        padding: 0.5rem 0.8rem;
        font-size: 0.9rem;
    }
    
    /* Sidebar en móviles */
    .sidebar {
        width: 100%;
        height: auto;
        position: relative;
        padding: 1rem 0;
    }
    
    .sidebar .nav-links {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
        gap: 0;
    }
    
    .sidebar .nav-links a {
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
        border-left: none;
        border-bottom: 3px solid transparent;
    }
    
    .sidebar .nav-links a:hover,
    .sidebar .nav-links a.active {
        border-left: none;
        border-bottom: 3px solid var(--border-color);
    }
    
    .main-content.with-sidebar {
        margin-left: 0;
    }
    
    /* Títulos */
    .page-title {
        font-size: 2rem;
        margin-bottom: 2rem;
    }
    
    h1 { font-size: 1.8rem; }
    h2 { font-size: 1.5rem; }
    h3 { font-size: 1.3rem; }
    
    /* Formularios */
    .form-section {
        padding: 1.5rem 1rem;
        margin-bottom: 1.5rem;
    }
    
    .form-group input,
    .form-group textarea,
    .form-group select {
        padding: 0.8rem;
        font-size: 16px; /* Evita zoom en iOS */
    }
    
    /* Grids */
    .products-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    /* Cards */
    .product-card,
    .card {
        padding: 1rem;
    }
    
    /* Tablas */
    .table-container {
        font-size: 0.9rem;
    }
    
    th, td {
        padding: 0.5rem;
    }
    
    /* Modales */
    .modal-content {
        padding: 2rem 1rem;
        margin: 1rem;
    }
    
    /* Botones */
    .btn {
        padding: 0.8rem 1rem;
        font-size: 0.9rem;
    }
    
    /* Logo */
    .logo {
        font-size: 1.5rem;
    }
    
    .logo img {
        height: 35px;
    }
}

/* Móviles pequeños (480px y abajo) */
@media (max-width: 480px) {
    /* Contenedores */
    .container {
        padding: 0 0.5rem;
    }
    
    .main-content {
        padding: 1rem 0.5rem;
    }
    
    /* Títulos */
    .page-title {
        font-size: 1.8rem;
        margin-bottom: 1.5rem;
    }
    
    h1 { font-size: 1.5rem; }
    h2 { font-size: 1.3rem; }
    h3 { font-size: 1.1rem; }
    
    /* Navegación */
    .nav-links a {
        padding: 0.4rem 0.6rem;
        font-size: 0.8rem;
    }
    
    /* Formularios */
    .form-section {
        padding: 1rem 0.5rem;
    }
    
    .form-group {
        margin-bottom: 1rem;
    }
    
    /* Cards */
    .product-card,
    .card {
        padding: 0.8rem;
    }
    
    .product-image {
        height: 150px;
    }
    
    .product-name {
        font-size: 1.1rem;
    }
    
    .product-price {
        font-size: 1.3rem;
    }
    
    /* Botones */
    .btn {
        padding: 0.7rem 0.8rem;
        font-size: 0.8rem;
    }
    
    /* Logo */
    .logo {
        font-size: 1.3rem;
    }
    
    .logo img {
        height: 30px;
    }
    
    /* Tablas - scroll horizontal */
    .table-container {
        font-size: 0.8rem;
    }
    
    th, td {
        padding: 0.3rem;
        white-space: nowrap;
    }
    
    /* Modales */
    .modal-content {
        padding: 1.5rem 0.8rem;
        margin: 0.5rem;
    }
}

/* Móviles muy pequeños (320px y abajo) */
@media (max-width: 320px) {
    .page-title {
        font-size: 1.5rem;
    }
    
    .nav-links a {
        padding: 0.3rem 0.5rem;
        font-size: 0.7rem;
    }
    
    .btn {
        padding: 0.6rem 0.7rem;
        font-size: 0.7rem;
    }
    
    .form-group input,
    .form-group textarea,
    .form-group select {
        padding: 0.6rem;
    }
    
    .product-card,
    .card {
        padding: 0.6rem;
    }
}

/* Landscape en móviles */
@media (max-height: 500px) and (orientation: landscape) {
    .sidebar {
        height: auto;
        position: relative;
    }
    
    .main-content.with-sidebar {
        margin-left: 0;
    }
    
    .page-title {
        font-size: 1.8rem;
        margin-bottom: 1rem;
    }
    
    .form-section {
        padding: 1rem;
    }
}

/* Tablets grandes y desktop pequeño (769px - 1024px) */
@media (min-width: 769px) and (max-width: 1024px) {
    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    }
    
    .sidebar {
        width: 250px;
    }
    
    .main-content.with-sidebar {
        margin-left: 250px;
    }
    
    .nav-links {
        gap: 1.5rem;
    }
}

/* Desktop grande (1025px y arriba) */
@media (min-width: 1025px) {
    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    }
    
    .container {
        max-width: 1400px;
    }
}

/* Ultra wide screens */
@media (min-width: 1400px) {
    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    }
    
    .container {
        max-width: 1600px;
    }
}

/* Print styles */
@media print {
    .sidebar,
    .nav-links,
    .btn,
    footer {
        display: none !important;
    }
    
    .main-content.with-sidebar {
        margin-left: 0;
    }
    
    body {
        background: white;
        color: black;
    }
    
    .card,
    .product-card {
        border: 1px solid #ccc;
        background: white;
    }
}

/* Accesibilidad */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Alto contraste */
@media (prefers-contrast: high) {
    :root {
        --primary-color: #ff0066;
        --border-color: #ff0066;
        --text-color: #ffffff;
        --text-muted: #dddddd;
    }
    
    .btn {
        border: 2px solid white;
    }
    
    .card,
    .product-card {
        border-width: 2px;
    }
}

/* Modo oscuro (si el usuario lo prefiere) */
@media (prefers-color-scheme: dark) {
    :root {
        --background-gradient: linear-gradient(135deg, #000000 0%, #1a0000 100%);
        --card-bg: rgba(255, 0, 64, 0.15);
    }
}

/* Animaciones y transiciones suaves */
.fade-in {
    animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.slide-in {
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from { transform: translateX(-100%); }
    to { transform: translateX(0); }
}

/* Estados de hover mejorados */
.hover-scale {
    transition: transform 0.2s ease;
}

.hover-scale:hover {
    transform: scale(1.02);
}

/* Focus visible para accesibilidad */
*:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Scrollbar personalizado */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.3);
}

::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #ff0060;
}

/* Selección de texto */
::selection {
    background: var(--primary-color);
    color: white;
}

::-moz-selection {
    background: var(--primary-color);
    color: white;
}