/* BodegaSale - Estilos CSS */

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

:root {
    --primary-color: #2563eb;
    --secondary-color: #64748b;
    --success-color: #16a34a;
    --danger-color: #dc2626;
    --warning-color: #ea580c;
    --light-bg: #f1f5f9;
    --border-color: #e2e8f0;
    --text-dark: #1e293b;
    --text-light: #64748b;
}

/* Animaciones */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: var(--text-dark);
    background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
    background-attachment: fixed;
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Navbar */
.navbar {
    background: linear-gradient(135deg, #2563eb 0%, #1e40af 100%);
    box-shadow: 0 4px 20px rgba(37, 99, 235, 0.15);
    padding: 1.25rem 0;
    margin-bottom: 3rem;
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: white;
    letter-spacing: -0.5px;
}

.nav {
    display: flex;
    gap: 1rem;
}

/* Alertas */
.alert {
    padding: 1.25rem 1.5rem;
    border-radius: 8px;
    margin-bottom: 2rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
}

.alert-success {
    background: linear-gradient(135deg, #dcfce7 0%, #c6f6d5 100%);
    color: #166534;
    border-left: 4px solid var(--success-color);
}

.alert-error {
    background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
    color: #991b1b;
    border-left: 4px solid var(--danger-color);
}

/* Botones */
.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-weight: 500;
    letter-spacing: 0.3px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), #1e40af);
    color: white;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.2);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #1e40af, #1b3a8a);
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(37, 99, 235, 0.35);
}

.btn-secondary {
    background: linear-gradient(135deg, var(--secondary-color), #475569);
    color: white;
    box-shadow: 0 2px 8px rgba(100, 116, 139, 0.2);
}

.btn-secondary:hover {
    background: linear-gradient(135deg, #475569, #334155);
    box-shadow: 0 4px 12px rgba(100, 116, 139, 0.3);
}

.btn-edit {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: white;
    font-size: 0.875rem;
    padding: 0.5rem 1rem;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.2);
}

.btn-edit:hover {
    background: linear-gradient(135deg, #2563eb, #1e40af);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.btn-delete {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
    font-size: 0.875rem;
    padding: 0.5rem 1rem;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.2);
}

.btn-delete:hover {
    background: linear-gradient(135deg, #dc2626, #b91c1c);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

.btn-reserve {
    background: linear-gradient(135deg, #059669, #047857);
    color: white;
    font-size: 0.875rem;
    padding: 0.5rem 1rem;
    font-weight: 600;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 3px 10px rgba(5, 150, 105, 0.25);
}

.btn-reserve:hover {
    background: linear-gradient(135deg, #047857, #065f46);
    transform: translateY(-3px);
    box-shadow: 0 6px 16px rgba(5, 150, 105, 0.35);
}

.btn-reserve:disabled {
    background-color: #d1d5db;
    color: #6b7280;
    cursor: not-allowed;
    opacity: 1;
    box-shadow: none;
    transform: none;
}

.btn-search {
    background-color: var(--primary-color);
    color: white;
    padding: 0.75rem 1rem;
}

.btn-search:hover {
    background-color: #1d4ed8;
}

/* Filtros */
.filters {
    background-color: white;
    padding: 2rem;
    border-radius: 12px;
    margin-bottom: 2.5rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(37, 99, 235, 0.05);
}

.search-form {
    display: flex;
    gap: 1rem;
    align-items: center;
    flex-wrap: wrap;
}

.search-input,
.filter-select {
    padding: 0.85rem 1.1rem;
    border: 1.5px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background-color: white;
}

.search-input {
    flex: 1;
    min-width: 200px;
}

.search-input:focus,
.filter-select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
}
}

/* Galería */
.gallery {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2.5rem;
    margin-bottom: 3rem;
}

.product-card {
    background-color: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    border: 1px solid rgba(0, 0, 0, 0.04);
    animation: fadeInUp 0.5s ease-out forwards;
    opacity: 0;
}

.product-card:nth-child(1) { animation-delay: 0.1s; }
.product-card:nth-child(2) { animation-delay: 0.15s; }
.product-card:nth-child(3) { animation-delay: 0.2s; }
.product-card:nth-child(4) { animation-delay: 0.25s; }
.product-card:nth-child(5) { animation-delay: 0.3s; }
.product-card:nth-child(n+6) { animation-delay: 0.35s; }

.product-card:hover {
    transform: translateY(-10px) scale(1.01);
    box-shadow: 0 12px 32px rgba(37, 99, 235, 0.15);
}

.product-image {
    width: 100%;
    height: 220px;
    object-fit: cover;
    background-color: var(--light-bg);
    transition: transform 0.3s ease;
}

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

.product-image-placeholder {
    width: 100%;
    height: 200px;
    background-color: var(--light-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-light);
    font-weight: 500;
}

.product-info {
    padding: 1.75rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.product-name {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    color: var(--text-dark);
    word-break: break-word;
    letter-spacing: -0.3px;
}

.product-description {
    color: var(--text-light);
    font-size: 0.95rem;
    margin-bottom: 1rem;
    line-height: 1.5;
    max-height: 120px;
    overflow-y: auto;
    padding-right: 5px;
}

.product-features {
    color: var(--text-light);
    font-size: 0.9rem;
    margin-bottom: 1rem;
    padding: 0.875rem;
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.05), rgba(37, 99, 235, 0.02));
    border-left: 3px solid var(--primary-color);
    border-radius: 6px;
    line-height: 1.5;
    max-height: 120px;
    overflow-y: auto;
}

.product-price {
    font-size: 1.6rem;
    color: var(--primary-color);
    margin-bottom: 1.25rem;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.product-category {
    display: inline-block;
    background: linear-gradient(135deg, var(--primary-color), #1e40af);
    color: white;
    padding: 0.4rem 0.85rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.2);
}

.product-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: auto;
}

.product-actions .btn {
    flex: 1;
    text-align: center;
}

/* Sin productos */
.no-products {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    padding: 4rem 2rem;
    border-radius: 12px;
    text-align: center;
    grid-column: 1 / -1;
    border: 2px dashed rgba(37, 99, 235, 0.2);
}

.no-products p {
    color: var(--text-light);
    font-size: 1.1rem;
    margin-bottom: 1.5rem;
}

/* Formulario */
.form-container {
    background-color: white;
    padding: 2.5rem;
    border-radius: 12px;
    max-width: 600px;
    margin: 2rem auto;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(0, 0, 0, 0.04);
}

.form-container h1 {
    margin-bottom: 1.5rem;
    color: var(--text-dark);
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--text-dark);
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-family: inherit;
    font-size: 1rem;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
}

.current-image {
    margin-top: 1rem;
    padding: 1rem;
    background-color: var(--light-bg);
    border-radius: 6px;
}

.current-image img {
    max-width: 100%;
    max-height: 200px;
    border-radius: 4px;
}

.form-actions {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
}

.form-actions .btn {
    flex: 1;
    padding: 0.875rem;
    text-align: center;
    font-size: 1rem;
}

/* Footer */
.footer {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    color: white;
    text-align: center;
    padding: 2.5rem 2rem;
    margin-top: 5rem;
    border-top: 2px solid rgba(37, 99, 235, 0.1);
    font-size: 0.95rem;
    font-weight: 500;
    letter-spacing: 0.3px;
}

/* Responsive */
@media (max-width: 768px) {
    .navbar .container {
        flex-direction: column;
        gap: 1rem;
    }

    .search-form {
        flex-direction: column;
    }

    .search-input {
        min-width: 100%;
    }

    .gallery {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .btn {
        padding: 0.65rem 1.25rem;
        font-size: 0.95rem;
    }

    .form-container {
/* Tabs de imagen */
.image-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
    border-bottom: 2px solid var(--border-color);
}

.tab-btn {
    padding: 0.75rem 1rem;
    border: none;
    background: none;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-light);
    border-bottom: 3px solid transparent;
    transition: all 0.3s ease;
}

.tab-btn:hover {
    color: var(--primary-color);
}

.tab-btn.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

/* Contenido de tabs */
.tab-content {
    display: none;
    animation: fadeIn 0.3s ease;
}

.tab-content.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Controles de cámara */
.camera-container {
    background-color: var(--light-bg);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    padding: 1rem;
    text-align: center;
}

#cameraVideo {
    border-radius: 8px;
    background-color: #000;
    max-width: 100%;
    height: auto;
}

.camera-controls {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 1rem;
}

.camera-controls .btn {
    padding: 0.65rem 1.25rem;
    font-size: 0.9rem;
}

.btn-success {
    background-color: var(--success-color);
    color: white;
}

.btn-success:hover {
    background-color: #15803d;
}

/* Ayuda de tabs */
.tab-help {
    font-size: 0.85rem;
    color: var(--text-light);
    margin-top: 0.75rem;
    font-style: italic;
}

/* Contenedor de previsualización */
#preview-container {
    background-color: var(--light-bg);
    padding: 1rem;
    border-radius: 8px;
    text-align: center;
}

#preview-container img {
    max-width: 100%;
    height: auto;
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

#clearImage {
    margin-top: 0.75rem;
}

/* Responsive */
@media (max-width: 768px) {
        padding: 1.5rem;
        max-width: 100%;
    }
}

@media (max-width: 480px) {
    .gallery {
        grid-template-columns: 1fr;
    }

    .product-actions {
        flex-direction: column;
    }

    .btn-edit,
    .btn-delete {
        width: 100%;
    }

    .form-actions {
        flex-direction: column;
    }

    .camera-controls {
        flex-direction: column;
    }

    .camera-controls .btn {
        width: 100%;
    }

    .image-tabs {
        flex-direction: column;
    }

    .tab-btn {
        width: 100%;
        text-align: left;
    }
}

/* ===== MODAL DE IMAGEN AMPLIADA ===== */
.modal-imagen {
    display: none !important;
    position: fixed !important;
    z-index: 9999 !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    background-color: rgba(0, 0, 0, 0.95) !important;
    padding: 20px !important;
    box-sizing: border-box !important;
    overflow-y: auto !important;
}

.modal-imagen.show {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.modal-contenido {
    background-color: white !important;
    border-radius: 12px !important;
    width: 90% !important;
    max-width: 900px !important;
    max-height: 90vh !important;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5) !important;
    display: flex !important;
    flex-direction: column !important;
    position: relative !important;
    overflow: hidden !important;
}

.modal-close {
    position: absolute !important;
    top: 15px !important;
    right: 15px !important;
    color: #666 !important;
    font-size: 32px !important;
    font-weight: bold !important;
    cursor: pointer !important;
    background: white !important;
    border: none !important;
    width: 40px !important;
    height: 40px !important;
    padding: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    z-index: 10000 !important;
    border-radius: 50% !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15) !important;
    transition: all 0.2s ease !important;
}

.modal-close:hover {
    color: #000 !important;
    background: #f0f0f0 !important;
    transform: scale(1.1) !important;
}

.modal-header {
    padding: 1.5rem !important;
    border-bottom: 1px solid #e0e0e0 !important;
    background-color: #f9f9f9 !important;
}

.modal-header h2 {
    margin: 0 !important;
    color: #333 !important;
    font-size: 1.25rem !important;
}

.zoom-container {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    padding: 2rem !important;
    flex: 1 !important;
    max-height: 65vh !important;
    overflow: auto !important;
    gap: 1.5rem !important;
    background-color: #fafafa !important;
}

.modal-image {
    max-width: 100% !important;
    max-height: 500px !important;
    object-fit: contain !important;
    cursor: zoom-in !important;
    transition: transform 0.2s ease !important;
    user-select: none !important;
    border: 1px solid #ddd !important;
    border-radius: 8px !important;
    padding: 1rem !important;
    background: white !important;
}

.zoom-controls {
    display: flex !important;
    gap: 1rem !important;
    flex-wrap: wrap !important;
    justify-content: center !important;
}

.zoom-btn {
    padding: 0.75rem 1.5rem !important;
    background-color: #007bff !important;
    color: white !important;
    border: none !important;
    border-radius: 6px !important;
    cursor: pointer !important;
    font-size: 1rem !important;
    font-weight: 500 !important;
    transition: all 0.2s ease !important;
    min-width: 140px !important;
}

.zoom-btn:hover:not(:disabled) {
    background-color: #0056b3 !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.3) !important;
}

.zoom-btn:active:not(:disabled) {
    transform: translateY(0) !important;
}

.zoom-btn:disabled {
    background-color: #ccc !important;
    cursor: not-allowed !important;
    opacity: 0.5 !important;
}

.zoom-info {
    color: #666 !important;
    font-size: 0.9rem !important;
    text-align: center !important;
    margin: 0 !important;
    padding: 0 1rem !important;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Media queries para modal responsivo */
@media (max-width: 768px) {
    .modal-contenido {
        width: 95% !important;
        max-height: 95vh !important;
    }
    
    .zoom-container {
        max-height: 60vh !important;
        padding: 1rem !important;
    }
    
    .modal-image {
        max-height: 300px !important;
    }
    
    .zoom-controls {
        flex-direction: column !important;
    }
    
    .zoom-btn {
        width: 100% !important;
    }
}
