/* ==========================================================================
   RedAbraza - Diseño y Estilos Premium (CSS Vanilla)
   ========================================================================== */

/* 1. Reset y Variables Globales */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&display=swap');

:root {
    /* Paleta de Colores Terrestres y Armónicos */
    --color-bg-base: #fdfcfb;
    --color-bg-surface: #ffffff;
    --color-primary: #2d5a27;      /* Verde Bosque Salvia */
    --color-primary-dark: #1f3f1b;
    --color-primary-light: #e8f5e9;
    --color-secondary: #e27d3b;    /* Terracota Cálido */
    --color-secondary-light: #fdf2e9;
    --color-accent: #7b4f8d;       /* Lila Armonía */
    --color-accent-light: #f5f0f7;
    
    /* Colores del Texto */
    --color-text-main: #1d291b;
    --color-text-muted: #677565;
    --color-text-light: #ffffff;

    /* Estados */
    --color-success: #2e7d32;
    --color-warning: #f57c00;
    --color-info: #0288d1;
    --color-danger: #d32f2f;

    /* Sombras y Bordes */
    --shadow-sm: 0 2px 8px rgba(45, 90, 39, 0.04);
    --shadow-md: 0 8px 24px rgba(45, 90, 39, 0.06);
    --shadow-lg: 0 16px 40px rgba(45, 90, 39, 0.1);
    --border-radius-sm: 8px;
    --border-radius-md: 16px;
    --border-radius-lg: 24px;
    
    --transition-smooth: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

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

body {
    font-family: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: var(--color-bg-base);
    color: var(--color-text-main);
    line-height: 1.6;
    overflow-x: hidden;
}

/* 2. Layouts Generales */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

main {
    min-height: calc(100vh - 180px);
    padding-bottom: 60px;
}

/* 3. Navegación (Header) */
.header {
    background-color: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid rgba(45, 90, 39, 0.08);
    box-shadow: var(--shadow-sm);
}

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

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    font-size: 24px;
    font-weight: 800;
    color: var(--color-primary);
    transition: var(--transition-smooth);
}

.brand svg {
    fill: none;
    stroke: var(--color-primary);
    stroke-width: 2;
    transition: var(--transition-smooth);
}

.brand:hover {
    transform: translateY(-1px);
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: 20px;
    list-style: none;
}

.nav-link {
    text-decoration: none;
    color: var(--color-text-muted);
    font-weight: 500;
    font-size: 16px;
    transition: var(--transition-smooth);
    padding: 8px 12px;
    border-radius: var(--border-radius-sm);
}

.nav-link:hover {
    color: var(--color-primary);
    background-color: var(--color-primary-light);
}

.nav-btn {
    text-decoration: none;
    background-color: var(--color-primary);
    color: var(--color-text-light);
    padding: 10px 20px;
    border-radius: 50px;
    font-weight: 600;
    white-space: nowrap;
    transition: var(--transition-smooth);
    box-shadow: 0 4px 10px rgba(45, 90, 39, 0.15);
}

.nav-btn:hover {
    background-color: var(--color-primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 6px 14px rgba(45, 90, 39, 0.25);
}

.nav-btn-secondary {
    text-decoration: none;
    border: 2px solid var(--color-primary);
    color: var(--color-primary);
    padding: 8px 18px;
    border-radius: 50px;
    font-weight: 600;
    white-space: nowrap;
    transition: var(--transition-smooth);
}

.nav-btn-secondary:hover {
    background-color: var(--color-primary-light);
    transform: translateY(-1px);
}

/* Menú hamburguesa para móvil */
.nav-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
}

.nav-toggle span {
    display: block;
    width: 25px;
    height: 3px;
    background-color: var(--color-primary);
    margin: 5px 0;
    border-radius: 3px;
    transition: var(--transition-smooth);
}

/* 4. Tipografía y Encabezados */
h1, h2, h3, h4, h5, h6 {
    color: var(--color-text-main);
    font-weight: 700;
    line-height: 1.25;
}

.text-center { text-align: center; }
.py-5 { padding-top: 48px; padding-bottom: 48px; }
.mb-4 { margin-bottom: 24px; }
.mb-5 { margin-bottom: 40px; }

/* 5. Banner de Héroe y Buscador */
.hero-search-wrapper {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 40px;
    align-items: center;
    margin: 30px auto 40px auto;
    background: linear-gradient(135deg, rgba(45, 90, 39, 0.04) 0%, rgba(226, 125, 59, 0.03) 100%);
    border: 1px solid rgba(45, 90, 39, 0.08);
    border-radius: 20px;
    padding: 30px 40px;
    box-shadow: var(--shadow-sm);
}

.hero-search-wrapper .hero {
    text-align: left;
    margin: 0;
    max-width: 100%;
}

.hero-search-wrapper .hero h1 {
    font-size: 36px;
    font-weight: 800;
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-accent) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 12px;
    line-height: 1.2;
}

.hero-search-wrapper .hero p {
    font-size: 16px;
    color: var(--color-text-muted);
    line-height: 1.5;
    margin: 0;
}

.hero {
    text-align: center;
    max-width: 800px;
    margin: 40px auto 30px auto;
}

.hero h1 {
    font-size: 48px;
    font-weight: 800;
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-accent) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 12px;
}

.hero p {
    font-size: 18px;
    color: var(--color-text-muted);
}

.search-box {
    background-color: var(--color-bg-surface);
    border-radius: var(--border-radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-lg);
    border: 1px solid rgba(45, 90, 39, 0.06);
    margin-bottom: 40px;
}

.search-form {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr auto;
    gap: 16px;
    align-items: center;
}

.form-group-search {
    position: relative;
}

.form-group-search svg {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    fill: none;
    stroke: var(--color-text-muted);
}

.search-input {
    width: 100%;
    padding: 14px 16px 14px 44px;
    border: 2px solid rgba(45, 90, 39, 0.08);
    border-radius: var(--border-radius-md);
    font-family: inherit;
    font-size: 16px;
    outline: none;
    transition: var(--transition-smooth);
}

.search-input:focus, .select-input:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 4px rgba(45, 90, 39, 0.08);
}

.select-input {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid rgba(45, 90, 39, 0.08);
    border-radius: var(--border-radius-md);
    font-family: inherit;
    font-size: 16px;
    outline: none;
    background-color: white;
    cursor: pointer;
    transition: var(--transition-smooth);
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%23677565'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    background-size: 18px;
}

.btn-search {
    background-color: var(--color-secondary);
    color: white;
    border: none;
    padding: 14px 28px;
    border-radius: var(--border-radius-md);
    font-family: inherit;
    font-weight: 600;
    font-size: 16px;
    cursor: pointer;
    transition: var(--transition-smooth);
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 10px rgba(226, 125, 59, 0.2);
}

.btn-search:hover {
    background-color: #d16928;
    transform: translateY(-1px);
    box-shadow: 0 6px 14px rgba(226, 125, 59, 0.35);
}

.btn-search-secondary {
    display: none;
    background-color: var(--color-bg-surface);
    color: var(--color-primary);
    border: 2px solid rgba(45, 90, 39, 0.12);
    border-radius: var(--border-radius-md);
    cursor: pointer;
    transition: all 0.2s;
}

.btn-search-secondary:hover {
    background-color: rgba(45, 90, 39, 0.04);
    border-color: var(--color-primary);
}

.collapsible-filters {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
}

/* 6. Catálogo de Artículos (Cards Grid) */
.donations-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 32px;
}

.card {
    background-color: var(--color-bg-surface);
    border-radius: var(--border-radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    border: 1px solid rgba(45, 90, 39, 0.05);
    display: flex;
    flex-direction: column;
    height: 100%;
    transition: var(--transition-smooth);
    position: relative;
}

.card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-lg);
    border-color: rgba(45, 90, 39, 0.15);
}

.card-image-wrapper {
    position: relative;
    width: 100%;
    padding-top: 66.66%; /* Ratio 3:2 */
    background-color: #f3f4f6;
    overflow: hidden;
}

.card-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

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

.card-badge {
    position: absolute;
    top: 16px;
    left: 16px;
    background-color: var(--color-accent);
    color: white;
    padding: 4px 12px;
    border-radius: 50px;
    font-size: 12px;
    font-weight: 600;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.card-content {
    padding: 20px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.card-title {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 8px;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-desc {
    font-size: 14px;
    color: var(--color-text-muted);
    margin-bottom: 16px;
    flex-grow: 1;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid rgba(45, 90, 39, 0.05);
    padding-top: 14px;
}

.card-location {
    font-size: 13px;
    font-weight: 500;
    color: var(--color-text-muted);
    display: flex;
    align-items: center;
    gap: 4px;
}

.card-location svg {
    fill: none;
    stroke: var(--color-text-muted);
}

.btn-card {
    text-decoration: none;
    color: var(--color-primary);
    font-weight: 600;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 4px;
    transition: var(--transition-smooth);
}

.btn-card:hover {
    color: var(--color-secondary);
    gap: 8px;
}

/* 7. Badges de Estado */
.badge-status {
    padding: 4px 10px;
    border-radius: 50px;
    font-size: 12px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.badge-status::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    display: inline-block;
}

.status-disponible {
    background-color: var(--color-primary-light);
    color: var(--color-success);
}
.status-disponible::before {
    background-color: var(--color-success);
    box-shadow: 0 0 8px var(--color-success);
}

.status-pausado {
    background-color: var(--color-secondary-light);
    color: var(--color-warning);
}
.status-pausado::before {
    background-color: var(--color-warning);
}

.status-entregado {
    background-color: #f3f4f6;
    color: #4b5563;
}
.status-entregado::before {
    background-color: #4b5563;
}

/* 8. Formularios de Autenticación / Registro / Publicación */
.auth-container {
    max-width: 480px;
    margin: 40px auto;
    background-color: var(--color-bg-surface);
    border-radius: var(--border-radius-lg);
    padding: 40px;
    box-shadow: var(--shadow-lg);
    border: 1px solid rgba(45, 90, 39, 0.05);
}

.form-title {
    font-size: 28px;
    font-weight: 800;
    margin-bottom: 8px;
}

.form-subtitle {
    color: var(--color-text-muted);
    margin-bottom: 24px;
    font-size: 15px;
}

.form-group {
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-group label {
    font-weight: 600;
    font-size: 14px;
    color: var(--color-text-main);
}

.form-control {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid rgba(45, 90, 39, 0.08);
    border-radius: var(--border-radius-sm);
    font-family: inherit;
    font-size: 15px;
    outline: none;
    transition: var(--transition-smooth);
}

.form-control:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 4px rgba(45, 90, 39, 0.06);
}

.btn-submit {
    width: 100%;
    background-color: var(--color-primary);
    color: white;
    border: none;
    padding: 14px;
    border-radius: var(--border-radius-sm);
    font-family: inherit;
    font-weight: 600;
    font-size: 16px;
    cursor: pointer;
    transition: var(--transition-smooth);
    margin-top: 10px;
    box-shadow: 0 4px 10px rgba(45, 90, 39, 0.15);
}

.btn-submit:hover {
    background-color: var(--color-primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 6px 14px rgba(45, 90, 39, 0.25);
}

.form-redirect-text {
    text-align: center;
    margin-top: 20px;
    font-size: 14px;
    color: var(--color-text-muted);
}

.form-redirect-link {
    color: var(--color-primary);
    text-decoration: none;
    font-weight: 600;
}

.form-redirect-link:hover {
    text-decoration: underline;
}

/* 9. Alertas (Estilo Toast/Notificación) */
.alert {
    padding: 16px 20px;
    border-radius: var(--border-radius-sm);
    font-weight: 500;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 15px;
    animation: slideIn 0.3s ease-out;
}

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

.alert-danger {
    background-color: #fde8e8;
    color: var(--color-danger);
    border-left: 4px solid var(--color-danger);
}

.alert-success {
    background-color: var(--color-primary-light);
    color: var(--color-success);
    border-left: 4px solid var(--color-success);
}

/* 10. Vista Detalle de Donación */
.detail-container {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 40px;
    margin-top: 30px;
}

.detail-img-box {
    border-radius: var(--border-radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    border: 1px solid rgba(45, 90, 39, 0.05);
    background-color: #fff;
}

.detail-img {
    width: 100%;
    height: auto;
    display: block;
    max-height: 500px;
    object-fit: cover;
}

.detail-info-box {
    background-color: var(--color-bg-surface);
    border-radius: var(--border-radius-lg);
    padding: 32px;
    box-shadow: var(--shadow-md);
    border: 1px solid rgba(45, 90, 39, 0.05);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.detail-header {
    margin-bottom: 20px;
}

.detail-category {
    font-size: 14px;
    text-transform: uppercase;
    font-weight: 700;
    color: var(--color-accent);
    letter-spacing: 1px;
    margin-bottom: 6px;
}

.detail-title {
    font-size: 32px;
    font-weight: 800;
    margin-bottom: 12px;
}

.detail-meta {
    display: flex;
    gap: 16px;
    font-size: 14px;
    color: var(--color-text-muted);
    margin-bottom: 20px;
}

.detail-meta span {
    display: flex;
    align-items: center;
    gap: 4px;
}

.detail-desc-title {
    font-weight: 700;
    font-size: 16px;
    margin-bottom: 8px;
    color: var(--color-text-main);
}

.detail-desc {
    color: var(--color-text-muted);
    font-size: 15px;
    margin-bottom: 30px;
}

/* Área de Contacto */
.contact-section {
    border-top: 1px solid rgba(45, 90, 39, 0.08);
    padding-top: 24px;
}

.contact-options {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.btn-contact-whatsapp {
    text-decoration: none;
    background-color: #25d366;
    color: white;
    padding: 14px 20px;
    border-radius: var(--border-radius-sm);
    font-weight: 600;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: var(--transition-smooth);
    box-shadow: 0 4px 10px rgba(37, 211, 102, 0.2);
}

.btn-contact-whatsapp:hover {
    background-color: #20ba59;
    transform: translateY(-1px);
    box-shadow: 0 6px 14px rgba(37, 211, 102, 0.35);
}

.safety-tips {
    background-color: var(--color-secondary-light);
    border: 1px solid rgba(226, 125, 59, 0.15);
    border-radius: var(--border-radius-sm);
    padding: 16px;
    font-size: 13px;
    color: #974d1a;
    display: flex;
    gap: 10px;
    margin-top: 24px;
}

.safety-tips svg {
    flex-shrink: 0;
    fill: none;
    stroke: #974d1a;
}

/* 11. Dashboard / Panel de Donante */
.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 32px;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
}

.dashboard-card {
    background-color: var(--color-bg-surface);
    border-radius: var(--border-radius-md);
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: var(--shadow-sm);
    border: 1px solid rgba(45, 90, 39, 0.05);
    transition: var(--transition-smooth);
}

.dashboard-card:hover {
    box-shadow: var(--shadow-md);
    border-color: rgba(45, 90, 39, 0.1);
}

.dashboard-card-info {
    display: flex;
    align-items: center;
    gap: 20px;
}

.dashboard-card-img {
    width: 80px;
    height: 80px;
    border-radius: var(--border-radius-sm);
    object-fit: cover;
}

.dashboard-card-text h3 {
    font-size: 18px;
    margin-bottom: 4px;
}

.dashboard-card-text p {
    font-size: 14px;
    color: var(--color-text-muted);
}

.dashboard-card-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.btn-action {
    background: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    padding: 8px 16px;
    border-radius: var(--border-radius-sm);
    transition: var(--transition-smooth);
    display: flex;
    align-items: center;
    gap: 6px;
}

.btn-action-status {
    background-color: var(--color-bg-base);
    color: var(--color-text-main);
    border: 1px solid rgba(45, 90, 39, 0.15);
}

.btn-action-status:hover {
    background-color: var(--color-primary-light);
    color: var(--color-primary);
}

.btn-action-delete {
    background-color: #fde8e8;
    color: var(--color-danger);
}

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

.empty-state {
    text-align: center;
    padding: 60px 24px;
    background-color: var(--color-bg-surface);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-sm);
}

.empty-state svg {
    margin-bottom: 16px;
    stroke: var(--color-text-muted);
}

.empty-state h3 {
    margin-bottom: 8px;
}

.empty-state p {
    color: var(--color-text-muted);
    margin-bottom: 24px;
}

/* 12. Preview de imagen al donar */
.image-preview-box {
    width: 100%;
    height: 200px;
    border: 2px dashed rgba(45, 90, 39, 0.2);
    border-radius: var(--border-radius-sm);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: var(--transition-smooth);
    background-color: #fafbfc;
}

.image-preview-box:hover {
    border-color: var(--color-primary);
    background-color: var(--color-primary-light);
}

.image-preview-box img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 2;
}

.image-preview-text {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    color: var(--color-text-muted);
    font-size: 14px;
    z-index: 1;
}

/* 13. Pie de Página (Footer) */
.footer {
    background-color: var(--color-primary-dark);
    color: rgba(255, 255, 255, 0.7);
    padding: 40px 0;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

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

.footer-logo {
    color: white;
    font-weight: 800;
    font-size: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.footer-logo svg {
    stroke: white;
    fill: none;
}

.footer-text {
    font-size: 14px;
}

/* 14. Responsive Media Queries */
@media (max-width: 900px) {
    .detail-container {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .navbar {
        position: relative;
    }
    
    .nav-toggle {
        display: block;
    }
    
    .nav-menu {
        position: absolute;
        top: 80px;
        left: -24px;
        right: -24px;
        background-color: white;
        flex-direction: column;
        padding: 24px;
        border-bottom: 1px solid rgba(45, 90, 39, 0.08);
        box-shadow: var(--shadow-md);
        display: none; /* Controlado por JS */
        gap: 16px;
    }
    
    .nav-menu.active {
        display: flex;
    }
    
    .search-form {
        grid-template-columns: 1fr;
    }
    
    .hero h1 {
        font-size: 36px;
    }
    
    .dashboard-card {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }
    
    .dashboard-card-actions {
        width: 100%;
        justify-content: flex-end;
    }
}

/* ==========================================================================
   Estilos de Galería e Imágenes Múltiples (RedAbraza)
   ========================================================================== */

/* Subida de Fotos Secundarias */
.secondary-images-upload-box {
    border: 2px dashed rgba(45, 90, 39, 0.2);
    background-color: var(--color-bg-base);
    border-radius: var(--border-radius-sm);
    padding: 20px;
    text-align: center;
    cursor: pointer;
    transition: var(--transition-smooth);
    display: flex;
    justify-content: center;
    align-items: center;
}

.secondary-images-upload-box:hover {
    border-color: var(--color-primary);
    background-color: var(--color-primary-light);
}

.secondary-images-upload-box svg {
    stroke: var(--color-primary);
    margin-bottom: 4px;
}

.secondary-previews-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 12px;
    margin-top: 12px;
}

.secondary-preview-item {
    position: relative;
    width: 80px;
    height: 80px;
    border-radius: var(--border-radius-sm);
    overflow: hidden;
    border: 1px solid rgba(45, 90, 39, 0.1);
    box-shadow: var(--shadow-sm);
}

.secondary-preview-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.remove-preview-btn {
    position: absolute;
    top: 4px;
    right: 4px;
    background-color: var(--color-danger);
    color: white;
    border: none;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    font-size: 14px;
    line-height: 18px;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    transition: var(--transition-smooth);
}

.remove-preview-btn:hover {
    transform: scale(1.1);
    background-color: #b71c1c;
}

/* Galería en Vista Detalle */
.gallery-main {
    width: 100%;
    border-radius: var(--border-radius-lg) var(--border-radius-lg) 0 0;
    overflow: hidden;
    background-color: #f3f4f6;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 400px;
}

@media (max-width: 600px) {
    .gallery-main {
        height: 280px;
    }
}

.gallery-main img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.gallery-thumbnails {
    display: flex;
    gap: 12px;
    padding: 16px;
    background-color: var(--color-bg-surface);
    border-top: 1px solid rgba(45, 90, 39, 0.08);
    overflow-x: auto;
    border-radius: 0 0 var(--border-radius-lg) var(--border-radius-lg);
}

.gallery-thumb {
    width: 64px;
    height: 64px;
    border-radius: var(--border-radius-sm);
    overflow: hidden;
    cursor: pointer;
    border: 2px solid transparent;
    opacity: 0.6;
    transition: var(--transition-smooth);
    flex-shrink: 0;
}

.gallery-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.gallery-thumb:hover, .gallery-thumb.active {
    opacity: 1;
}

.gallery-thumb.active {
    border-color: var(--color-primary);
    box-shadow: 0 0 6px rgba(45, 90, 39, 0.3);
}

/* Ajustes a contenedor de imagen anterior */
.detail-img-box {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Estilos para el divisor de autenticación */
.auth-divider {
    display: flex;
    align-items: center;
    text-align: center;
    margin: 20px 0;
    color: #888;
    font-size: 14px;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid #e0e0e0;
}

.auth-divider:not(:empty)::before {
    margin-right: .5em;
}

.auth-divider:not(:empty)::after {
    margin-left: .5em;
}

/* Botón de Google OAuth */
.btn-google {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 12px;
    background-color: #ffffff;
    border: 1px solid #dadce0;
    border-radius: 8px;
    color: #3c4043;
    font-size: 16px;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: background-color 0.2s, box-shadow 0.2s;
    box-sizing: border-box;
}

.btn-google:hover {
    background-color: #f8f9fa;
    border-color: #d2e3fc;
    box-shadow: 0 1px 2px 0 rgba(60,64,67,0.3), 0 1px 3px 1px rgba(60,64,67,0.15);
}

.btn-google:active {
    background-color: #eeeeee;
}

/* ==========================================================================
   SISTEMA DE GAMIFICACIÓN - RECOMPENSAS 3D Y CONFETI
   ========================================================================== */

/* Fondo oscurecido con desenfoque */
.reward-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(45, 90, 39, 0.4);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    animation: fadeInOverlay 0.4s ease forwards;
}

/* Contenedor con perspectiva 3D */
.reward-container {
    width: 90%;
    max-width: 440px;
    height: 400px;
    perspective: 1200px;
}

/* Tarjeta 3D que gira */
.reward-card-3d {
    width: 100%;
    height: 100%;
    position: relative;
    transform-style: preserve-3d;
    transition: transform 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.reward-card-3d.flipped {
    transform: rotateY(180deg);
}

/* Caras de la Tarjeta */
.reward-card-front, .reward-card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    border-radius: 20px;
    box-shadow: 0 15px 35px rgba(45, 90, 39, 0.2);
    padding: 30px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    box-sizing: border-box;
}

/* Cara Frontal (Caja sorpresa) */
.reward-card-front {
    background: linear-gradient(135deg, #ffffff 0%, #f6f8f5 100%);
    border: 2px solid #a3c299;
    cursor: pointer;
}

/* Caja de sorpresa brillante */
.glow-box {
    text-align: center;
}

.gift-icon-wrapper {
    animation: pulse-glow 2s infinite ease-in-out;
}

.gift-svg {
    filter: drop-shadow(0 0 15px rgba(255, 215, 0, 0.6));
}

.reward-prompt {
    font-weight: 500;
    animation: pulse-text 1.5s infinite ease-in-out;
}

/* Cara Trasera (Cupón revelado) */
.reward-card-back {
    background: #ffffff;
    border: 3px solid var(--color-primary);
    transform: rotateY(180deg);
}

/* Animaciones */
@keyframes fadeInOverlay {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes pulse-glow {
    0%, 100% {
        transform: scale(1) translateY(0);
        filter: drop-shadow(0 0 10px rgba(255, 215, 0, 0.4));
    }
    50% {
        transform: scale(1.08) translateY(-5px);
        filter: drop-shadow(0 0 25px rgba(255, 215, 0, 0.8));
    }
}

@keyframes pulse-text {
    0%, 100% { opacity: 0.7; }
    50% { opacity: 1; }
}

/* Estilos de partículas de confeti */
.confetti-piece {
    position: absolute;
    top: -20px;
    border-radius: 3px;
    z-index: 999;
    opacity: 0.9;
    animation: dropConfetti 2.5s ease-out forwards;
}

@keyframes dropConfetti {
    0% {
        top: 30%;
        transform: translateY(0) rotate(0deg);
        opacity: 1;
    }
    100% {
        top: 110%;
        transform: translateY(350px) rotate(720deg);
        opacity: 0;
    }
}

/* ==========================================
   Admin Panel Layout with Sidebar & Hamburger
   ========================================== */
.admin-layout {
    display: flex;
    gap: 30px;
    min-height: 70vh;
    position: relative;
    margin-top: 20px;
}

.admin-sidebar {
    width: 270px;
    flex-shrink: 0;
    background-color: #ffffff;
    border: 1px solid rgba(45, 90, 39, 0.08);
    border-radius: 12px;
    padding: 24px;
    box-shadow: var(--box-shadow-sm);
    display: flex;
    flex-direction: column;
    gap: 20px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.admin-sidebar-header {
    padding-bottom: 15px;
    border-bottom: 2px solid rgba(45, 90, 39, 0.05);
    margin-bottom: 5px;
}

.admin-sidebar-brand {
    font-size: 15px;
    font-weight: 800;
    color: var(--color-primary);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.admin-sidebar-menu {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.admin-menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: var(--color-text-muted);
    font-weight: 600;
    font-size: 14px;
    border-radius: 8px;
    cursor: pointer;
    background: transparent;
    border: none;
    text-align: left;
    width: 100%;
    transition: all 0.2s ease;
}

.admin-menu-item:hover {
    background-color: var(--color-bg-base);
    color: var(--color-primary);
}

.admin-menu-item.active {
    background-color: var(--color-primary);
    color: #ffffff !important;
    box-shadow: 0 4px 10px rgba(45, 90, 39, 0.15);
}

.admin-menu-item svg {
    flex-shrink: 0;
}

.admin-main-content {
    flex-grow: 1;
    min-width: 0;
}

/* Mobile Admin Navbar Toggle */
.admin-mobile-bar {
    display: none;
    align-items: center;
    justify-content: space-between;
    background-color: #ffffff;
    border: 1px solid rgba(45, 90, 39, 0.08);
    border-radius: 12px;
    padding: 12px 20px;
    margin-bottom: 20px;
    box-shadow: var(--box-shadow-sm);
}

.admin-mobile-brand {
    font-size: 15px;
    font-weight: 800;
    color: var(--color-primary);
    text-transform: uppercase;
}

.admin-hamburger-btn {
    background: transparent;
    border: none;
    color: var(--color-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    padding: 8px;
    border-radius: 8px;
    transition: background 0.2s;
}

.admin-hamburger-btn:hover {
    background-color: var(--color-bg-base);
}

.admin-sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.4);
    z-index: 998;
    backdrop-filter: blur(2px);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.admin-sidebar-overlay.open {
    display: block;
    opacity: 1;
}

@media (max-width: 991px) {
    .admin-mobile-bar {
        display: flex;
    }
    
    .admin-layout {
        flex-direction: column;
        gap: 0;
        margin-top: 10px;
    }
    
    .admin-sidebar {
        position: fixed;
        top: 0;
        left: -320px;
        height: 100vh;
        width: 280px;
        z-index: 999;
        border-radius: 0;
        border: none;
        box-shadow: 5px 0 25px rgba(0,0,0,0.15);
    }
    
    .admin-sidebar.open {
        left: 0;
    }
}

/* ==========================================================================
   Optimizaciones de Responsividad Global y Vista Principal (Móviles)
   ========================================================================== */
@media (max-width: 600px) {
    /* Cuadrícula de Donaciones Principal en 2 Columnas */
    .donations-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    /* Ajustes para las Tarjetas en Diseño de 2 Columnas */
    .card-content {
        padding: 12px;
    }

    .card-title {
        font-size: 14px;
        margin-bottom: 4px;
        -webkit-line-clamp: 2;
    }

    .card-desc {
        font-size: 11px;
        margin-bottom: 10px;
        -webkit-line-clamp: 2;
        line-height: 1.4;
    }

    .card-footer {
        padding-top: 8px;
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .card-location {
        font-size: 10px;
    }

    .btn-card {
        font-size: 11px;
        width: 100%;
        justify-content: space-between;
    }

    .card-badge {
        top: 8px;
        left: 8px;
        padding: 2px 8px;
        font-size: 10px;
    }

    /* Banner Hero Adaptativo */
    .hero-search-wrapper {
        grid-template-columns: 1fr;
        gap: 20px;
        padding: 20px 16px;
        margin: 20px auto;
    }

    .hero-search-wrapper .hero {
        text-align: center !important;
    }

    .hero-search-wrapper .hero h1 {
        font-size: 26px !important;
    }

    .hero-search-wrapper .hero p {
        font-size: 13px !important;
    }

    .hero-search-wrapper .search-box {
        padding: 16px;
        margin-bottom: 0;
    }

    .hero {
        padding: 40px 16px;
        margin-bottom: 24px;
        border-radius: 16px;
    }

    .hero h1 {
        font-size: 26px;
        line-height: 1.2;
        margin-bottom: 12px;
    }

    .hero p {
        font-size: 13px;
        line-height: 1.5;
    }

    /* Caja de Búsqueda y Filtros en Móvil */
    #toggle-filters-btn {
        display: flex !important;
    }

    .collapsible-filters {
        display: none !important;
    }

    .collapsible-filters.expanded {
        display: flex !important;
    }

    .search-box {
        padding: 16px;
        margin-bottom: 30px;
    }

    .search-form {
        gap: 10px;
    }

    .search-input, .select-input {
        padding: 10px 12px;
        font-size: 13px;
    }

    .btn-search {
        width: 100%;
        padding: 12px;
        font-size: 14px;
    }

    /* Detalle y Formularios Generales */
    .detail-title {
        font-size: 22px !important;
    }

    .detail-img-box {
        margin-bottom: 16px;
    }

    .detail-info-box {
        padding: 16px !important;
    }

    .form-box {
        padding: 24px 16px !important;
    }
}

/* 18. Cámara Modal (WebRTC) */
.camera-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
}

.camera-container {
    position: relative;
    width: 100%;
    max-width: 600px;
    background: #000;
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

#camera-stream {
    width: 100%;
    height: auto;
    max-height: 70vh;
    object-fit: cover;
    background-color: #222;
}

.camera-controls {
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: 20px;
    background: rgba(0, 0, 0, 0.8);
}

.camera-btn {
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: transform 0.2s, background-color 0.2s;
}

.camera-btn:active {
    transform: scale(0.95);
}

.capture-btn {
    width: 70px;
    height: 70px;
    background-color: #fff;
    border: 4px solid #ddd;
    box-shadow: 0 0 0 4px #fff inset;
}

.capture-btn:hover {
    background-color: #f0f0f0;
}

.secondary-btn, .close-btn {
    width: 50px;
    height: 50px;
    background-color: rgba(255, 255, 255, 0.2);
    color: white;
}

.secondary-btn:hover, .close-btn:hover {
    background-color: rgba(255, 255, 255, 0.3);
}

.btn-camera-option:hover {
    opacity: 0.9;
    transform: translateY(-2px);
}
