/* HinayaLUXE Premium Design System — Dark Glassmorphism (single source of truth) */
:root {
    /* Brand */
    --primary: #00e5ff;
    --primary-hover: #33ebff;
    --primary-dark: #00b3cc;
    --primary-soft: rgba(0, 229, 255, 0.12);
    --primary-glow: rgba(0, 229, 255, 0.3);
    --secondary: #00ffff;

    /* Surfaces */
    --bg: #030712;
    --bg-elevated: #0b1220;
    --bg-secondary: rgba(17, 24, 39, 0.4);
    --bg-glass: rgba(17, 24, 39, 0.6);
    --bg-glass-light: rgba(255, 255, 255, 0.05);
    --bg-glass-strong: rgba(17, 24, 39, 0.85);

    /* Borders & text */
    --border: rgba(255, 255, 255, 0.1);
    --border-light: rgba(255, 255, 255, 0.15);
    --text: #ffffff;
    --text-muted: #9ca3af;
    --text-light: #6b7280;

    /* Semantic */
    --success: #10b981;
    --error: #ef4444;
    --warning: #f59e0b;
    --whatsapp: #25d366;
    --whatsapp-hover: #20ba5a;
    --star: #fbbf24;

    /* Radius */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --radius-pill: 999px;

    /* Shadows */
    --shadow-subtle: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-card: 0 10px 15px -3px rgba(0, 0, 0, 0.3), 0 4px 6px -2px rgba(0, 0, 0, 0.15);
    --shadow-hover: 0 20px 25px -5px rgba(0, 0, 0, 0.4), 0 10px 10px -5px rgba(0, 0, 0, 0.2);
    --shadow-glow: 0 0 15px var(--primary-glow);
    --shadow-glow-strong: 0 6px 24px rgba(0, 229, 255, 0.45);

    /* Typography & motion */
    --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-fast: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
    --ease-spring: cubic-bezier(0.175, 0.885, 0.32, 1.275);
    --duration-fast: 0.15s;
    --duration: 0.3s;
    --duration-slow: 0.55s;

    /* Layout */
    --container: 1400px;
    --header-h: 72px;
    --space-1: 8px;
    --space-2: 16px;
    --space-3: 24px;
    --space-4: 32px;
    --space-5: 48px;
    --space-6: 64px;

    /* Legacy aliases (pages still using old names — never redefine per-page) */
    --color-primary: var(--bg);
    --color-secondary: var(--primary);
    --color-accent: var(--primary-hover);
    --color-light: var(--bg-glass-light);
    --color-dark: var(--text);
    --color-gray: var(--text-muted);
    --color-card: var(--bg-glass);
    --color-border: var(--border);
    --color-success: var(--success);
    --color-error: var(--error);
    --color-warning: var(--warning);
    --color-info: var(--primary);
    --color-sidebar: var(--bg-glass-strong);
    --color-surface: var(--bg-glass);
    --color-bg: var(--bg);
    --color-text: var(--text);
    --color-muted: var(--text-muted);
    --font-body: var(--font);
    --font-family: var(--font);
    --shadow-sm: var(--shadow-subtle);
    --shadow-md: var(--shadow-card);
    --shadow-lg: var(--shadow-hover);
}

::selection {
    background: var(--primary);
    color: #ffffff;
}

::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: var(--bg);
}

::-webkit-scrollbar-thumb {
    background: var(--border-light);
    border-radius: var(--radius-pill);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
}

*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html {
    scroll-behavior: smooth;
}

html, body {
    width: 100%;
    overflow-x: hidden;
}

body {
    font-family: var(--font);
    font-weight: 400;
    font-size: 15px;
    line-height: 1.6;
    color: var(--text);
    background-color: var(--bg);
    background-image: 
        radial-gradient(circle at 15% 50%, rgba(0, 229, 255, 0.06), transparent 25%),
        radial-gradient(circle at 85% 30%, rgba(0, 255, 255, 0.04), transparent 25%);
    background-attachment: fixed;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    min-height: 100vh;
}

/* Noise texture overlay */
body::after {
    content: '';
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: url('data:image/svg+xml,%3Csvg viewBox="0 0 200 200" xmlns="http://www.w3.org/2000/svg"%3E%3Cfilter id="noiseFilter"%3E%3CfeTurbulence type="fractalNoise" baseFrequency="0.65" numOctaves="3" stitchTiles="stitch"/%3E%3C/filter%3E%3Crect width="100%25" height="100%25" filter="url(%23noiseFilter)"/%3E%3C/svg%3E');
    opacity: 0.02;
    pointer-events: none;
    z-index: -1;
}

/* Page transitions */
body.page-ready main, body.page-ready section, body.page-ready header {
    animation: pageFadeIn 0.8s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes pageFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

button, input, select, textarea {
    font-family: inherit;
    font-size: inherit;
}

button {
    cursor: pointer;
    border: none;
    background: none;
    transition: var(--transition);
}

input, select, textarea {
    font-size: 16px;
}

.container {
    max-width: var(--container);
    margin: 0 auto;
    padding: 0 var(--space-3);
}

.hidden { display: none !important; }

h1, h2, h3, h4 {
    font-weight: 600;
    letter-spacing: -0.02em;
    color: var(--text);
}

/* Glassmorphism Utilities */
.glass-panel {
    background: var(--bg-glass);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-card);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-1);
    padding: 12px 28px;
    border-radius: var(--radius-pill);
    font-weight: 500;
    font-size: 0.95rem;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(255,255,255,0.1);
    opacity: 0;
    transition: var(--transition);
    z-index: -1;
}

.btn:hover::before { opacity: 1; }
.btn:active { transform: scale(0.97); }

.btn-primary {
    background: var(--primary);
    color: var(--bg);
    box-shadow: 0 4px 14px rgba(0, 229, 255, 0.3);
}

.btn-primary:hover {
    background: var(--primary-hover);
    box-shadow: 0 6px 20px rgba(0, 229, 255, 0.5);
    transform: translateY(-2px);
}

.btn-outline {
    background: var(--bg-glass-light);
    color: var(--text);
    border: 1px solid var(--border);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.btn-outline:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: rgba(0, 229, 255, 0.05);
    transform: translateY(-2px);
}

.btn-secondary {
    background: var(--bg-glass);
    color: var(--text);
    border: 1px solid var(--border);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.btn-secondary:hover {
    background: var(--bg-secondary);
    transform: translateY(-2px);
}

.btn-ghost {
    background: transparent;
    color: var(--text);
    padding: 8px 16px;
}

.btn-ghost:hover {
    color: var(--primary);
    background: rgba(255,255,255,0.05);
}

.btn-whatsapp {
    background: var(--whatsapp);
    color: #fff;
    border: 1px solid transparent;
    box-shadow: 0 4px 14px rgba(37, 211, 102, 0.25);
}

.btn-whatsapp:hover {
    background: var(--whatsapp-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(37, 211, 102, 0.35);
}

.btn-danger {
    background: rgba(239, 68, 68, 0.12);
    color: var(--error);
    border: 1px solid rgba(239, 68, 68, 0.25);
}

.btn-danger:hover {
    background: rgba(239, 68, 68, 0.2);
    border-color: var(--error);
}

.btn-direct-contact {
    background: var(--bg-glass-light);
    color: var(--text);
    border: 1px solid var(--border);
}

.btn-direct-contact:hover {
    border-color: var(--primary);
    color: var(--primary);
    transform: translateY(-2px);
}

.btn-sm {
    padding: 8px 16px;
    font-size: 0.85rem;
}

.w-full { width: 100%; }

/* Shared page chrome */
.page-title {
    font-size: clamp(1.35rem, 3vw, 1.75rem);
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 6px;
    color: var(--text);
}

.page-subtitle {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: var(--space-3);
    line-height: 1.6;
}

.section-heading {
    font-size: 1.05rem;
    font-weight: 600;
    margin-bottom: 10px;
    color: var(--text);
    letter-spacing: -0.01em;
}

.text-muted {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.card {
    background: var(--bg-glass);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: var(--space-2);
    box-shadow: var(--shadow-card);
}

/* Forms */
.form-group,
.form-row {
    margin-bottom: var(--space-2);
}

.form-label {
    display: block;
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.form-input,
.form-textarea,
.form-select,
select.form-input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--bg-secondary);
    color: var(--text);
    font-family: inherit;
    font-size: 0.95rem;
    transition: var(--transition-fast);
}

.form-input:hover,
.form-textarea:hover,
.form-select:hover {
    border-color: var(--border-light);
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
    outline: none;
    border-color: var(--primary) !important;
    box-shadow: 0 0 0 3px var(--primary-soft), 0 0 12px var(--primary-glow) !important;
    background: var(--bg-elevated);
}

.form-textarea {
    min-height: 88px;
    resize: vertical;
}

.input-hint {
    font-size: 0.75rem;
    color: var(--text-light);
    margin-top: 4px;
}

select,
select option {
    background: var(--bg-elevated);
    color: var(--text);
}

/* Toast (legacy .toast + design-system .toast-notification) */
.toast {
    position: fixed;
    bottom: calc(80px + env(safe-area-inset-bottom, 0px));
    left: 50%;
    transform: translateX(-50%);
    background: var(--bg-glass);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 12px 20px;
    border-radius: var(--radius-pill);
    font-size: 0.9rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: var(--shadow-card);
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--duration) var(--ease-out), transform var(--duration) var(--ease-spring);
    z-index: 10000;
}

.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(-4px);
}

.toast-success,
.toast.success {
    border-color: rgba(16, 185, 129, 0.4);
    box-shadow: 0 4px 14px rgba(16, 185, 129, 0.2);
}

.toast-error,
.toast.error {
    border-color: rgba(239, 68, 68, 0.4);
    box-shadow: 0 4px 14px rgba(239, 68, 68, 0.2);
}

/* Fade-up animation */
.fade-up {
    opacity: 0;
    transform: translateY(24px);
    transition:
        opacity var(--duration-slow, 0.55s) var(--ease-out, cubic-bezier(0.22, 1, 0.36, 1)),
        transform var(--duration-slow, 0.55s) var(--ease-out, cubic-bezier(0.22, 1, 0.36, 1));
    will-change: opacity, transform;
}

.fade-up.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.stagger-1 { transition-delay: 0.1s; }
.stagger-2 { transition-delay: 0.2s; }
.stagger-3 { transition-delay: 0.3s; }
.stagger-4 { transition-delay: 0.4s; }

/* Toast */
.toast-notification {
    position: fixed;
    bottom: calc(80px + env(safe-area-inset-bottom, 0px));
    left: 50%;
    transform: translateX(-50%);
    background: var(--bg-glass);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border);
    color: var(--text) !important;
    padding: 14px 24px;
    border-radius: var(--radius-pill);
    font-size: 0.9rem;
    font-weight: 500;
    z-index: 10000;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: var(--shadow-hover);
    animation: toastIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.toast-notification i {
    font-size: 1.1rem;
}

.toast-notification[style*="var(--color-success)"] {
    border-color: rgba(16, 185, 129, 0.3);
    box-shadow: 0 4px 14px rgba(16, 185, 129, 0.2);
}

.toast-notification[style*="var(--color-error)"] {
    border-color: rgba(239, 68, 68, 0.3);
    box-shadow: 0 4px 14px rgba(239, 68, 68, 0.2);
}

@keyframes toastIn {
    from { opacity: 0; transform: translateX(-50%) translateY(20px) scale(0.9); }
    to { opacity: 1; transform: translateX(-50%) translateY(0) scale(1); }
}

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

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--primary) !important;
    box-shadow: 0 0 10px rgba(0, 229, 255, 0.25) !important;
}

/* Standardized Headers (Navbar) */
.store-header, .mobile-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: var(--bg-glass);
    backdrop-filter: blur(20px) saturate(1.2);
    -webkit-backdrop-filter: blur(20px) saturate(1.2);
    border-bottom: 1px solid var(--border);
    box-shadow: 0 1px 0 rgba(0, 229, 255, 0.04), var(--shadow-subtle);
    transition: background var(--duration) var(--ease-out), border-color var(--duration) var(--ease-out), box-shadow var(--duration) var(--ease-out);
}

.store-header {
    min-height: var(--header-h);
    display: flex;
    align-items: center;
}

.store-header:hover,
.mobile-header:hover {
    border-bottom-color: rgba(0, 229, 255, 0.18);
}

.mobile-header {
    padding: 14px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    min-height: var(--header-h);
    box-sizing: border-box;
}

.mobile-logo, .store-logo {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: 1.1rem;
    font-weight: 650;
    color: var(--text);
    text-decoration: none;
    transition: var(--transition-fast);
}

.mobile-logo:hover, .store-logo:hover {
    color: var(--primary);
}

.mobile-logo img, .store-logo img {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    object-fit: cover;
    box-shadow: 0 0 0 1px var(--border);
    transition: var(--transition-fast);
}

.mobile-logo:hover img, .store-logo:hover img {
    box-shadow: 0 0 0 1px var(--primary), var(--shadow-glow);
}

.mobile-logo i, .store-logo i {
    color: var(--primary);
    font-size: 1.2rem;
    transition: transform var(--duration-fast) var(--ease-spring);
}

.mobile-logo:hover i, .store-logo:hover i {
    transform: translateX(-2px);
}

.mobile-header-actions, .store-header__actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.header-icon-btn, .icon-btn {
    position: relative;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text);
    background: var(--bg-glass-light);
    border: 1px solid var(--border);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    font-size: 1.05rem;
    transition: var(--transition);
}

.header-icon-btn:hover, .icon-btn:hover {
    background: var(--primary-soft);
    border-color: var(--primary);
    color: var(--primary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-glow);
}

.header-icon-btn:active, .icon-btn:active {
    transform: scale(0.95);
}

/* Placeholder tone — layout-specific inputs keep their own padding/width */
input::placeholder,
textarea::placeholder,
select::placeholder {
    color: var(--text-light);
}

/* Premium loading overlay */
#loadingOverlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--space-3);
    background:
        radial-gradient(ellipse at 50% 35%, rgba(0, 229, 255, 0.12), transparent 50%),
        radial-gradient(ellipse at 80% 80%, rgba(0, 255, 255, 0.05), transparent 40%),
        linear-gradient(180deg, var(--bg-elevated) 0%, var(--bg) 100%);
    backdrop-filter: blur(24px) saturate(1.15);
    -webkit-backdrop-filter: blur(24px) saturate(1.15);
    transition:
        opacity var(--duration-slow) var(--ease-out),
        visibility var(--duration-slow) var(--ease-out),
        transform var(--duration-slow) var(--ease-out);
}

#loadingOverlay.is-hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: scale(1.02);
}

.loading-brand {
    position: relative;
    width: 112px;
    height: 112px;
    display: grid;
    place-items: center;
    margin-bottom: var(--space-1);
}

.loading-brand::before {
    content: '';
    position: absolute;
    inset: -12px;
    border-radius: 50%;
    background: radial-gradient(circle, var(--primary-soft), transparent 70%);
    animation: loadingAura 2.4s ease-in-out infinite;
}

.loading-brand__ring {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 2px solid transparent;
    border-top-color: var(--primary);
    border-right-color: rgba(0, 229, 255, 0.35);
    animation: spin 1.1s linear infinite;
    box-shadow: var(--shadow-glow);
}

.loading-brand__ring--secondary {
    inset: 10px;
    border-top-color: var(--secondary);
    border-right-color: transparent;
    animation: spinReverse 1.6s linear infinite;
    box-shadow: none;
    opacity: 0.7;
}

.loading-brand__logo {
    width: 52px;
    height: 52px;
    border-radius: var(--radius-md);
    object-fit: cover;
    border: 1px solid var(--border-light);
    background: var(--bg-glass);
    box-shadow: var(--shadow-glow);
    animation: pulseLogo 2.2s ease-in-out infinite;
    position: relative;
    z-index: 1;
}

.loading-spinner {
    position: relative;
    width: 80px;
    height: 80px;
    border: 3px solid rgba(0, 229, 255, 0.08);
    border-top-color: var(--primary);
    border-right-color: var(--secondary);
    border-radius: 50%;
    animation: spin 1s cubic-bezier(0.55, 0.055, 0.675, 0.19) infinite;
    box-shadow: 0 0 30px rgba(0, 229, 255, 0.15);
}

.loading-spinner::before {
    content: '';
    position: absolute;
    inset: 14px;
    background: url('/icon.png') no-repeat center;
    background-size: contain;
    border-radius: 8px;
    opacity: 0.9;
    animation: pulseLogo 2s ease-in-out infinite;
}

.loading-spinner::after {
    content: '';
    position: absolute;
    inset: 6px;
    border: 2px solid rgba(255, 255, 255, 0.04);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spinReverse 1.5s linear infinite;
}

.loading-text {
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--text-muted);
    animation: loadingPulse 1.8s ease-in-out infinite;
}

.loading-progress {
    width: min(240px, 58vw);
    height: 3px;
    border-radius: var(--radius-pill);
    background: rgba(255, 255, 255, 0.06);
    overflow: hidden;
    margin-top: var(--space-1);
    border: 1px solid rgba(255, 255, 255, 0.04);
}

.loading-progress__bar {
    height: 100%;
    width: 42%;
    border-radius: inherit;
    background: linear-gradient(90deg, transparent, var(--primary), var(--secondary), transparent);
    animation: loadingBar 1.35s var(--ease-out) infinite;
    box-shadow: 0 0 14px rgba(0, 229, 255, 0.55);
}

@keyframes spinReverse {
    from { transform: rotate(0deg); }
    to { transform: rotate(-360deg); }
}

@keyframes pulseLogo {
    0%, 100% { transform: scale(0.94); opacity: 0.78; }
    50% { transform: scale(1.05); opacity: 1; }
}

@keyframes loadingPulse {
    0%, 100% { opacity: 0.4; }
    50% { opacity: 1; }
}

@keyframes loadingBar {
    0% { transform: translateX(-130%); }
    100% { transform: translateX(280%); }
}

@keyframes loadingAura {
    0%, 100% { opacity: 0.35; transform: scale(0.92); }
    50% { opacity: 0.9; transform: scale(1.08); }
}

/* Skeleton placeholders */
.skeleton {
    background: linear-gradient(
        90deg,
        var(--bg-glass-light) 0%,
        rgba(255, 255, 255, 0.1) 50%,
        var(--bg-glass-light) 100%
    );
    background-size: 200% 100%;
    animation: skeletonShimmer 1.4s ease-in-out infinite;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
}

@keyframes skeletonShimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}
