/**
 * cookies.css - Banner de cookies y modal legal de GeoParcel
 * Tema oscuro unificado con gestor/visor (tokens en /shared/theme.css; se usan
 * fallbacks literales porque no todas las páginas cargan theme.css).
 */

.gp-cookie-banner {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: calc(100% - 48px);
    max-width: 380px;
    background: var(--bg2, rgba(18, 26, 18, 0.98));
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid var(--border, rgba(255, 255, 255, 0.10));
    border-radius: var(--radius, 10px);
    padding: 20px;
    box-shadow: var(--shadow, 0 4px 20px rgba(0, 0, 0, 0.72));
    z-index: 99999;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    flex-direction: column;
    gap: 14px;
    font-family: var(--font, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif);
}

.gp-cookie-banner.visible {
    transform: translateY(0);
    opacity: 1;
}

.gp-cookie-content h3 {
    margin: 0 0 4px 0;
    color: #fff;
    font-size: 1rem;
    font-weight: 700;
}

.gp-cookie-content p {
    margin: 0;
    color: var(--text-sec, #aaa);
    font-size: 0.85rem;
    line-height: 1.4;
}

.gp-cookie-content a {
    color: var(--green, #7fff7f);
    text-decoration: underline;
    font-weight: 500;
}

.gp-cookie-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.gp-cookie-btn {
    padding: 10px 14px;
    border-radius: var(--radius-sm, 7px);
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid transparent;
    flex: 1;
    min-width: 90px;
    white-space: nowrap;
    font-family: inherit;
}

.gp-cookie-btn-primary {
    background: var(--green-dim, rgba(0, 200, 80, 0.22));
    border-color: var(--accent-border, rgba(0, 220, 120, 0.45));
    color: var(--green, #7fff7f);
    flex: 1.4;
}

.gp-cookie-btn-primary:hover {
    background: rgba(0, 180, 100, 0.38);
    color: #fff;
    transform: scale(1.02);
}

.gp-cookie-btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--border, rgba(255, 255, 255, 0.10));
    color: var(--text-sec, #aaa);
}

.gp-cookie-btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.gp-cookie-settings-view {
    display: none;
    flex-direction: column;
    gap: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--border, rgba(255, 255, 255, 0.10));
}

.gp-cookie-settings-view.active {
    display: flex;
}

.gp-cookie-option {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.85rem;
    color: var(--text-sec, #aaa);
}

.gp-cookie-option input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--green, #7fff7f);
    cursor: pointer;
}

.gp-cookie-option label {
    cursor: pointer;
}

.gp-cookie-option.disabled {
    opacity: 0.6;
}

.gp-cookie-option.disabled input {
    cursor: not-allowed;
}

/* Responsive tweaks */
@media (max-width: 600px) {
    .gp-cookie-banner {
        bottom: 16px;
        right: 16px;
        width: calc(100% - 32px);
        padding: 20px;
    }
    .gp-cookie-actions {
        flex-direction: column;
    }
}

/* ──────────────────────────────────────────────────────────────────────
 * Legal modal (overlay shown when the user clicks "Política de Cookies")
 * ────────────────────────────────────────────────────────────────────── */
.gp-legal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100000;
    padding: 24px;
    opacity: 0;
    transition: opacity 0.25s ease;
    font-family: var(--font, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif);
}

.gp-legal-overlay.visible {
    opacity: 1;
}

.gp-legal-card {
    background: var(--bg2, rgba(18, 26, 18, 0.98));
    border: 1px solid var(--border, rgba(255, 255, 255, 0.10));
    border-radius: var(--radius, 10px);
    width: 100%;
    max-width: 820px;
    max-height: calc(100vh - 48px);
    box-shadow: var(--shadow, 0 4px 20px rgba(0, 0, 0, 0.72));
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: translateY(12px) scale(0.98);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.gp-legal-overlay.visible .gp-legal-card {
    transform: translateY(0) scale(1);
}

.gp-legal-close {
    position: absolute;
    top: 12px;
    right: 16px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    border: none;
    cursor: pointer;
    font-size: 22px;
    line-height: 1;
    color: var(--text-sec, #aaa);
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.gp-legal-close:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
}

.gp-legal-body {
    padding: 32px 36px 16px;
    overflow-y: auto;
    flex: 1;
    color: var(--text, #eee);
    line-height: 1.65;
    font-size: 0.94rem;
    position: relative;
}

.gp-legal-loading {
    text-align: center;
    color: var(--text-muted, #949494);
    padding: 60px 0;
    font-size: 0.95rem;
}

.gp-legal-body h1 {
    color: #fff;
    font-size: 1.6rem;
    margin: 0 0 6px;
}

.gp-legal-body .subtitle {
    color: var(--text-muted, #949494);
    font-size: 0.85rem;
    margin-bottom: 24px;
}

.gp-legal-body h2 {
    color: var(--green, #7fff7f);
    font-size: 1.15rem;
    border-bottom: 1px solid var(--border, rgba(255, 255, 255, 0.10));
    padding-bottom: 6px;
    margin-top: 28px;
}

.gp-legal-body h3 {
    color: var(--green, #7fff7f);
    font-size: 0.98rem;
    margin-top: 18px;
}

.gp-legal-body a {
    color: var(--green, #7fff7f);
    text-decoration: underline;
}

.gp-legal-body a:hover { color: #fff; }

.gp-legal-body code {
    background: rgba(255, 255, 255, 0.08);
    padding: 1px 6px;
    border-radius: 4px;
    font-size: 0.86em;
}

.gp-legal-body table {
    border-collapse: collapse;
    width: 100%;
    margin: 12px 0;
    font-size: 0.84rem;
}

.gp-legal-body th,
.gp-legal-body td {
    border: 1px solid var(--border, rgba(255, 255, 255, 0.10));
    padding: 8px 10px;
    text-align: left;
    vertical-align: top;
}

.gp-legal-body th { background: rgba(255, 255, 255, 0.06); font-weight: 600; }

.gp-legal-body .info-box {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border, rgba(255, 255, 255, 0.10));
    border-left: 4px solid var(--green, #7fff7f);
    padding: 12px 16px;
    border-radius: 6px;
    margin: 14px 0;
    font-size: 0.9rem;
}

.gp-legal-body .footer-note {
    margin-top: 28px;
    padding-top: 16px;
    border-top: 1px solid var(--border, rgba(255, 255, 255, 0.10));
    color: var(--text-muted, #949494);
    font-size: 0.78rem;
}

.gp-legal-footer {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    padding: 14px 24px;
    border-top: 1px solid var(--border, rgba(255, 255, 255, 0.10));
    background: rgba(0, 0, 0, 0.25);
    flex-wrap: wrap;
}

.gp-legal-btn {
    padding: 10px 16px;
    border-radius: var(--radius-sm, 7px);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid transparent;
    font-family: inherit;
}

.gp-legal-btn-primary {
    background: var(--green-dim, rgba(0, 200, 80, 0.22));
    border-color: var(--accent-border, rgba(0, 220, 120, 0.45));
    color: var(--green, #7fff7f);
}

.gp-legal-btn-primary:hover {
    background: rgba(0, 180, 100, 0.38);
    color: #fff;
}

.gp-legal-btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--border, rgba(255, 255, 255, 0.10));
    color: var(--text-sec, #aaa);
}

.gp-legal-btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

@media (max-width: 600px) {
    .gp-legal-overlay { padding: 0; }
    .gp-legal-card {
        max-height: 100vh;
        height: 100vh;
        border-radius: 0;
        max-width: 100%;
    }
    .gp-legal-body { padding: 24px 18px 12px; }
}
