/* ============================================
   Estilos para Catálogos - Regale Lencería
   ============================================ */

:root {
    --primary: #ae7549;
    --primary-dark: #836650;
    --primary-light: #f4a77d;
    --secondary: #D4A373;
    --secondary-light: #E8C9A0;
    --dark: #1A1A1A;
    --dark-soft: #2D2D2D;
    --gray: #6B7280;
    --gray-light: #F3F4F6;
    --white: #FFFFFF;
    --danger: #DC2626;
    --success: #16A34A;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    --radius: 12px;
    --radius-sm: 8px;
    --transition: all 0.3s ease;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--gray-light);
    color: var(--dark);
    line-height: 1.6;
    min-height: 100vh;
}

/* ============================================
   Header
   ============================================ */
.header {
    background:#836650;
    color: var(--white);
    padding: 0;
    position: sticky;
    top: 0;
    z-index: 100;
    /* box-shadow: var(--shadow-lg); */
}

.header-inner {
    width: 280px;
    margin: 0 auto;
    padding: 1rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.header-inner img{
    width: 100%;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    color: var(--white);
}

.logo-icon {
    width: 42px;
    height: 42px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    backdrop-filter: blur(10px);
}

.logo h1 {
    font-size: 1.4rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.logo span {
    font-size: 0.75rem;
    opacity: 0.85;
    font-weight: 400;
    display: block;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.header-nav {
    display: flex;
    gap: 0.5rem;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1.2rem;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    font-weight: 500;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
}

.btn-outline {
    background: transparent;
    border: 1.5px solid rgba(255, 255, 255, 0.4);
    color: var(--white);
}

.btn-outline:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.7);
}

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

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: var(--shadow);
}

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

.btn-danger:hover {
    background: #B91C1C;
}

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

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

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

.btn-secondary:hover {
    background: var(--secondary-light);
}

.btn-icon {
    padding: 0.5rem;
    border-radius: 8px;
}

/* ============================================
   Hero Section
   ============================================ */
.hero {
    /* background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 50%, var(--primary-light) 100%); */
    background: #836650 ;
    background-size: cover;
    color: var(--white);
    padding: 4rem 1.5rem;
    text-align: center;
    position: relative;
    overflow: hidden;
}

/* .hero::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.03) 0%, transparent 60%);
    animation: pulse 8s ease-in-out infinite;
} */

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.hero h2 {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 1rem;
    position: relative;
    letter-spacing: -0.03em;
}

.hero p {
    font-size: 1.15rem;
    opacity: 0.9;
    max-width: 600px;
    margin: 0 auto;
    position: relative;
}

/* ============================================
   Main Content
   ============================================ */
.main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 3.5rem 2.5rem;
}

.section-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--dark);
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    text-align: center;
}

.section-title::before {
    content: '';
    width: 4px;
    height: 28px;
    background: var(--primary);
    border-radius: 2px;
}

/* ============================================
   Catalog Cards Grid
   ============================================ */
.catalogs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;

    margin: 10px;
}

.catalog-card {
    background: var(--white);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: var(--transition);
    display: flex;
    flex-direction: column;
}

.catalog-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-xl);
}

.catalog-card-cover {
    min-height: 260px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.catalog-card-cover::after {
    content: '';
    position: absolute;
    inset: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.05'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

.pdf-icon {
    font-size: 3.5rem;
    position: relative;
    z-index: 1;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

.catalog-card-body {
    padding: 1.25rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.catalog-card-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--dark);
    margin-bottom: 0.5rem;
    line-height: 1.3;
}

.catalog-card-desc {
    color: var(--gray);
    font-size: 0.875rem;
    margin-bottom: 1rem;
    flex: 1;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.catalog-card-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 1rem;
    border-top: 1px solid var(--gray-light);
    font-size: 0.8rem;
    color: var(--gray);
}

.catalog-card-actions {
    padding: 0 1.25rem 1.25rem;
    display: flex;
    gap: 0.5rem;
}

.catalog-card-actions .btn {
    flex: 1;
    justify-content: center;
}

/* ============================================
   Empty State
   ============================================ */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--gray);
}

.empty-state-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.empty-state h3 {
    font-size: 1.3rem;
    margin-bottom: 0.5rem;
    color: var(--dark-soft);
}

.empty-state p {
    max-width: 400px;
    margin: 0 auto;
}

/* ============================================
   PDF Viewer Page
   ============================================ */
.viewer-page {
    display: flex;
    flex-direction: column;
    height: 100vh;
    background: var(--dark);
}

.viewer-header {
    background: var(--primary-dark);
    color: var(--white);
    padding: 0.75rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-shrink: 0;
    z-index: 10;
}

.viewer-title {
    font-size: 1rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
}

.viewer-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.viewer-controls .btn {
    padding: 0.4rem 0.75rem;
    font-size: 0.8rem;
    border-radius: 6px;
    color: var(--white);
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.viewer-controls .btn:hover {
    background: rgba(255, 255, 255, 0.25);
}

.viewer-controls .btn.active {
    background: var(--primary);
    border-color: var(--primary);
}

.page-info {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.85rem;
    min-width: 80px;
    text-align: center;
}

.pdf-container {
    flex: 1;
    overflow: auto;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 1rem;
}

.pdf-container iframe,
.pdf-container embed,
.pdf-container object {
    width: 100%;
    height: 100%;
    border: none;
    border-radius: 4px;
}

#pdf-viewer {
    background: var(--white);
    width: 100%;
    height: 100%;
    border: none;
}

/* ============================================
   Login Page
   ============================================ */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 100%);
    padding: 1.5rem;
}

.login-card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 2.5rem;
    width: 100%;
    max-width: 420px;
    box-shadow: var(--shadow-xl);
}

.login-header {
    text-align: center;
    margin-bottom: 2rem;
}

.login-logo {
    width: 60px;
    height: 60px;
    background: var(--primary);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    margin: 0 auto 1rem;
    color: var(--white);
}

.login-header h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--dark);
    margin-bottom: 0.25rem;
}

.login-header p {
    color: var(--gray);
    font-size: 0.9rem;
}

/* ============================================
   Forms
   ============================================ */
.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--dark-soft);
    margin-bottom: 0.4rem;
}

.form-control {
    width: 100%;
    padding: 0.7rem 1rem;
    border: 1.5px solid #E5E7EB;
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    transition: var(--transition);
    background: var(--white);
    color: var(--dark);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(139, 26, 74, 0.1);
}

.form-control::placeholder {
    color: #9CA3AF;
}

/* ============================================
   Dashboard
   ============================================ */
.dashboard {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 260px;
    background: var(--primary-dark);
    color: var(--white);
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 50;
    transition: var(--transition);
}

.sidebar-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
    margin-bottom: 1.5rem;
}

.sidebar-logo {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

.sidebar-title {
    font-size: 1.1rem;
    font-weight: 700;
}

.sidebar-subtitle {
    font-size: 0.7rem;
    opacity: 0.7;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.sidebar-nav {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.7rem 1rem;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    border-radius: var(--radius-sm);
    transition: var(--transition);
    font-size: 0.9rem;
}

.sidebar-nav a:hover,
.sidebar-nav a.active {
    background: rgba(255, 255, 255, 0.12);
    color: var(--white);
}

.sidebar-nav a.active {
    background: rgba(255, 255, 255, 0.2);
}

.sidebar-footer {
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.15);
}

.sidebar-footer a {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.7rem 1rem;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    border-radius: var(--radius-sm);
    transition: var(--transition);
    font-size: 0.9rem;
}

.sidebar-footer a:hover {
    background: rgba(220, 38, 38, 0.3);
    color: var(--white);
}

.dashboard-main {
    flex: 1;
    margin-left: 260px;
    padding: 2rem;
}

.dashboard-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 2rem;
}

.dashboard-topbar h2 {
    font-size: 1.6rem;
    font-weight: 700;
}

.menu-toggle {
    display: none;
    background: var(--primary);
    color: var(--white);
    border: none;
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius-sm);
    font-size: 1.2rem;
    cursor: pointer;
}

/* ============================================
   Stats Cards
   ============================================ */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.25rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    gap: 1rem;
}

.stat-icon {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    flex-shrink: 0;
}

.stat-icon.primary {
    background: rgba(139, 26, 74, 0.1);
    color: var(--primary);
}

.stat-icon.success {
    background: rgba(22, 163, 74, 0.1);
    color: var(--success);
}

.stat-icon.warning {
    background: rgba(212, 163, 115, 0.15);
    color: var(--secondary);
}

.stat-value {
    font-size: 1.8rem;
    font-weight: 800;
    line-height: 1;
    color: var(--dark);
}

.stat-label {
    font-size: 0.8rem;
    color: var(--gray);
    margin-top: 0.25rem;
}

/* ============================================
   Card (generic)
   ============================================ */
.card {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.card-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--gray-light);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.card-header h3 {
    font-size: 1.1rem;
    font-weight: 600;
}

.card-body {
    padding: 1.5rem;
}

/* ============================================
   Upload Zone
   ============================================ */
.upload-zone {
    border: 2px dashed #D1D5DB;
    border-radius: var(--radius);
    padding: 2.5rem;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    background: var(--gray-light);
}

.upload-zone:hover,
.upload-zone.dragover {
    border-color: var(--primary);
    background: rgba(139, 26, 74, 0.03);
}

.upload-zone-icon {
    font-size: 2.5rem;
    margin-bottom: 0.75rem;
    opacity: 0.5;
}

.upload-zone h4 {
    font-size: 1rem;
    margin-bottom: 0.25rem;
}

.upload-zone p {
    color: var(--gray);
    font-size: 0.85rem;
}

.upload-zone .file-input {
    display: none;
}

/* Zona de portada */
.cover-row {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
    flex-wrap: wrap;
}

.cover-zone {
    width: 220px;
    height: 250px;
    border: 2px dashed #CBD5E1;
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.25s ease;
    background:
        radial-gradient(circle at 20% 12%, rgba(139, 26, 74, 0.05) 0%, transparent 45%),
        linear-gradient(160deg, #FAFBFC 0%, #F1F3F5 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
    flex-shrink: 0;
}

.cover-zone-sm {
    width: 170px;
    height: 170px;
}

.cover-zone:hover,
.cover-zone.dragover {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(139, 26, 74, 0.08);
    transform: translateY(-2px);
    background: var(--white);
}

.cover-zone.dragover {
    border-style: solid;
    background: rgba(139, 26, 74, 0.05);
}

.cover-zone.has-image {
    border: 2px solid rgba(139, 26, 74, 0.35);
    background: var(--white);
}

.cover-placeholder {
    text-align: center;
    padding: 1.5rem 1rem;
    color: var(--gray);
    font-size: 0.8rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.45rem;
}

.cover-placeholder .upload-zone-icon {
    width: 54px;
    height: 54px;
    border-radius: 14px;
    background: var(--white);
    color: var(--primary);
    border: 1.5px solid rgba(139, 26, 74, 0.18);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    opacity: 1;
    margin-bottom: 0.1rem;
    box-shadow: 0 4px 10px rgba(139, 26, 74, 0.1);
}

.cover-placeholder p {
    font-weight: 600;
    color: var(--dark-soft);
}

.cover-placeholder small {
    color: var(--gray);
    font-size: 0.7rem;
}

.cover-preview {
    width: calc(100% - 12px);
    height: calc(100% - 12px);
    object-fit: cover;
    border-radius: 8px;
    display: none;
    position: relative;
    z-index: 1;
    animation: coverZoomIn 0.3s ease;
}

@keyframes coverZoomIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

.cover-overlay {
    position: absolute;
    inset: 6px;
    border-radius: 8px;
    background: rgba(26, 26, 26, 0.55);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    font-size: 0.8rem;
    font-weight: 600;
    opacity: 0;
    transition: opacity 0.2s ease;
    pointer-events: none;
    z-index: 2;
}

.cover-zone.has-image:hover .cover-overlay,
.cover-zone.has-image.dragover .cover-overlay {
    opacity: 1;
}

.cover-hint {
    flex: 1;
    min-width: 160px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.6rem;
    padding-top: 0.35rem;
}

/* Portada en tarjetas públicas */
.catalog-cover-img {
    width: 100%;
    height: auto;
    display: block;
    position: relative;
    z-index: 1;
}

.cover-badge {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    z-index: 2;
    background: rgba(26, 26, 26, 0.75);
    color: #fff;
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    padding: 0.25rem 0.6rem;
    border-radius: 6px;
    backdrop-filter: blur(4px);
}

/* ============================================
   Table
   ============================================ */
.table-responsive {
    overflow-x: auto;
}

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

.data-table th {
    text-align: left;
    padding: 0.85rem 1rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--gray);
    border-bottom: 2px solid var(--gray-light);
    white-space: nowrap;
}

.data-table td {
    padding: 0.85rem 1rem;
    border-bottom: 1px solid var(--gray-light);
    font-size: 0.9rem;
    vertical-align: middle;
}

.data-table tr:hover td {
    background: rgba(139, 26, 74, 0.02);
}

.data-table .title-cell {
    font-weight: 600;
    color: var(--dark);
}

.data-table .actions-cell {
    display: flex;
    gap: 0.4rem;
    white-space: nowrap;
}

.data-table .actions-cell .btn {
    padding: 0.35rem 0.6rem;
    font-size: 0.8rem;
}

/* ============================================
   Alerts
   ============================================ */
.alert {
    padding: 0.85rem 1.25rem;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.alert-success {
    background: #F0FDF4;
    color: #166534;
    border: 1px solid #BBF7D0;
}

.alert-danger {
    background: #FEF2F2;
    color: #991B1B;
    border: 1px solid #FECACA;
}

.alert-info {
    background: #EFF6FF;
    color: #1E40AF;
    border: 1px solid #BFDBFE;
}

/* ============================================
   Toasts
   ============================================ */
.toast-container {
    position: fixed;
    top: 1.5rem;
    right: 1.5rem;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    max-width: 360px;
}

.toast {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow-xl);
    padding: 0.9rem 1.1rem;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--dark);
    border-left: 4px solid var(--success);
    animation: toastIn 0.25s ease-out;
    opacity: 1;
    transition: opacity 0.3s ease;
}

.toast i {
    font-size: 1.15rem;
    flex-shrink: 0;
}

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

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

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

.toast.hide {
    opacity: 0;
}

@keyframes toastIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

@media (max-width: 768px) {
    .toast-container {
        top: 1rem;
        right: 1rem;
        left: 1rem;
        max-width: none;
    }

    .toast {
        padding: 0.8rem 1rem;
        font-size: 0.85rem;
    }
}

/* ============================================
   Modal
   ============================================ */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 200;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    backdrop-filter: blur(2px);
}

.modal-overlay.active {
    display: flex;
}

.modal {
    background: var(--white);
    border-radius: var(--radius);
    width: 100%;
    max-width: 500px;
    box-shadow: var(--shadow-xl);
    animation: modalIn 0.2s ease-out;
}

@keyframes modalIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

.modal-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--gray-light);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-header h3 {
    font-size: 1.1rem;
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--gray);
    padding: 0.25rem;
    line-height: 1;
}

.modal-close:hover {
    color: var(--dark);
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--gray-light);
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
}

/* ============================================
   Progress Bar
   ============================================ */
.progress {
    height: 6px;
    background: #E5E7EB;
    border-radius: 3px;
    overflow: hidden;
    margin-top: 0.75rem;
    display: none;
}

.progress.active {
    display: block;
}

.progress-bar {
    height: 100%;
    background: var(--primary);
    border-radius: 3px;
    width: 0%;
    transition: width 0.3s ease;
}

/* ============================================
   Ubicación / Google Maps
   ============================================ */
.location-section {
    margin-top: 2.5rem;
}

.location-intro {
    color: var(--gray);
    margin-bottom: 1.25rem;
    font-size: 0.95rem;
}

.location-container{
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.location-container .location-address{
    margin:10px;
    background: #FFF;
    padding: 10px;
    border-radius: 6px;
}

.map-wrapper {
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    position: relative;
    padding-top: 56.25%;
    background: var(--gray-light);
}

.map-wrapper iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

/* ============================================
   Botón flotante de WhatsApp
   ============================================ */
.whatsapp-float {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    z-index: 999;
    width: 58px;
    height: 58px;
    background: #25D366;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    box-shadow: 0 6px 18px rgba(37, 211, 102, 0.45);
    transition: transform 0.25s ease, box-shadow 0.25s ease, background 0.25s ease;
}

.whatsapp-float svg {
    width: 32px;
    height: 32px;
}

.whatsapp-float:hover {
    transform: scale(1.08);
    background: #1EBE5D;
    box-shadow: 0 10px 24px rgba(37, 211, 102, 0.55);
}

.whatsapp-float::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: #25D366;
    animation: whatsapp-pulse 2s ease-out infinite;
    z-index: -1;
}

@keyframes whatsapp-pulse {
    0% { transform: scale(1); opacity: 0.6; }
    70% { transform: scale(1.5); opacity: 0; }
    100% { transform: scale(1.5); opacity: 0; }
}

.whatsapp-float-tip {
    position: absolute;
    right: calc(100% + 0.75rem);
    top: 50%;
    transform: translateY(-50%);
    background: var(--dark);
    color: #fff;
    font-size: 0.78rem;
    font-weight: 500;
    padding: 0.4rem 0.75rem;
    border-radius: 8px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

.whatsapp-float-tip::after {
    content: '';
    position: absolute;
    left: 100%;
    top: 50%;
    transform: translateY(-50%);
    border: 6px solid transparent;
    border-left-color: var(--dark);
}

.whatsapp-float:hover .whatsapp-float-tip {
    opacity: 1;
}

@media (max-width: 768px) {
    .whatsapp-float {
        bottom: 1rem;
        right: 1rem;
        width: 52px;
        height: 52px;
    }
    .whatsapp-float svg {
        width: 28px;
        height: 28px;
    }
    .whatsapp-float-tip {
        display: none;
    }
}

/* ============================================
   Botón flotante Compartir (viewer)
   ============================================ */
.share-float {
    position: fixed;
    bottom: 1.5rem;
    left: 1.5rem;
    z-index: 999;
}

.share-btn {
    width: 58px;
    height: 58px;
    border: none;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    font-size: 1.35rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.3);
    transition: transform 0.25s ease, background 0.25s ease;
}

.share-btn:hover {
    transform: scale(1.08);
    background: var(--primary-dark);
}

/* Modal compartir */
.share-modal-overlay .modal {
    max-width: 360px;
}

.share-modal-overlay .modal-header h3 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--dark);
}

.share-modal-overlay .modal-header h3 i {
    color: var(--primary);
}

.share-modal-sub {
    color: var(--gray);
    font-size: 0.88rem;
    text-align: center;
    margin-bottom: 1.1rem;
}

.share-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.6rem;
    margin-bottom: 1.1rem;
}

.share-link {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: #fff;
    font-size: 1.15rem;
    border: none;
    cursor: pointer;
    margin: 0 auto;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.share-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.share-facebook { background: #1877F2; }
.share-x { background: #111; }
.share-whatsapp { background: #25D366; }
.share-telegram { background: #229ED9; }
.share-instagram { background: radial-gradient(circle at 30% 110%, #fdf497 0%, #fd5949 45%, #d6249f 60%, #285AEB 90%); }
.share-email { background: var(--gray); }

.share-copy-row {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.7rem 1rem;
    border: 1.5px solid #E5E7EB;
    border-radius: var(--radius-sm);
    background: var(--white);
    color: var(--dark);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

@media (max-width: 768px) {
    .share-float {
        bottom: 1rem;
        left: 1rem;
    }
    .share-btn {
        width: 52px;
        height: 52px;
        font-size: 1.15rem;
    }
    .share-link {
        width: 44px;
        height: 44px;
        font-size: 1.05rem;
    }
}

/* ============================================
   Footer
   ============================================ */
.footer {
    text-align: center;
    padding: 2rem 1.5rem;
    color: var(--gray);
    font-size: 0.85rem;
    border-top: 1px solid var(--gray-light);
    margin-top: auto;
}

.footer a {
    color: var(--primary);
    text-decoration: none;
}

.footer a:hover {
    text-decoration: underline;
}

/* ============================================
   Loading Spinner
   ============================================ */
.spinner {
    width: 32px;
    height: 32px;
    border: 3px solid rgba(139, 26, 74, 0.2);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    margin: 2rem auto;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ============================================
   Analytics (Tráfico y catálogos más vistos)
   ============================================ */
.analytics-layout {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 1.25rem;
    margin-bottom: 2rem;
}

.badge {
    display: inline-block;
    background: rgba(139, 26, 74, 0.1);
    color: var(--primary);
    font-size: 0.7rem;
    font-weight: 600;
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    white-space: nowrap;
}

/* Gráfico de barras 7 días */
.mini-chart {
    display: flex;
    align-items: flex-end;
    gap: 0.4rem;
    height: 140px;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--gray-light);
    margin-bottom: 1.25rem;
}

.mini-bar {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.4rem;
    height: 100%;
    justify-content: flex-end;
}

.mini-bar-fill {
    width: 100%;
    max-width: 44px;
    background: linear-gradient(180deg, var(--primary-light) 0%, var(--primary) 100%);
    border-radius: 6px 6px 2px 2px;
    min-height: 4px;
    position: relative;
    transition: height 0.4s ease;
}

.mini-bar-fill.today {
    background: linear-gradient(180deg, var(--secondary-light) 0%, var(--secondary) 100%);
}

.mini-bar-value {
    position: absolute;
    top: -1.3rem;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--primary-dark);
}

.mini-bar-label {
    font-size: 0.72rem;
    color: var(--gray);
    text-transform: uppercase;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.2rem;
}

.mini-bar-label .dot {
    width: 5px;
    height: 5px;
    background: var(--secondary);
    border-radius: 50%;
    display: inline-block;
}

/* Resumen de tráfico */
.traffic-summary {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
    text-align: center;
}

.traffic-summary > div {
    background: var(--gray-light);
    border-radius: var(--radius-sm);
    padding: 0.85rem 0.5rem;
}

.traffic-num {
    display: block;
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--primary);
    line-height: 1.1;
}

.traffic-text {
    font-size: 0.72rem;
    color: var(--gray);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

/* Top catálogos */
.top-list {
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
}

.top-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.top-rank {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    background: var(--gray-light);
    color: var(--gray);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 700;
    flex-shrink: 0;
}

.top-rank.first {
    background: var(--primary);
    color: var(--white);
}

.top-info {
    flex: 1;
    min-width: 0;
}

.top-name {
    font-size: 0.83rem;
    font-weight: 600;
    color: var(--dark);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 0.3rem;
}

.top-bar {
    height: 6px;
    background: var(--gray-light);
    border-radius: 3px;
    overflow: hidden;
}

.top-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-light), var(--primary));
    border-radius: 3px;
    transition: width 0.5s ease;
}

.top-count {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--primary);
    flex-shrink: 0;
}

/* ============================================
   Mobile Sidebar Overlay
   ============================================ */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 40;
}

.sidebar-overlay.active {
    display: block;
}

/* ============================================
   Responsive Design
   ============================================ */

/* Tablet */
@media (max-width: 1024px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .dashboard-main {
        margin-left: 0;
    }

    .menu-toggle {
        display: block;
    }

    .catalogs-grid {
        grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    }

    .analytics-layout {
        grid-template-columns: 1fr;
    }
}

/* Mobile */
@media (max-width: 768px) {
    .header-inner {
        padding: 0.75rem 1rem;
    }

    .logo h1 {
        font-size: 1.1rem;
    }

    .logo span {
        display: none;
    }

    .hero {
        padding: 3rem 1rem;
    }

    .hero h2 {
        font-size: 1.8rem;
    }

    .hero p {
        font-size: 1rem;
    }

    .main {
        padding: 1.25rem 0.75rem;
    }

    .catalogs-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.9rem;
        margin: 0;
    }

    .catalog-card-cover {
        min-height: 175px;
    }

    .catalog-card-body {
        padding: 0.9rem 1rem;
    }

    .catalog-card-title {
        font-size: 0.95rem;
        margin-bottom: 0.35rem;
    }

    .catalog-card-desc {
        -webkit-line-clamp: 2;
        font-size: 0.8rem;
        margin-bottom: 0.6rem;
    }

    .catalog-card-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.15rem;
        font-size: 0.7rem;
        padding-top: 0.6rem;
    }

    .catalog-card-actions {
        flex-direction: column;
        padding: 0 1rem 1rem;
        gap: 0.4rem;
    }

    .catalog-card-actions .btn {
        width: 100%;
        min-height: 42px;
        font-size: 0.8rem;
    }

    /* Viewer */
    .viewer-header {
        padding: 0.5rem 1rem;
        flex-wrap: wrap;
    }

    .viewer-title {
        font-size: 0.85rem;
    }

    .viewer-controls {
        flex-wrap: wrap;
        gap: 0.3rem;
    }

    .viewer-controls .btn {
        padding: 0.35rem 0.6rem;
        font-size: 0.75rem;
    }

    .page-info {
        font-size: 0.75rem;
    }

    .pdf-container {
        padding: 0.5rem;
    }

    /* Dashboard */
    .dashboard-topbar {
        flex-wrap: wrap;
    }

    .dashboard-topbar h2 {
        font-size: 1.3rem;
    }

    .stats-grid {
        grid-template-columns: 1fr 1fr;
    }

    .stat-card {
        padding: 1rem;
    }

    .stat-value {
        font-size: 1.4rem;
    }

    .card-header {
        flex-wrap: wrap;
    }

    .data-table th,
    .data-table td {
        padding: 0.65rem 0.75rem;
    }

    .login-card {
        padding: 1.75rem;
    }
}

/* Small Mobile */
@media (max-width: 480px) {
    .header-nav .btn span {
        display: none;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .catalog-card-cover {
        min-height: 160px;
    }

    .catalog-card-title {
        font-size: 0.88rem;
    }

    .modal {
        margin: 0.75rem;
    }
}
