/*
Theme Name: Digni
Theme URI: https://digni.com.br
Author: Digni Tecnologia
Author URI: https://digni.com.br
Description: Custom WordPress theme for Digni funeral services marketplace. Features WooCommerce integration, multi-step checkout, and zone-based partner routing.
Version: 1.3.3
Requires at least: 6.0
Tested up to: 6.4
Requires PHP: 8.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: digni

This theme recreates the Digni funeral services marketplace with a premium, trustworthy design focused on transparency and ease of use during difficult moments.

=== CHANGELOG (Internal) ===
v1.3.3 - 2024-12-19
  - Added "Preço Final Garantido" seal next to service prices
  - Added price comparison card (Digni vs Outras Funerárias) below service cards
  - Removed exit-intent popup (replaced by static comparison card)
v1.3.2 - 2024-12-19
  - FIXED: Neighborhood search now uses startsWith (meier finds Méier, not Cosme Velho)
v1.3.1 - 2024-12-19
  - Added Telegram settings tab in WP Admin Notifications page
  - Accent-insensitive neighborhood search (meier finds Méier)
  - Fixed settings registration to prevent data loss between tabs
v1.3.0 - 2024-12-16
  - Task 2: Phone confirmation field in Step 3 checkout
  - Task 3: Deceased cannot be card holder validation
  - Task 4: Legal consent checkbox (responsible for burial + invoice)
  - Task 5B: Exit-intent price caution modal for better conversion
  - Task 6: Telegram notifications for new leads and payments
  - Task 7: Admin settings unsaved changes warning
  - Improved form validation and error messages
v1.2.1 - 2024-12-10
  - Fixed expiry field to allow proper backspace deletion
  - Installments now show calculated values (ex: 2x de R$ 2.500,00)
  - Interest rates shown for 7x+ installments (~1.99%/month)
  - Fixed "dados do pedido não encontrado" error by initializing order data
v1.2.0 - 2024-12-10
  - Conditional upgrades per service (each upgrade can be configured to appear for specific services)
  - Add/delete upgrades from admin panel
  - Per-service checkboxes in admin for upgrade visibility
v1.1.0 - 2024-12-10
  - Improved WhatsApp floating button with tooltip
  - Fixed mobile overlap with Continue button
  - Added version tracking system
v1.0.0 - 2024-12
  - Initial release
========================
*/

/* =========================================
   DIGNI DESIGN SYSTEM
   ========================================= */

/* CSS Custom Properties (Design Tokens) */
:root {
    /* Brand Colors - Sage Green Palette */
    --digni-50: #F5F9F7;
    --digni-100: #E6F0EC;
    --digni-200: #CDDFD8;
    --digni-300: #ACCBC0;
    --digni-400: #8FB4A6;
    --digni-500: #82AA9B;
    --digni-600: #658A7D;
    --digni-700: #4D6B60;
    --digni-800: #3A4F48;
    --digni-900: #2F3F3A;

    /* Semantic Colors */
    --color-background: var(--digni-50);
    --color-surface: #ffffff;
    --color-text-primary: #111827;
    --color-text-secondary: #6B7280;
    --color-text-muted: #9CA3AF;
    --color-border: #E5E7EB;
    --color-border-light: #F3F4F6;

    /* Status Colors */
    --color-success: #10B981;
    --color-success-light: #D1FAE5;
    --color-warning: #F59E0B;
    --color-warning-light: #FEF3C7;
    --color-error: #EF4444;
    --color-error-light: #FEE2E2;
    --color-info: #3B82F6;
    --color-info-light: #DBEAFE;

    /* Typography */
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-size-xs: 0.75rem;
    --font-size-sm: 0.875rem;
    --font-size-base: 1rem;
    --font-size-lg: 1.125rem;
    --font-size-xl: 1.25rem;
    --font-size-2xl: 1.5rem;
    --font-size-3xl: 1.875rem;

    /* Spacing */
    --space-1: 0.25rem;
    --space-2: 0.5rem;
    --space-3: 0.75rem;
    --space-4: 1rem;
    --space-5: 1.25rem;
    --space-6: 1.5rem;
    --space-8: 2rem;
    --space-10: 2.5rem;
    --space-12: 3rem;

    /* Border Radius */
    --radius-sm: 0.25rem;
    --radius-md: 0.375rem;
    --radius-lg: 0.5rem;
    --radius-xl: 0.75rem;
    --radius-2xl: 1rem;
    --radius-full: 9999px;

    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);

    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-normal: 300ms ease;
    --transition-slow: 500ms ease;
}

/* =========================================
   BASE STYLES
   ========================================= */

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

html {
    font-size: 16px;
    scroll-behavior: smooth;
    color-scheme: light;
}

body {
    font-family: var(--font-family);
    font-size: var(--font-size-base);
    line-height: 1.6;
    color: var(--color-text-primary);
    background-color: var(--color-background);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* =========================================
   TYPOGRAPHY
   ========================================= */

h1,
h2,
h3,
h4,
h5,
h6 {
    font-weight: 700;
    line-height: 1.3;
    color: var(--digni-800);
}

h1 {
    font-size: var(--font-size-3xl);
}

h2 {
    font-size: var(--font-size-2xl);
}

h3 {
    font-size: var(--font-size-xl);
}

h4 {
    font-size: var(--font-size-lg);
}

p {
    margin-bottom: var(--space-4);
}

a {
    color: var(--digni-600);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--digni-800);
}

strong {
    font-weight: 600;
}

/* =========================================
   LAYOUT
   ========================================= */

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--space-4);
}

.container-sm {
    max-width: 640px;
}

.container-md {
    max-width: 768px;
}

.container-lg {
    max-width: 1024px;
}

.min-h-screen {
    min-height: 100vh;
}

.flex {
    display: flex;
}

.flex-col {
    flex-direction: column;
}

.flex-grow {
    flex-grow: 1;
}

.items-center {
    align-items: center;
}

.justify-center {
    justify-content: center;
}

.justify-between {
    justify-content: space-between;
}

.gap-2 {
    gap: var(--space-2);
}

.gap-3 {
    gap: var(--space-3);
}

.gap-4 {
    gap: var(--space-4);
}

.gap-6 {
    gap: var(--space-6);
}

.gap-8 {
    gap: var(--space-8);
}

.grid {
    display: grid;
}

.grid-cols-1 {
    grid-template-columns: repeat(1, minmax(0, 1fr));
}

.grid-cols-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid-cols-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

/* =========================================
   SPACING UTILITIES
   ========================================= */

.mt-1 {
    margin-top: var(--space-1);
}

.mt-2 {
    margin-top: var(--space-2);
}

.mt-4 {
    margin-top: var(--space-4);
}

.mt-6 {
    margin-top: var(--space-6);
}

.mt-8 {
    margin-top: var(--space-8);
}

.mb-2 {
    margin-bottom: var(--space-2);
}

.mb-3 {
    margin-bottom: var(--space-3);
}

.mb-4 {
    margin-bottom: var(--space-4);
}

.mb-6 {
    margin-bottom: var(--space-6);
}

.mb-8 {
    margin-bottom: var(--space-8);
}

.pt-8 {
    padding-top: var(--space-8);
}

.pb-8 {
    padding-bottom: var(--space-8);
}

.pb-10 {
    padding-bottom: var(--space-10);
}

.pb-12 {
    padding-bottom: var(--space-12);
}

.p-4 {
    padding: var(--space-4);
}

.p-5 {
    padding: var(--space-5);
}

.p-6 {
    padding: var(--space-6);
}

.p-8 {
    padding: var(--space-8);
}

.px-3 {
    padding-left: var(--space-3);
    padding-right: var(--space-3);
}

.px-4 {
    padding-left: var(--space-4);
    padding-right: var(--space-4);
}

.px-6 {
    padding-left: var(--space-6);
    padding-right: var(--space-6);
}

.px-8 {
    padding-left: var(--space-8);
    padding-right: var(--space-8);
}

.py-2 {
    padding-top: var(--space-2);
    padding-bottom: var(--space-2);
}

.py-3 {
    padding-top: var(--space-3);
    padding-bottom: var(--space-3);
}

.py-4 {
    padding-top: var(--space-4);
    padding-bottom: var(--space-4);
}

/* =========================================
   COMPONENTS - BUTTONS
   ========================================= */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    padding: var(--space-3) var(--space-6);
    font-size: var(--font-size-sm);
    font-weight: 600;
    border-radius: var(--radius-lg);
    border: none;
    cursor: pointer;
    transition: all var(--transition-normal);
    text-decoration: none;
}

.btn-primary {
    background-color: var(--digni-600);
    color: white;
    box-shadow: var(--shadow-md), 0 0 0 0 var(--digni-200);
}

.btn-primary:hover {
    background-color: var(--digni-700);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg), 0 0 0 2px var(--digni-200);
}

.btn-primary:disabled {
    background-color: #D1D5DB;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-secondary {
    background-color: var(--digni-50);
    color: var(--digni-700);
    border: 1px solid var(--digni-200);
}

.btn-secondary:hover {
    background-color: var(--digni-100);
    border-color: var(--digni-300);
}

.btn-outline {
    background-color: transparent;
    color: var(--digni-600);
    border: 2px solid var(--digni-600);
}

.btn-outline:hover {
    background-color: var(--digni-600);
    color: white;
}

.btn-lg {
    padding: var(--space-4) var(--space-8);
    font-size: var(--font-size-base);
}

.btn-sm {
    padding: var(--space-2) var(--space-4);
    font-size: var(--font-size-xs);
}

.btn-icon {
    width: 40px;
    height: 40px;
    padding: 0;
    border-radius: var(--radius-full);
}

/* =========================================
   COMPONENTS - CARDS
   ========================================= */

.card {
    background-color: var(--color-surface);
    border-radius: var(--radius-xl);
    border: 1px solid var(--color-border);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    transition: all var(--transition-normal);
}

.card:hover {
    border-color: var(--digni-400);
    box-shadow: var(--shadow-lg);
}

.card-body {
    padding: var(--space-6);
}

.card-highlight {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background-color: var(--digni-200);
    transition: background-color var(--transition-normal);
}

.card:hover .card-highlight,
.card-serenity .card-highlight {
    background-color: var(--digni-500);
}

/* =========================================
   COMPONENTS - FORM ELEMENTS
   ========================================= */

.form-group {
    margin-bottom: var(--space-4);
}

.form-label {
    display: block;
    font-size: var(--font-size-sm);
    font-weight: 500;
    color: var(--color-text-secondary);
    margin-bottom: var(--space-1);
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: var(--space-3);
    font-size: var(--font-size-base);
    font-family: inherit;
    color: var(--color-text-primary);
    background-color: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    outline: none;
    transition: all var(--transition-fast);
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    border-color: var(--digni-500);
    box-shadow: 0 0 0 3px rgba(130, 170, 155, 0.2);
}

.form-input::placeholder {
    color: var(--color-text-muted);
}

.form-checkbox {
    width: 16px;
    height: 16px;
    accent-color: var(--digni-600);
    cursor: pointer;
}

/* =========================================
   COMPONENTS - BADGES
   ========================================= */

.badge {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
    padding: var(--space-1) var(--space-3);
    font-size: var(--font-size-xs);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-radius: var(--radius-full);
}

.badge-primary {
    background-color: var(--digni-50);
    color: var(--digni-700);
    border: 1px solid var(--digni-200);
}

.badge-success {
    background-color: var(--color-success-light);
    color: #065F46;
}

.badge-warning {
    background-color: var(--color-warning-light);
    color: #92400E;
}

/* =========================================
   COMPONENTS - ALERTS
   ========================================= */

.alert {
    display: flex;
    gap: var(--space-3);
    padding: var(--space-5);
    border-radius: var(--radius-xl);
    border: 1px solid;
}

.alert-warning {
    background-color: #FFF7ED;
    border-color: #FED7AA;
}

.alert-info {
    background-color: #EFF6FF;
    border-color: #BFDBFE;
}

.alert-success {
    background-color: #F0FDF4;
    border-color: #BBF7D0;
}

/* =========================================
   ANIMATIONS
   ========================================= */

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes zoomIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

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

.fade-in {
    animation: fadeIn 0.4s ease-out;
}

.slide-down {
    animation: slideDown 0.3s ease-out;
}

.zoom-in {
    animation: zoomIn 0.2s ease-out;
}

.animate-spin {
    animation: spin 1s linear infinite;
}

/* =========================================
   RESPONSIVE
   ========================================= */

@media (min-width: 640px) {
    .sm\:grid-cols-2 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .sm\:flex-row {
        flex-direction: row;
    }
}

@media (min-width: 768px) {
    .md\:grid-cols-2 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .md\:grid-cols-3 {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .md\:flex-row {
        flex-direction: row;
    }
}

@media (min-width: 1024px) {
    .lg\:grid-cols-3 {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

/* =========================================
   UTILITIES
   ========================================= */

.text-center {
    text-align: center;
}

.text-left {
    text-align: left;
}

.text-right {
    text-align: right;
}

.text-xs {
    font-size: var(--font-size-xs);
}

.text-sm {
    font-size: var(--font-size-sm);
}

.text-base {
    font-size: var(--font-size-base);
}

.text-lg {
    font-size: var(--font-size-lg);
}

.text-xl {
    font-size: var(--font-size-xl);
}

.text-2xl {
    font-size: var(--font-size-2xl);
}

.text-3xl {
    font-size: var(--font-size-3xl);
}

.font-medium {
    font-weight: 500;
}

.font-semibold {
    font-weight: 600;
}

.font-bold {
    font-weight: 700;
}

.text-digni-500 {
    color: var(--digni-500);
}

.text-digni-600 {
    color: var(--digni-600);
}

.text-digni-700 {
    color: var(--digni-700);
}

.text-digni-800 {
    color: var(--digni-800);
}

.text-digni-900 {
    color: var(--digni-900);
}

.text-gray-400 {
    color: #9CA3AF;
}

.text-gray-500 {
    color: #6B7280;
}

.text-gray-600 {
    color: #4B5563;
}

.text-gray-700 {
    color: #374151;
}

.bg-white {
    background-color: white;
}

.bg-digni-50 {
    background-color: var(--digni-50);
}

.bg-digni-100 {
    background-color: var(--digni-100);
}

.rounded-lg {
    border-radius: var(--radius-lg);
}

.rounded-xl {
    border-radius: var(--radius-xl);
}

.rounded-2xl {
    border-radius: var(--radius-2xl);
}

.rounded-full {
    border-radius: var(--radius-full);
}

.shadow-sm {
    box-shadow: var(--shadow-sm);
}

.shadow-md {
    box-shadow: var(--shadow-md);
}

.shadow-lg {
    box-shadow: var(--shadow-lg);
}

.transition-all {
    transition: all var(--transition-normal);
}

.transition-colors {
    transition: color var(--transition-fast), background-color var(--transition-fast), border-color var(--transition-fast);
}

.cursor-pointer {
    cursor: pointer;
}

.select-none {
    user-select: none;
}

.overflow-hidden {
    overflow: hidden;
}

.overflow-y-auto {
    overflow-y: auto;
}

.relative {
    position: relative;
}

.absolute {
    position: absolute;
}

.fixed {
    position: fixed;
}

.sticky {
    position: sticky;
}

.inset-0 {
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
}

.top-0 {
    top: 0;
}

.right-0 {
    right: 0;
}

.bottom-0 {
    bottom: 0;
}

.left-0 {
    left: 0;
}

.z-10 {
    z-index: 10;
}

.z-20 {
    z-index: 20;
}

.z-40 {
    z-index: 40;
}

.z-50 {
    z-index: 50;
}

.z-100 {
    z-index: 100;
}

.hidden {
    display: none;
}

@media (min-width: 640px) {
    .sm\:block {
        display: block;
    }

    .sm\:flex {
        display: flex;
    }

    .sm\:hidden {
        display: none;
    }
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}