/* --- 1. IMPORTAR FUENTES --- */
@import url('https://fonts.googleapis.com/css2?family=Dancing+Script:wght@700&family=Lato:wght@300;400;700&display=swap');

:root {
    /* --- PALETA DE COLORES "BOUTIQUE CÁLIDA" --- */
    --primary: #8FA993;       /* Verde Salvia */
    --primary-hover: #768F79;
    --accent-gold: #CCA45E;   /* Dorado */
    --bg-cream: #FAF9F6;      /* Fondo Crema */
    --bg-warm: #FFFFFF;       /* Fondo Blanco para tarjetas */
    --text: #5C5346;          /* Texto Gris Cálido */
    --text-light: #857E71;
    
    --glass: rgba(255, 255, 255, 0.95);
    --shadow-soft: 0 5px 20px -5px rgba(143, 169, 147, 0.15); /* Sombra sutil */
    --shadow-gold: 0 15px 35px -5px rgba(204, 164, 94, 0.25); /* Sombra dorada */
    
    --success: #10b981; --danger: #D65A5A; --warning: #f59e0b; --gray: #9ca3af;
}

body {
    font-family: 'Lato', sans-serif;
    background-color: var(--bg-cream);
    color: var(--text);
    /* Imagen de fondo con velo crema suave */
    background-image: linear-gradient(rgba(250, 249, 246, 0.5), rgba(250, 249, 246, 0.5)), url('fondo.png');
    background-size: cover; background-position: center; background-attachment: fixed;
    margin: 0; padding-bottom: 50px; line-height: 1.5;
}

.container { max-width: 1100px; margin: 0 auto; padding: 20px; }
a { text-decoration: none; transition: all 0.3s ease; }

/* Tipografía */
h1, h2, h4, .hero-subtitle, .card-title { font-family: 'Dancing Script', cursive; }

/* --- HERO (PORTADA) --- */
.hero-wrapper {
    position: relative; width: 100%; height: 85vh; min-height: 500px;
    background-image: linear-gradient(to bottom, rgba(250, 249, 246, 0.2), rgba(143, 169, 147, 0.2), rgba(92, 83, 70, 0.4)), url('https://images.unsplash.com/photo-1626803775151-61d756612fcd?q=80&w=2070&auto=format&fit=crop');
    background-size: cover; background-position: center; background-attachment: fixed;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    text-align: center; border-radius: 0 0 50px 50px;
    box-shadow: 0 15px 40px rgba(0,0,0,0.1); margin-bottom: 50px; overflow: hidden;
    border-bottom: 3px solid var(--accent-gold);
}
.hero-content { 
    animation: fadeInUp 1s ease-out; 
    padding: 20px; 
    max-width: 800px; 
    display: flex; 
    flex-direction: column; 
    align-items: center; /* Esto centra los elementos hijos horizontalmente */
}
@keyframes fadeInUp { from { opacity: 0; transform: translateY(30px); } to { opacity: 1; transform: translateY(0); } }

/* LOGO CIRCULAR Y CENTRADO */
.hero-logo-img {
    width: 280px; height: auto; margin-bottom: 15px;
    filter: drop-shadow(0 5px 15px rgba(0,0,0,0.2));
    transition: transform 0.5s;
    
    /* --- LAS CORRECCIONES --- */
    border-radius: 50%; /* Hace el logo circular */
    align-self: center; /* Asegura el centrado horizontal */
}
.hero-logo-img:hover { transform: scale(1.05); }

.hero-subtitle { font-size: 2rem; color: #FFF; text-shadow: 2px 2px 8px rgba(0,0,0,0.4); margin: 0 0 30px 0; }

.btn-hero {
    background: var(--bg-warm); color: var(--primary); padding: 14px 40px; font-size: 1.1rem;
    border-radius: 50px; font-weight: 700; text-transform: uppercase; letter-spacing: 1px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1); display: inline-block;
}
.btn-hero:hover { background: var(--primary); color: white; transform: translateY(-3px); }

.top-nav { position: absolute; top: 20px; right: 20px; z-index: 10; }
.btn-login-glass {
    background: rgba(255, 255, 255, 0.4); backdrop-filter: blur(5px); color: white;
    border: 1px solid rgba(255,255,255,0.6); padding: 8px 20px; border-radius: 30px;
    font-weight: 600; font-size: 0.9rem;
}
.btn-login-glass:hover { background: var(--bg-warm); color: var(--primary); }

/* --- HEADER ADMIN --- */
.admin-header {
    display: flex; justify-content: space-between; align-items: center; margin-bottom: 30px;
    padding-bottom: 20px; border-bottom: 1px solid rgba(143, 169, 147, 0.3);
}
.admin-header h1 { margin: 0; color: var(--primary); font-size: 3.5rem; text-shadow: 2px 2px 0px #FFF; line-height: 1; }
.admin-header p { margin: 5px 0 0 0; color: var(--text); font-size: 1rem; font-weight: 400; }
.admin-actions { display: flex; gap: 10px; }

/* --- TARJETAS --- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 30px; }
.admin-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 30px; }

.card, .card-admin {
    background: var(--bg-warm); border-radius: 20px; padding: 0;
    box-shadow: var(--shadow-soft); border: 1px solid rgba(143, 169, 147, 0.2);
    overflow: hidden; transition: all 0.4s; display: flex; flex-direction: column;
}
.card-admin { padding: 30px; margin-bottom: 0; } /* Ajuste específico admin */

.card:hover, .card-admin:hover { transform: translateY(-5px); box-shadow: var(--shadow-gold); border-color: var(--accent-gold); }

.card-img-container { width: 100%; height: 260px; background: #f0f0e8; overflow: hidden; }
.card-img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s; }
.card:hover .card-img { transform: scale(1.05); }
.card-body { padding: 25px; flex-grow: 1; display: flex; flex-direction: column; }
.card-title { margin: 0 0 10px 0; color: var(--primary); font-size: 2.2rem; }
.card-text { color: var(--text-light); flex-grow: 1; margin-bottom: 20px; }
.card-admin h2 { font-size: 2.2rem; margin-top: 0; margin-bottom: 20px; color: var(--primary); text-align: center; }

/* --- MODAL --- */
.modal-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(92, 83, 70, 0.8); backdrop-filter: blur(5px); z-index: 2000;
    display: none; justify-content: center; align-items: center; padding: 20px; opacity: 0; transition: all 0.3s ease;
}
.modal-overlay.active { display: flex; opacity: 1; }
.modal-content {
    background: var(--bg-warm); width: 100%; max-width: 480px; border-radius: 25px; padding: 30px;
    border-top: 4px solid var(--accent-gold); box-shadow: 0 25px 50px rgba(0,0,0,0.25);
    transform: translateY(30px); transition: transform 0.4s;
}
.modal-overlay.active .modal-content { transform: translateY(0); }
.btn-close-modal {
    position: absolute; top: 15px; right: 15px; background: #F0F0E8; border: none; width: 35px; height: 35px;
    border-radius: 50%; font-size: 1.2rem; cursor: pointer; color: var(--text-light); transition: 0.2s;
}
.btn-close-modal:hover { background: var(--danger); color: white; }

/* --- FORMULARIOS --- */
.form-group { margin-bottom: 15px; }
input[type="text"], textarea, input[type="email"], input[type="password"], input[type="date"] {
    width: 100%; padding: 12px 15px; border: 1px solid #C0C0B8; border-radius: 10px;
    background: #FAFAFA; font-size: 1rem; box-sizing: border-box; transition: all 0.3s;
    font-family: 'Lato', sans-serif; color: var(--text);
}
input:focus, textarea:focus { background: #FFF; border-color: var(--primary); outline: none; box-shadow: 0 0 0 3px rgba(143, 169, 147, 0.1); }

/* --- ZONA DE CARGA (Estética y funcional) --- */
.file-upload-wrapper {
    width: 100%; height: 160px; border: 2px dashed var(--primary); border-radius: 15px;
    background-color: #FDFDFB; display: flex; flex-direction: column; align-items: center; justify-content: center;
    cursor: pointer; transition: all 0.3s ease; gap: 10px;
}
.file-upload-wrapper i { font-size: 2.5rem !important; color: var(--accent-gold) !important; margin-bottom: 0; transition: transform 0.3s; }
.file-upload-wrapper span#file-text { font-size: 1rem; font-weight: 600; color: var(--text); }
.file-upload-wrapper:hover { background-color: #F0F7F2; border-color: var(--accent-gold); }
.file-upload-wrapper:hover i { transform: scale(1.1); }

/* --- BOTONES --- */
.btn { padding: 10px 20px; border-radius: 50px; font-weight: 700; border: none; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 8px; transition: all 0.3s; font-size: 0.9rem; }
.btn-primary { background: var(--primary); color: white; box-shadow: 0 4px 10px rgba(143, 169, 147, 0.3); }
.btn-primary:hover { background: var(--primary-hover); transform: translateY(-2px); }
.card .btn-primary:hover { background: var(--accent-gold); box-shadow: 0 8px 20px rgba(204, 164, 94, 0.4); }

.btn-outline { background: transparent; border: 2px solid var(--primary); color: var(--primary); }
.btn-outline:hover { background: var(--primary); color: white; }

.btn-back { display: inline-flex; align-items: center; color: var(--text-light); font-weight: 600; padding: 8px 15px; border-radius: 50px; transition: all 0.3s ease; border: 1px solid transparent; text-decoration: none;}
.btn-back:hover { color: var(--primary); border-color: var(--primary); background: rgba(143, 169, 147, 0.1); }

.btn-danger { background: var(--danger); color: white; padding: 6px 12px; font-size: 0.85rem; }
.btn-gray { background: var(--gray); color: white; padding: 6px 12px; font-size: 0.85rem; }
.btn-warning { background: var(--accent-gold); color: white; padding: 6px 12px; font-size: 0.85rem; }

/* Botón Publicar */
button[name="save_cake"] { width: 100%; margin-top: 15px; padding: 14px; font-size: 1.1rem; }

/* --- BOTONES SOCIALES --- */
.social-buttons-container { display: flex; gap: 10px; margin-top: 15px; padding-top: 15px; border-top: 1px solid #eee; }
.btn-social {
    flex: 1; display: inline-flex; justify-content: center; align-items: center;
    padding: 10px 15px; border-radius: 50px; color: white !important; font-weight: 700;
    text-decoration: none; font-size: 0.9rem; border: none; cursor: pointer;
    transition: transform 0.3s, box-shadow 0.3s; box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}
.btn-social i { margin-right: 6px; font-size: 1.1rem; }
.btn-what { background: #25D366; } .btn-what:hover { transform: translateY(-3px); box-shadow: 0 6px 15px rgba(37, 211, 102, 0.4); }
.btn-insta { background: radial-gradient(circle at 30% 107%, #fdf497 0%, #fdf497 5%, #fd5949 45%, #d6249f 60%, #285AEB 90%); }
.btn-insta:hover { transform: translateY(-3px); box-shadow: 0 6px 15px rgba(214, 36, 159, 0.4); filter: brightness(1.1); }

/* Botón flotante */
.floating-insta {
    position: fixed; bottom: 30px; right: 30px; 
    background: radial-gradient(circle at 30% 107%, #fdf497 0%, #fdf497 5%, #fd5949 45%, #d6249f 60%, #285AEB 90%);
    color: white; width: 60px; height: 60px; border-radius: 50%; display: flex; justify-content: center;
    align-items: center; font-size: 2rem; box-shadow: 0 5px 20px rgba(214, 36, 159, 0.3);
    z-index: 1500; transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.floating-insta:hover { transform: scale(1.1) rotate(10deg); box-shadow: 0 8px 25px rgba(214, 36, 159, 0.5); filter: brightness(1.1); }

/* --- LISTAS --- */
.cake-item { display: flex; justify-content: space-between; align-items: center; padding: 12px 0; border-bottom: 1px solid #EEE; }
.cake-item img { width: 50px; height: 50px; border-radius: 8px; object-fit: cover; margin-right: 10px; border: 1px solid var(--accent-gold); }

/* --- RESPONSIVO --- */
@media (max-width: 768px) {
    .container { padding: 15px; width: 90%; }
    .hero-wrapper { height: auto; min-height: 60vh; border-radius: 0 0 40px 40px; background-attachment: scroll; }
    .hero-logo-img { width: 240px; }
    .hero-subtitle { font-size: 1.6rem; margin-bottom: 25px;}
    .top-nav { width: 100%; justify-content: center; top: 15px; right: auto; }
    
    .admin-header { flex-direction: column; text-align: center; gap: 15px; }
    .admin-header h1 { font-size: 2.8rem; }
    .admin-actions { flex-direction: column; width: 100%; } .admin-actions .btn { width: 100%; }
    .admin-grid { grid-template-columns: 1fr; }
    
    .upload-box { height: 180px; }
    .cake-item { flex-direction: column; align-items: flex-start; gap: 10px; } .cake-item > div { width: 100%; }
    .social-buttons-container { flex-direction: column; }
    
    .login-container { width: 100% !important; padding: 20px !important; }
}