/* ============================================================
   HinayaLUXE — Maison Design System
   Black / White · Editorial · Slim Serif Italics · Sharp Edges
   Single source of truth for every page.
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,300;0,400;0,500;0,600;1,300;1,400;1,500;1,600&family=Jost:ital,wght@0,200;0,300;0,400;0,500;1,300;1,400&family=Pinyon+Script&display=swap');
@import url('motion.css');
@import url('cards-variants.css');

:root {
    /* Brand — pure monochrome */
    --primary: #f4f4f4;
    --primary-hover: #ffffff;
    --primary-dark: #cfcfcf;
    --primary-soft: rgba(255, 255, 255, 0.07);
    --primary-glow: rgba(255, 255, 255, 0.14);
    --secondary: #bdbdbd;

    /* Surfaces */
    --bg: #0a0a0a;
    --bg-elevated: #131313;
    --bg-secondary: rgba(255, 255, 255, 0.04);
    --bg-glass: rgba(10, 10, 10, 0.78);
    --bg-glass-light: rgba(255, 255, 255, 0.05);
    --bg-glass-strong: rgba(10, 10, 10, 0.94);

    /* Borders & text */
    --border: rgba(255, 255, 255, 0.13);
    --border-light: rgba(255, 255, 255, 0.26);
    --text: #f4f4f4;

    /* Glass / translucency */
    --glass: rgba(255, 255, 255, 0.03);
    --glass-hover: rgba(255, 255, 255, 0.08);
    --glass-active: rgba(255, 255, 255, 0.12);
    --glass-shadow: 0 4px 24px rgba(0,0,0,0.4);
    --glass-transition: var(--ease-expo) 0.3s;
    --text-muted: #9c9c9c;
    --text-light: #6f6f6f;

    /* Semantic */
    --success: #9fd8b4;
    --error: #e08a8a;
    --warning: #d9c49a;
    --whatsapp: #25d366;
    --whatsapp-hover: #20ba5a;
    --star: #f4f4f4;

    /* Radius — sharp, editorial */
    --radius-sm: 2px;
    --radius-md: 2px;
    --radius-lg: 3px;
    --radius-xl: 3px;
    --radius-pill: 2px;

    /* Shadows — whisper quiet */
    --shadow-subtle: 0 1px 2px rgba(0, 0, 0, 0.4);
    --shadow-card: 0 8px 30px rgba(0, 0, 0, 0.35);
    --shadow-hover: 0 18px 50px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 0 1px rgba(255, 255, 255, 0.25);
    --shadow-glow-strong: 0 0 0 1px rgba(255, 255, 255, 0.45);

    /* Typography */
    --font: 'Jost', 'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-display: 'Cormorant Garamond', Georgia, 'Times New Roman', serif;
    --font-script: 'Pinyon Script', 'Snell Roundhand', cursive;
    --transition: all 0.35s cubic-bezier(0.22, 1, 0.36, 1);
    --transition-fast: all 0.18s cubic-bezier(0.22, 1, 0.36, 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.18s;
    --duration: 0.35s;
    --duration-slow: 0.65s;

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

    /* Legacy aliases — names preserved so every page re-themes at once */
    --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: #f4f4f4;
    color: #0a0a0a;
}

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

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

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.18);
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.38);
}

*, *::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: 300;
    font-size: 15px;
    line-height: 1.65;
    letter-spacing: 0.01em;
    color: var(--text);
    background-color: var(--bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    min-height: 100vh;
}

/* Faint film grain — texture without colour */
body::after {
    content: '';
    position: fixed;
    inset: 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 entrance */
body.page-ready main,
body.page-ready section,
body.page-ready header {
    animation: pageFadeIn 0.9s var(--ease-out) 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; }

/* Headings — slim serif italics, never bold */
h1, h2, h3, h4 {
    font-family: var(--font-display);
    font-weight: 400;
    letter-spacing: 0.01em;
    color: var(--text);
}

h1 em, h2 em, h3 em,
.hero__title em, .section-title em {
    font-style: italic;
    font-weight: 400;
}

/* Glass panel utility */
.glass-panel {
    background: var(--bg-glass);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 1px solid var(--border);
}

/* ============ Buttons — quiet, letterspaced, squared ============ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 14px 34px;
    border-radius: var(--radius-pill);
    font-family: var(--font);
    font-weight: 400;
    font-size: 0.78rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    transition: var(--transition);
    position: relative;
    z-index: 1;
}

.btn:active { transform: scale(0.98); }

.btn-primary {
    background: var(--text);
    color: var(--bg);
    border: 1px solid var(--text);
}

.btn-primary:hover {
    background: transparent;
    color: var(--text);
    box-shadow: var(--shadow-glow-strong);
}

.btn-outline {
    background: transparent;
    color: var(--text);
    border: 1px solid var(--border-light);
}

.btn-outline:hover {
    border-color: var(--text);
    background: var(--primary-soft);
}

.btn-secondary {
    background: var(--bg-secondary);
    color: var(--text);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    border-color: var(--border-light);
    background: var(--primary-soft);
}

.btn-ghost {
    background: transparent;
    color: var(--text-muted);
    padding: 8px 16px;
    letter-spacing: 0.12em;
}

.btn-ghost:hover {
    color: var(--text);
}

.btn-whatsapp {
    background: transparent;
    color: var(--whatsapp);
    border: 1px solid rgba(37, 211, 102, 0.4);
}

.btn-whatsapp:hover {
    background: rgba(37, 211, 102, 0.1);
    border-color: var(--whatsapp);
}

.btn-danger {
    background: transparent;
    color: var(--error);
    border: 1px solid rgba(224, 138, 138, 0.35);
}

.btn-danger:hover {
    background: rgba(224, 138, 138, 0.08);
    border-color: var(--error);
}

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

.btn-direct-contact:hover {
    border-color: var(--text);
    background: var(--primary-soft);
}

.btn-sm {
    padding: 9px 18px;
    font-size: 0.68rem;
}

.w-full { width: 100%; }

/* Understated editorial link */
.link-underline {
    display: inline-block;
    font-size: 0.78rem;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--text);
    padding-bottom: 6px;
    position: relative;
}

.link-underline::after {
    content: '';
    position: absolute;
    left: 50%;
    bottom: 0;
    width: 0;
    height: 1px;
    background: var(--text);
    transition: width var(--duration) var(--ease-out), left var(--duration) var(--ease-out);
}

.link-underline:hover::after {
    left: 0;
    width: 100%;
}

/* ============ Shared page chrome ============ */
.page-title {
    font-family: var(--font-display);
    font-size: clamp(1.7rem, 3.4vw, 2.3rem);
    font-weight: 400;
    font-style: italic;
    letter-spacing: 0.01em;
    margin-bottom: 6px;
    color: var(--text);
}

.page-subtitle {
    font-size: 0.86rem;
    font-weight: 300;
    color: var(--text-muted);
    margin-bottom: var(--space-3);
    letter-spacing: 0.05em;
}

.section-heading {
    font-family: var(--font-display);
    font-size: 1.35rem;
    font-weight: 400;
    font-style: italic;
    margin-bottom: 12px;
    color: var(--text);
}

.text-muted {
    color: var(--text-muted);
    font-size: 0.88rem;
    font-weight: 300;
}

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

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

.form-label {
    display: block;
    font-size: 0.7rem;
    font-weight: 400;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.form-input,
.form-textarea,
.form-select,
select.form-input {
    width: 100%;
    padding: 13px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-secondary);
    color: var(--text);
    font-family: inherit;
    font-weight: 300;
    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(--border-light) !important;
    box-shadow: none !important;
    background: var(--bg-elevated);
}

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

.input-hint {
    font-size: 0.72rem;
    color: var(--text-light);
    margin-top: 4px;
    letter-spacing: 0.04em;
}

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

/* ============ Toasts ============ */
.toast {
    position: fixed;
    bottom: calc(84px + env(safe-area-inset-bottom, 0px));
    left: 50%;
    transform: translateX(-50%);
    background: var(--bg-glass-strong);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 13px 26px;
    border-radius: var(--radius-pill);
    font-size: 0.82rem;
    font-weight: 300;
    letter-spacing: 0.06em;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: var(--shadow-card);
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--duration) var(--ease-out), transform var(--duration) var(--ease-out);
    z-index: 10000;
}

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

.toast-success,
.toast.success {
    border-color: rgba(159, 216, 180, 0.4);
}

.toast-error,
.toast.error {
    border-color: rgba(224, 138, 138, 0.4);
}

.toast-notification {
    position: fixed;
    bottom: calc(84px + env(safe-area-inset-bottom, 0px));
    left: 50%;
    transform: translateX(-50%);
    background: var(--bg-glass-strong);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 1px solid var(--border);
    color: var(--text) !important;
    padding: 14px 26px;
    border-radius: var(--radius-pill);
    font-size: 0.82rem;
    font-weight: 300;
    letter-spacing: 0.06em;
    z-index: 10000;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: var(--shadow-hover);
    animation: toastIn 0.45s var(--ease-out);
}

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

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

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

/* Global input focus — quiet */
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--border-light) !important;
    box-shadow: none !important;
}

/* ============ Headers ============ */
.store-header, .mobile-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: linear-gradient(180deg, rgba(10,10,10,0.92), rgba(10,10,10,0.82));
    backdrop-filter: blur(18px) saturate(1.1);
    -webkit-backdrop-filter: blur(18px) saturate(1.1);
    border-bottom: 1px solid var(--border);
    transition: background var(--duration) var(--ease-out), border-color var(--duration) var(--ease-out);
}

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

.mobile-header {
    padding: 12px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    min-height: var(--header-h);
}

.mobile-logo, .store-logo {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    color: var(--text);
    text-decoration: none;
    transition: var(--transition-fast);
}

.mobile-logo span, .store-logo span {
    font-family: var(--font-display);
    font-style: italic;
    font-weight: 500;
    font-size: 1.35rem;
    letter-spacing: 0.04em;
}

.mobile-logo:hover, .store-logo:hover {
    opacity: 0.75;
}

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

.mobile-logo i, .store-logo i {
    color: var(--text);
    font-size: 1rem;
}

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

.header-icon-btn, .icon-btn {
    position: relative;
    width: 40px;
    height: 40px;
    border-radius: var(--radius-pill);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text);
    background: transparent;
    border: none;
    font-size: 1rem;
    font-weight: 300;
    transition: var(--transition-fast);
}

.header-icon-btn:hover, .icon-btn:hover {
    color: var(--text);
    background: var(--primary-soft);
    transform: none;
    box-shadow: none;
}

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

/* Placeholder tone */
input::placeholder,
textarea::placeholder,
select::placeholder {
    color: var(--text-light);
    font-weight: 300;
    letter-spacing: 0.04em;
}

/* ============ Loading / Intro overlay — maison curtain ============ */
#loadingOverlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: var(--bg);
    transition:
        opacity 0.9s var(--ease-out),
        visibility 0.9s var(--ease-out),
        transform 0.9s var(--ease-out);
}

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

/* Legacy spinner markup — silenced gracefully */
.loading-brand,
.loading-spinner {
    display: none !important;
}

.intro {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.intro__mosaic {
    position: absolute;
    inset: -6%;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-auto-rows: 1fr;
    gap: 4px;
    opacity: 0;
    transition: opacity 1.4s var(--ease-out);
}

.intro__mosaic.is-live { opacity: 0.34; }

.intro__mosaic figure {
    overflow: hidden;
    margin: 0;
    background: #101010;
}

.intro__mosaic img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: grayscale(28%) brightness(0.72);
    transform: scale(1.06);
    animation: introDrift 14s ease-in-out infinite alternate;
}

.intro__mosaic figure:nth-child(even) img { animation-delay: -6s; }

.intro__veil {
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at center, rgba(10,10,10,0.42) 0%, rgba(10,10,10,0.88) 78%);
}

.intro__brand {
    position: relative;
    z-index: 2;
    text-align: center;
    animation: introRise 1.3s var(--ease-out) both;
}

.intro__script {
    display: block;
    font-family: var(--font-script);
    font-size: clamp(3.4rem, 10vw, 6rem);
    line-height: 1;
    color: var(--text);
    text-shadow: 0 2px 30px rgba(0,0,0,0.6);
}

.intro__sub {
    display: block;
    margin-top: 14px;
    font-family: var(--font);
    font-weight: 300;
    font-size: 0.66rem;
    letter-spacing: 0.55em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.intro__line {
    position: relative;
    z-index: 2;
    width: min(220px, 52vw);
    height: 1px;
    margin: 34px 0 22px;
    background: rgba(255, 255, 255, 0.12);
    overflow: hidden;
}

.intro__line i {
    display: block;
    height: 100%;
    width: 40%;
    background: var(--text);
    animation: introBar 1.5s var(--ease-out) infinite;
}

.loading-text {
    position: relative;
    z-index: 2;
    font-family: var(--font-display);
    font-style: italic;
    font-size: 0.95rem;
    font-weight: 400;
    letter-spacing: 0.14em;
    color: var(--text-muted);
    animation: loadingPulse 2s ease-in-out infinite;
}

.loading-progress {
    width: min(220px, 52vw);
    height: 1px;
    background: rgba(255, 255, 255, 0.12);
    overflow: hidden;
    margin-top: var(--space-2);
}

.loading-progress__bar {
    height: 100%;
    width: 40%;
    background: var(--text);
    animation: loadingBar 1.4s var(--ease-out) infinite;
}

@keyframes introDrift {
    from { transform: scale(1.06) translateY(0); }
    to { transform: scale(1.14) translateY(-2.5%); }
}

@keyframes introRise {
    from { opacity: 0; transform: translateY(22px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes introBar {
    0% { transform: translateX(-120%); }
    100% { transform: translateX(320%); }
}

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

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

@keyframes pulseLogo {
    0%, 100% { transform: scale(0.97); opacity: 0.8; }
    50% { transform: scale(1.03); 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); }
}

/* Skeletons */
.skeleton {
    background: linear-gradient(
        90deg,
        rgba(255, 255, 255, 0.03) 0%,
        rgba(255, 255, 255, 0.09) 50%,
        rgba(255, 255, 255, 0.03) 100%
    );
    background-size: 200% 100%;
    animation: skeletonShimmer 1.5s ease-in-out infinite;
    border-radius: var(--radius-sm);
    border: none;
}

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

/* ============ Scroll reveal ============ */
.fade-up {
    opacity: 0;
    transform: translateY(26px);
    transition:
        opacity 0.9s var(--ease-out),
        transform 0.9s var(--ease-out);
    will-change: opacity, transform;
}

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

.stagger-1 { transition-delay: 0.08s; }
.stagger-2 { transition-delay: 0.16s; }
.stagger-3 { transition-delay: 0.24s; }
.stagger-4 { transition-delay: 0.32s; }

/* ============================================================
   GLASS / TRANSLUCEN PANELS — backdrop-filter based
   Used for modals, sidebar, checkout panels, dashboard cards
   ============================================================ */
.glass-panel {
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    background: var(--glass-glass, rgba(255, 255, 255, 0.03));
    border: 1px solid var(--border, rgba(255, 255, 255, 0.13));
    border-radius: 0;
}

.glass-panel--elevated {
    box-shadow: var(--glass-shadow);
}

.glass-panel--thin {
    backdrop-filter: blur(8px);
}

.glass-panel:hover {
    --glass-glass: rgba(255, 255, 255, 0.06);
}

.glass-panel:active {
    --glass-glass: rgba(255, 255, 255, 0.09);
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.001s !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001s !important;
        scroll-behavior: auto !important;
    }

    .glass-panel {
        backdrop-filter: none !important;
        background: var(--glass-glass, rgba(255, 255, 255, 0.03)) !important;
    }
}
