/* /assets/css/style.css */

/* =========================================
   1. VARIABLES Y BASE
   ========================================= */
:root {
    --brand-primary: #07999A;
    --bg-body: #f8fafc;
    --text-dark: #1e293b;
    --text-muted: #64748b;
    --border-color: #e2e8f0;
    --feature-title-color: #e53e3e;
}

html, body {
    height: 100%;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Segoe UI', Arial, sans-serif;
    background-color: var(--bg-body);
    color: var(--text-dark);
    display: flex;
    flex-direction: column;
}

/* =========================================
   2. NAVEGACIÓN Y ESTRUCTURA (Header Blanco)
   ========================================= */
.main-header {
    background-color: #ffffff;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
    width: 100%;
}

.header-inner, .section-inner {
    width: 95%;
    max-width: 1300px;
    margin: 0 auto;
}

.header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
    flex-wrap: wrap;
}

.logo-container a { display: flex; align-items: center; text-decoration: none; }
.brand-logo { height: 65px; width: auto; }

.main-nav { display: flex; align-items: center; gap: 30px; }
.main-nav a {
    color: var(--text-dark);
    text-decoration: none;
    font-weight: 600;
    font-size: 1.05em;
    padding: 5px 0;
    border-bottom: 3px solid transparent;
    transition: all 0.3s ease;
}

.main-nav a:hover, .main-nav a.active {
    color: var(--brand-primary);
    border-bottom: 3px solid var(--brand-primary);
}

.user-panel { display: flex; align-items: center; gap: 15px; }
.admin-link { color: var(--brand-primary); font-weight: 700; text-decoration: none; transition: color 0.2s; }
.admin-link:hover { color: #045c5d; text-decoration: underline; }
.btn-logout { color: #e53e3e; font-weight: 700; text-decoration: none; transition: color 0.2s; }
.btn-logout:hover { color: #c53030; text-decoration: underline; }

.main-content {
    flex: 1 0 auto;
    width: 100%;
    display: flex;
    flex-direction: column;
}

/* =========================================
   3. PANEL ADMIN: TABLAS MODERNAS (SaaS Style)
   ========================================= */
.admin-container {
    width: 95%;
    max-width: 1300px;
    margin: 40px auto;
}

.admin-title { margin: 0 0 5px 0; font-size: 1.8em; color: var(--text-dark); }
.admin-subtitle { margin: 0; color: var(--text-muted); font-size: 1em; }

.admin-card {
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
    border: 1px solid var(--border-color);
    overflow: hidden;
}

.admin-card .card-body { padding: 40px; }

.table-responsive { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; text-align: left; min-width: 800px; }
th { background-color: #f8fafc; color: var(--text-muted); font-size: 0.85em; text-transform: uppercase; letter-spacing: 0.05em; font-weight: 700; padding: 16px 20px; border-bottom: 1px solid var(--border-color); }
td { padding: 16px 20px; border-bottom: 1px solid var(--border-color); color: var(--text-dark); vertical-align: middle; }
tr:last-child td { border-bottom: none; }
tr:hover { background-color: #f1f5f9; }

/* =========================================
   4. PANEL ADMIN: FORMULARIOS MODERNOS
   ========================================= */
.login-container { width: 90%; max-width: 400px; margin: 80px auto; background: #ffffff; padding: 40px; box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1); border-radius: 12px; }
.login-container h2 { text-align: center; margin-bottom: 30px; font-weight: 800; color: var(--text-dark); }
.login-container input { width: 100%; padding: 12px 15px; margin: 8px 0 20px 0; border: 1px solid var(--border-color); border-radius: 6px; box-sizing: border-box; font-size: 1em; transition: border-color 0.2s; }
.login-container input:focus { border-color: var(--brand-primary); outline: none; box-shadow: 0 0 0 3px rgba(7, 153, 154, 0.1); }
.login-container button { width: 100%; padding: 14px; background-color: var(--brand-primary); color: #ffffff; border: none; border-radius: 6px; font-weight: bold; font-size: 1.1em; cursor: pointer; transition: background-color 0.2s; }
.login-container button:hover { background-color: #058283; }

.form-group { margin-bottom: 25px; }
.form-group label { display: block; font-weight: 600; margin-bottom: 10px; color: var(--text-dark); }
.form-control { width: 100%; padding: 12px 15px; border: 1px solid var(--border-color); border-radius: 6px; box-sizing: border-box; font-size: 1em; transition: all 0.2s; background-color: #ffffff; color: var(--text-dark); }
.form-control:focus { border-color: var(--brand-primary); outline: none; box-shadow: 0 0 0 3px rgba(7, 153, 154, 0.1); }
textarea.form-control { resize: vertical; min-height: 100px; font-family: inherit; }

input[type="file"].form-control { padding: 8px 15px; background-color: #f8fafc; cursor: pointer; color: var(--text-muted); }
input[type="file"]::file-selector-button { background-color: #e2e8f0; border: none; padding: 8px 16px; border-radius: 4px; font-weight: 600; color: var(--text-dark); cursor: pointer; transition: background-color 0.2s; margin-right: 15px; }
input[type="file"]::file-selector-button:hover { background-color: #cbd5e1; }

.form-group label input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--brand-primary); cursor: pointer; vertical-align: middle; margin-right: 8px; position: relative; top: -2px; }

.btn-link { text-decoration: none; color: var(--brand-primary); font-weight: 600; transition: color 0.2s; display: inline-block; }
.btn-link:hover { color: #045c5d; text-decoration: underline; }
.btn-link.text-muted { color: var(--text-muted); }
.btn-link.text-muted:hover { color: var(--text-dark); }

/* =========================================
   5. CLASES DE UTILIDAD ADMIN (Badges y Botones)
   ========================================= */
.dashboard-header { display: flex; justify-content: space-between; align-items: flex-end; margin-bottom: 25px; }

.btn-primary { background-color: var(--brand-primary); color: white; border: none; padding: 12px 28px; border-radius: 6px; cursor: pointer; font-weight: 600; text-decoration: none; display: inline-block; transition: all 0.2s; font-size: 1em; }
.btn-primary:hover { background-color: #058283; transform: translateY(-1px); box-shadow: 0 4px 6px -1px rgba(7, 153, 154, 0.2); }
.shadow-sm { box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05); }

.badge { padding: 6px 12px; border-radius: 9999px; font-size: 0.85em; font-weight: 600; display: inline-block; text-align: center; }
.badge-active { background-color: #dcfce7; color: #166534; }
.badge-inactive { background-color: #fee2e2; color: #991b1b; }

.table-actions { display: flex; gap: 15px; }
.btn-action { text-decoration: none; font-size: 0.9em; font-weight: 600; transition: color 0.2s; }
.btn-edit { color: var(--brand-primary); }
.btn-edit:hover { color: #045c5d; text-decoration: underline; }
.btn-delete { color: #e53e3e; }
.btn-delete:hover { color: #c53030; text-decoration: underline; }

.text-muted { color: var(--text-muted); }
.font-bold { font-weight: 700; color: var(--text-dark); }
.empty-state { padding: 40px !important; color: var(--text-muted); font-size: 1.1em; }

/* =========================================
   6. SECCIONES FULL-WIDTH Y GLASSMORPHISM (FRONT)
   ========================================= */
.store-hero-banner { width: 100%; position: relative; background-color: #1a1a1a; }
.banner-wrapper { position: relative; width: 100%; max-height: 500px; overflow: hidden; display: flex; justify-content: center; align-items: center; }
.banner-image { width: 100%; height: 100%; object-fit: cover; display: block; }
.glass-narrative { position: absolute; width: 85%; max-width: 800px; background: rgba(255, 255, 255, 0.75); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border: 1px solid rgba(255, 255, 255, 0.4); border-radius: 20px; padding: 40px; text-align: center; box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.15); z-index: 10; }
.glass-narrative h2 { color: var(--brand-primary); font-size: 2.2em; margin: 0 0 15px 0; font-weight: 900; }
.glass-narrative p { font-size: 1.15em; line-height: 1.6; color: #1a202c; margin: 0; font-weight: 500; }

.store-features { background-color: #ffffff; padding: 60px 0; border-bottom: 1px solid var(--border-color); }
.features-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 30px; text-align: center; }
.feature-item { display: flex; flex-direction: column; align-items: center; }
.feature-icon { color: #4a5568; width: 48px; height: 48px; margin-bottom: 15px; }
.feature-title { color: var(--feature-title-color); font-size: 1.1em; margin: 0 0 10px 0; font-weight: bold; }
.feature-desc { color: var(--text-muted); font-size: 0.95em; margin: 0; line-height: 1.4; }

/* =========================================
   7. TARJETAS Y GRID DEL CATÁLOGO (FRONT)
   ========================================= */
.store-catalog { background-color: #f8fafc; padding: 60px 0; }
.catalog-toolbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 40px; flex-wrap: wrap; gap: 15px; }
.catalog-heading { margin: 0; color: var(--text-dark); font-size: 1.8em; font-weight: 800; }
.filter-form { display: flex; align-items: center; gap: 10px; }

.grid-catalog { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 30px; }
.card { background-color: #ffffff; border: 1px solid var(--border-color); border-radius: 12px; overflow: hidden; box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05); transition: transform 0.3s ease, box-shadow 0.3s ease; display: flex; flex-direction: column; }
.card:hover { transform: translateY(-5px); box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1); }
.card-img { width: 100%; height: 220px; object-fit: cover; padding: 0; margin: 0; border-bottom: 1px solid var(--border-color); }
.card-img-placeholder { width: 100%; height: 220px; background-color: #e2e8f0; display: flex; align-items: center; justify-content: center; color: #718096; font-weight: bold; border-bottom: 1px solid var(--border-color); }
.card-body { padding: 25px; display: flex; flex-direction: column; flex-grow: 1; }
.card-category { font-size: 11px; text-transform: uppercase; color: var(--brand-primary); font-weight: 800; margin-bottom: 10px; letter-spacing: 0.5px; }
.card-title { margin: 0 0 12px 0; font-size: 1.3em; color: var(--text-dark); font-weight: 700; }
.card-description { font-size: 0.95em; color: var(--text-muted); line-height: 1.5; margin-bottom: 5px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.btn-read-more { background: none; border: none; color: var(--brand-primary); font-weight: bold; cursor: pointer; padding: 0; text-align: left; font-size: 0.9em; margin-bottom: 20px; flex-grow: 1; }
.btn-read-more:hover { text-decoration: underline; }
.card-price { font-size: 1.6em; font-weight: 900; color: var(--text-dark); margin-bottom: 20px; }
.btn-whatsapp { background-color: var(--brand-primary); color: #ffffff; text-align: center; padding: 14px; border-radius: 6px; text-decoration: none; font-weight: bold; display: block; transition: background-color 0.2s; font-size: 1.05em; }
.btn-whatsapp:hover { background-color: #058283; }
.empty-catalog-msg { grid-column: 1 / -1; text-align: center; padding: 60px; background: #ffffff; border-radius: 12px; border: 1px dashed var(--border-color); font-size: 1.2em; color: var(--text-muted); }

/* =========================================
   8. MODAL (Ventana Emergente FRONT)
   ========================================= */
.modal { display: none; position: fixed; z-index: 2000; left: 0; top: 0; width: 100%; height: 100%; background-color: rgba(0,0,0,0.6); backdrop-filter: blur(5px); }
.modal-content { background-color: #ffffff; margin: 10% auto; padding: 30px; border: none; width: 90%; max-width: 600px; border-radius: 12px; box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1); position: relative; animation: modalFadeIn 0.3s; }
@keyframes modalFadeIn { from { opacity: 0; transform: translateY(-20px); } to { opacity: 1; transform: translateY(0); } }
.close-modal { color: #94a3b8; float: right; font-size: 28px; font-weight: bold; cursor: pointer; line-height: 1; transition: color 0.2s; }
.close-modal:hover { color: var(--brand-primary); }
#modalTitle { color: var(--brand-primary); margin-top: 0; font-size: 1.6em; font-weight: 800;}
#modalDesc { color: var(--text-dark); line-height: 1.6; font-size: 1.05em; margin-bottom: 0;}

/* =========================================
   9. FOOTER
   ========================================= */
.main-footer {
    background-color: #1a202c;
    color: #a0aec0;
    text-align: center;
    padding: 25px 0;
    font-size: 0.95em;
    flex-shrink: 0;
    width: 100%;
}
.footer-container { width: 95%; max-width: 1200px; margin: 0 auto; }

/* =========================================
   10. ANIMACIONES JS Y RESPONSIVO
   ========================================= */
.fade-on-scroll { opacity: 0; transform: translateY(30px); transition: opacity 0.6s ease-out, transform 0.6s ease-out; }
.fade-on-scroll.is-visible { opacity: 1; transform: translateY(0); }

@media (max-width: 768px) {
    .header-inner { flex-direction: column; gap: 15px; }
    .main-nav { flex-wrap: wrap; justify-content: center; gap: 15px; }
    .user-panel { flex-wrap: wrap; justify-content: center; } /* Para que los botones del admin se acomoden en movil */
    .glass-narrative { padding: 25px; width: 90%; }
    .glass-narrative h2 { font-size: 1.6em; }
    .glass-narrative p { font-size: 1em; }
    .catalog-toolbar, .dashboard-header { flex-direction: column; align-items: stretch; gap: 15px; }
    .catalog-heading, .dashboard-header h2 { text-align: center; margin-bottom: 0; }
    .dashboard-header .btn-primary, .dashboard-header .btn-link { width: 100%; text-align: center; display: block; margin-top: 10px; }
    .admin-card .card-body { padding: 20px; }
}