/**
 * Hijafera Luxury Commerce Suite - Modern Micro-Interactions System
 * Enhanced Tactile Press, Elastic Bounce, Fluid Hover, and Smooth Transitions
 */

/* ==========================================================================
   1. UNIVERSAL BUTTON TACTILE MICRO-INTERACTIONS (SHRINK ON CLICK)
   ========================================================================== */

/* Buttons, links styled as buttons, submit buttons, and Alpine interactive controls */
button:not(:disabled),
.btn,
.btn-primary,
.btn-secondary,
.btn-outline,
[role="button"],
input[type="submit"]:not(:disabled),
input[type="button"]:not(:disabled),
a[class*="bg-"]:not([class*="bg-transparent"]),
a[class*="hover:bg-"],
.interactive-btn {
    transition: transform 0.14s cubic-bezier(0.2, 0, 0, 1),
                box-shadow 0.18s ease,
                background-color 0.2s ease,
                border-color 0.2s ease,
                color 0.2s ease,
                filter 0.14s ease !important;
    will-change: transform;
    user-select: none;
    -webkit-user-select: none;
    -webkit-tap-highlight-color: transparent;
}

/* Hover: Subtle Elegant Lift */
button:not(:disabled):hover,
.btn:hover,
[role="button"]:hover,
input[type="submit"]:not(:disabled):hover {
    transform: translateY(-1.5px);
}

/* Active / Click: Tactile Shrink Effect */
button:not(:disabled):active,
.btn:active,
.btn-primary:active,
.btn-secondary:active,
.btn-outline:active,
[role="button"]:active,
input[type="submit"]:not(:disabled):active,
input[type="button"]:not(:disabled):active,
a[class*="bg-"]:not([class*="bg-transparent"]):active,
a[class*="hover:bg-"]:active,
.interactive-btn:active,
.btn-pressed {
    transform: scale(0.95) translateY(0) !important;
    filter: brightness(0.95);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1) !important;
}

/* Small interactive buttons & icon buttons (Wishlist, Cart Trigger, Search, Modals, Quantity +/-) */
.btn-icon,
.wishlist-btn,
.qty-btn,
button.rounded-full,
button[aria-label="Buka Menu"],
button[title*="Wishlist"],
button[title*="shopping"],
button[title*="Search"],
button:has(i.fa-heart),
button:has(i.fa-plus),
button:has(i.fa-minus),
button:has(i.fa-trash-can),
button:has(i.fa-xmark),
button:has(i.fa-bars) {
    transition: transform 0.14s cubic-bezier(0.34, 1.56, 0.64, 1),
                color 0.15s ease,
                background-color 0.15s ease,
                box-shadow 0.15s ease !important;
}

.btn-icon:hover,
.wishlist-btn:hover,
button:has(i.fa-heart):hover {
    transform: scale(1.1) !important;
}

.btn-icon:active,
.wishlist-btn:active,
.qty-btn:active,
button.rounded-full:active,
button:has(i.fa-heart):active,
button:has(i.fa-plus):active,
button:has(i.fa-minus):active,
button:has(i.fa-trash-can):active,
button:has(i.fa-xmark):active,
button:has(i.fa-bars):active {
    transform: scale(0.86) !important;
    filter: brightness(0.92);
}

/* Variant & Size Chips / Swatches */
.chip-item,
button[type="button"].min-w-\[44px\],
button[type="button"][class*="rounded-md"]:not([class*="w-full"]):not([class*="flex-1"]),
.color-swatch {
    transition: transform 0.14s cubic-bezier(0.2, 0, 0, 1),
                border-color 0.18s ease,
                background-color 0.18s ease,
                box-shadow 0.18s ease !important;
    cursor: pointer;
}

.chip-item:hover,
button[type="button"].min-w-\[44px\]:hover,
.color-swatch:hover {
    transform: translateY(-1.5px) scale(1.02);
}

.chip-item:active,
button[type="button"].min-w-\[44px\]:active,
.color-swatch:active {
    transform: scale(0.90) !important;
}

/* ==========================================================================
   2. FADE, SLIDE & ENTRANCE ANIMATIONS
   ========================================================================== */

@keyframes hfFadeIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        /* "none" (not translateY(0)): a leftover transform on <main> turns it into the
           containing block for position:fixed children, so mobile sticky bars stopped sticking. */
        transform: none;
    }
}

@keyframes hfFadeInScale {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

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

@keyframes hfSlideInRight {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes hfHeartPop {
    0% {
        transform: scale(1);
    }
    40% {
        transform: scale(1.38);
        color: #e11d48;
    }
    70% {
        transform: scale(0.88);
    }
    100% {
        transform: scale(1);
    }
}

@keyframes hfBadgeBounce {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.22);
    }
}

/* Smooth page load animation on main content */
main {
    animation: hfFadeIn 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Micro-interaction classes */
.hf-fade-in {
    animation: hfFadeIn 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.hf-fade-in-scale {
    animation: hfFadeInScale 0.25s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.hf-slide-down {
    animation: hfSlideInDown 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.animate-heart-pop {
    animation: hfHeartPop 0.45s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards !important;
}

.animate-badge-bounce {
    animation: hfBadgeBounce 0.35s ease-out forwards;
}

/* Modals & Dialogs Animation Enhancement */
[x-show].fixed:not([x-cloak]) > div:not(.absolute) {
    animation: hfFadeInScale 0.22s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Flash alerts slide down */
.bg-emerald-50, .bg-rose-50, .bg-amber-50, .bg-purple-50 {
    animation: hfSlideInDown 0.32s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* ==========================================================================
   3. PRODUCT CARDS & COLLECTION TILES MICRO-INTERACTIONS
   ========================================================================== */

/* Product card container hover lift */
.group.flex.flex-col,
.product-card,
.category-card {
    transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1),
                box-shadow 0.28s cubic-bezier(0.16, 1, 0.3, 1) !important;
    will-change: transform, box-shadow;
}

.group.flex.flex-col:hover,
.product-card:hover {
    transform: translateY(-5px);
}

.group.flex.flex-col:active,
.product-card:active {
    transform: scale(0.99) translateY(-2px);
}

/* Product Card Image Smooth Zoom */
.group img {
    transition: transform 0.65s cubic-bezier(0.16, 1, 0.3, 1),
                opacity 0.4s ease !important;
}

/* ==========================================================================
   4. FORM CONTROLS & INPUT MICRO-INTERACTIONS
   ========================================================================== */

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="tel"],
input[type="search"],
select,
textarea {
    transition: border-color 0.2s cubic-bezier(0.16, 1, 0.3, 1),
                box-shadow 0.2s cubic-bezier(0.16, 1, 0.3, 1),
                background-color 0.2s ease,
                transform 0.15s ease !important;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
input[type="number"]:focus,
input[type="tel"]:focus,
input[type="search"]:focus,
select:focus,
textarea:focus {
    border-color: #54239b !important;
    box-shadow: 0 0 0 3px rgba(84, 35, 155, 0.18), 0 2px 4px rgba(0, 0, 0, 0.04) !important;
    outline: none !important;
    transform: translateY(-1px);
}

/* Interactive Checkboxes & Radio Pills */
input[type="checkbox"],
input[type="radio"] {
    transition: transform 0.14s ease, border-color 0.18s ease, background-color 0.18s ease;
    cursor: pointer;
}

input[type="checkbox"]:active,
input[type="radio"]:active {
    transform: scale(0.85);
}

/* ==========================================================================
   5. NAVIGATION & TAB MICRO-INTERACTIONS
   ========================================================================== */

nav a {
    position: relative;
    transition: color 0.2s ease, transform 0.15s ease;
}

/* Subtle link press */
nav a:active {
    transform: scale(0.96);
}

/* ==========================================================================
   6. RIPPLE & CLICK WAVE EFFECT
   ========================================================================== */

/* No `position` here: micro-interactions.js already makes a static button relative.
   Forcing relative broke absolutely positioned buttons after a click
   (hero slider arrows, wishlist hearts on product cards jumped out of place). */
.hf-ripple-container {
    overflow: hidden !important;
}

/* The compiled Vite CSS (public/build) still contains the old
   `.hf-ripple-container { position: relative }` rule; restore the Tailwind position. */
.absolute.hf-ripple-container { position: absolute; }
.fixed.hf-ripple-container { position: fixed; }
.sticky.hf-ripple-container { position: sticky; }

.hf-ripple-wave {
    position: absolute;
    border-radius: 50%;
    transform: scale(0);
    animation: hfRippleAnimation 0.5s cubic-bezier(0.1, 0.8, 0.3, 1) forwards;
    background-color: rgba(255, 255, 255, 0.32);
    pointer-events: none;
    z-index: 10;
}

.hf-ripple-wave-dark {
    background-color: rgba(84, 35, 155, 0.15) !important;
}

@keyframes hfRippleAnimation {
    0% {
        transform: scale(0);
        opacity: 0.6;
    }
    100% {
        transform: scale(3.5);
        opacity: 0;
    }
}

/* ==========================================================================
   7. ACCESSIBILITY: REDUCED MOTION PREFERENCE
   ========================================================================== */

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

/* ==========================================================================
   Conversion UI helpers (2026-11-19) — plain CSS so they work without a Vite rebuild
   ========================================================================== */

/* Alpine: keep x-cloak elements hidden until Alpine initialises */
[x-cloak] {
    display: none !important;
}

/* Soft upward shadow for mobile sticky buy / pay bars */
.hf-sticky-shadow {
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.08);
}

/* Checkout: leave room for the mobile sticky pay bar */
.hf-checkout-wrap {
    padding-bottom: 7rem;
}
@media (min-width: 1024px) {
    .hf-checkout-wrap {
        padding-bottom: 2.5rem;
    }
}

/* Floating WhatsApp button */
.hf-wa-float {
    position: fixed;
    right: 1rem;
    bottom: 1.25rem;
    z-index: 40;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem;
    border-radius: 9999px;
    background-color: #25D366;
    color: #fff;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.25), 0 4px 10px -4px rgba(0, 0, 0, 0.15);
    animation: hfFadeInScale 0.3s cubic-bezier(0.16, 1, 0.3, 1) 0.6s both;
}
.hf-wa-float:hover {
    background-color: #1ebe5a;
    color: #fff;
}
.hf-wa-float i {
    font-size: 1.5rem;
    line-height: 1;
}
.hf-wa-label {
    display: none;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.025em;
    padding-right: 0.25rem;
}
@media (min-width: 640px) {
    .hf-wa-float {
        bottom: 1.5rem;
        padding-right: 1rem;
    }
    .hf-wa-label {
        display: inline;
    }
}
/* Review star picker: big tap targets */
.hf-star-btn {
    width: 2.5rem;
    height: 2.5rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    line-height: 1;
    cursor: pointer;
    transition: transform 0.12s ease, color 0.12s ease;
}
.hf-star-btn:hover {
    transform: scale(1.12);
}

/* Tailwind utilities used by the reviews UI that are not in the current compiled build yet.
   Same layer + same values as Tailwind, so a future `npm run build` simply duplicates them. */
@layer utilities {
    .scroll-mt-28 { scroll-margin-top: calc(var(--spacing) * 28); }
    .bg-amber-400 { background-color: var(--color-amber-400); }
    .bg-amber-500 { background-color: var(--color-amber-500); }
    .gap-x-2 { column-gap: calc(var(--spacing) * 2); }
    .gap-x-3 { column-gap: calc(var(--spacing) * 3); }
    .gap-y-1 { row-gap: calc(var(--spacing) * 1); }
    .gap-x-6 { column-gap: calc(var(--spacing) * 6); }
    .px-1 { padding-inline: calc(var(--spacing) * 1); }
    .break-all { word-break: break-all; }
    .max-h-full { max-height: 100%; }
    .mr-0\.5 { margin-right: calc(var(--spacing) * 0.5); }
    .p-12 { padding: calc(var(--spacing) * 12); }
    .whitespace-pre-line { white-space: pre-line; }
    .cursor-zoom-in { cursor: zoom-in; }
    .bg-black\/80 { background-color: rgb(0 0 0 / 0.8); }
    .max-h-\[85vh\] { max-height: 85vh; }
    .hover\:border-stone-500:hover { border-color: var(--color-stone-500); }
    @media (min-width: 40rem) {
        .sm\:w-56 { width: calc(var(--spacing) * 56); }
    }
    @media (min-width: 64rem) {
        .lg\:items-center { align-items: center; }
        .lg\:flex-col { flex-direction: column; }
        .lg\:w-36 { width: calc(var(--spacing) * 36); }
    }
}

/* Product & checkout pages: sit above the mobile sticky bar */
.hf-wa-float.hf-wa-raised {
    bottom: 6rem;
}
@media (min-width: 1024px) {
    .hf-wa-float.hf-wa-raised {
        bottom: 1.5rem;
    }
}

/* ==== HERO-SLIDER-MERGED: same rules as css/hero-slider.css, merged here so the slider never loses its styling when that file is missing on the server ==== */
/* ==========================================================================
   Hijafera — Home hero slider (editorial full-bleed)
   Full-height photo, frosted centered panel, condensed uppercase headline.
   Plain CSS on purpose: the Tailwind bundle in public/build is precompiled,
   so new utility classes would not exist on the server without a rebuild.
   ========================================================================== */

.hjf-hero {
    --hjf-ink: #111111;
    --hjf-purple: #54239b;
    --hjf-panel: rgba(255, 255, 255, 0.78);
    --hjf-slide-ms: 7000ms;

    position: relative;
    overflow: hidden;
    isolation: isolate;
    background: #1a1a1a;
    height: clamp(560px, calc(100svh - 110px), 760px);
    touch-action: pan-y;
}

/* ---------- Photos ---------- */
.hjf-hero__media {
    position: absolute;
    inset: 0;
}
.hjf-hero__pic {
    position: absolute;
    inset: 0;
    opacity: 0;
    transition: opacity 0.9s ease;
}
.hjf-hero__pic.is-active {
    opacity: 1;
    z-index: 1;
}
.hjf-hero__pic picture {
    position: absolute;
    inset: 0;
    display: block;
}
.hjf-hero__blur {
    display: none;
}
.hjf-hero__img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 22%;
    transform: scale(1.08);
}
.hjf-hero__pic.is-active .hjf-hero__img {
    animation: hjfHeroZoom 9s ease-out forwards;
}
.hjf-hero__shade {
    position: absolute;
    inset: 0;
    z-index: 2;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.18) 0%, rgba(0, 0, 0, 0.05) 40%, rgba(0, 0, 0, 0.22) 100%);
    pointer-events: none;
}

/* ---------- Frosted panel ---------- */
.hjf-hero__panel {
    position: absolute;
    z-index: 3;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 22px 20px 14px;
    background: var(--hjf-panel);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
    color: var(--hjf-ink);
    text-align: center;
}
.hjf-hero__stack {
    display: grid;
}
.hjf-hero__slide {
    grid-area: 1 / 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.4s ease, transform 0.55s cubic-bezier(0.2, 0.7, 0.2, 1);
    pointer-events: none;
}
.hjf-hero__slide.is-active {
    opacity: 1;
    transform: none;
    pointer-events: auto;
    transition-delay: 0.15s;
}
.hjf-hero__badge {
    display: inline-block;
    padding: 4px 10px;
    background: var(--hjf-ink);
    color: #fff;
    font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}
.hjf-hero__title {
    margin: 12px 0 8px;
    font-family: 'Oswald', 'Arial Narrow', sans-serif;
    font-size: clamp(1.75rem, 7.5vw, 3.5rem);
    font-weight: 500;
    line-height: 1.05;
    letter-spacing: 0.01em;
    text-transform: uppercase;
    text-wrap: balance;
}
.hjf-hero__subtitle {
    max-width: 36rem;
    margin: 0;
    font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
    font-size: 12.5px;
    line-height: 1.7;
    letter-spacing: 0.06em;
    color: #2b2b2b;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.hjf-hero__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    margin-top: 18px;
    padding: 0 30px;
    border: 1px solid var(--hjf-ink);
    background: var(--hjf-ink);
    color: #fff;
    font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.26em;
    text-transform: uppercase;
    text-decoration: none;
    transition: background-color 0.2s, color 0.2s, border-color 0.2s;
}
.hjf-hero__btn:hover {
    background: var(--hjf-purple);
    border-color: var(--hjf-purple);
    color: #fff;
}

/* ---------- Indicators (inside the panel) ---------- */
.hjf-hero__dots {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 10px;
}
.hjf-hero__dot {
    width: 34px;
    padding: 14px 0; /* ~30px tall hit area; panel padding adds the rest */
    border: 0;
    background: none;
    cursor: pointer;
}
.hjf-hero__dot-track {
    position: relative;
    display: block;
    height: 2px;
    overflow: hidden;
    background: rgba(17, 17, 17, 0.2);
}
.hjf-hero__dot-fill {
    position: absolute;
    inset: 0;
    background: var(--hjf-ink);
    transform: scaleX(0);
    transform-origin: left center;
}
.hjf-hero__dot.is-active .hjf-hero__dot-fill {
    animation: hjfHeroProgress var(--hjf-slide-ms) linear forwards;
}
.hjf-hero.is-paused .hjf-hero__dot.is-active .hjf-hero__dot-fill,
.hjf-hero.is-paused .hjf-hero__pic.is-active .hjf-hero__img {
    animation-play-state: paused;
}

/* ---------- Side arrows (desktop) ---------- */
.hjf-hero .hjf-hero__arrow {
    position: absolute;
    z-index: 4;
    top: 42%;
    display: none;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    border: 0;
    background: none;
    color: #fff;
    font-size: 22px;
    cursor: pointer;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.45);
    opacity: 0.8;
    transform: translateY(-50%);
    transition: opacity 0.2s;
}
.hjf-hero .hjf-hero__arrow:hover {
    opacity: 1;
}
.hjf-hero .hjf-hero__arrow--prev { left: 20px; }
.hjf-hero .hjf-hero__arrow--next { right: 20px; }

.hjf-hero__btn:focus-visible,
.hjf-hero__dot:focus-visible,
.hjf-hero .hjf-hero__arrow:focus-visible {
    outline: 2px solid var(--hjf-purple);
    outline-offset: 3px;
}

@keyframes hjfHeroProgress {
    from { transform: scaleX(0); }
    to { transform: scaleX(1); }
}
@keyframes hjfHeroZoom {
    from { transform: scale(1.08); }
    to { transform: scale(1); }
}

/* ---------- Tablet / desktop ---------- */
@media (min-width: 768px) {
    .hjf-hero {
        height: clamp(560px, calc(100svh - 150px), 860px);
    }
    .hjf-hero__panel {
        left: 50%;
        right: auto;
        bottom: 48px;
        width: min(720px, calc(100% - 160px));
        padding: 30px 48px 16px;
        transform: translateX(-50%);
    }
    .hjf-hero__title {
        font-size: clamp(2.25rem, 4.2vw, 3.6rem);
    }
    .hjf-hero__subtitle {
        font-size: 13px;
        -webkit-line-clamp: 2;
    }
    .hjf-hero__btn {
        background: transparent;
        color: var(--hjf-ink);
    }
    .hjf-hero__btn:hover {
        background: var(--hjf-ink);
        border-color: var(--hjf-ink);
        color: #fff;
    }
    .hjf-hero .hjf-hero__arrow {
        display: inline-flex;
    }

    /* Portrait desktop image: whole photo over a blurred copy of itself */
    .hjf-hero__pic.is-portrait .hjf-hero__blur {
        display: block;
        position: absolute;
        inset: -40px;
        width: calc(100% + 80px);
        height: calc(100% + 80px);
        object-fit: cover;
        filter: blur(28px) brightness(0.72) saturate(1.1);
    }
    .hjf-hero__pic.is-portrait .hjf-hero__img,
    .hjf-hero__pic.is-portrait.is-active .hjf-hero__img {
        object-fit: contain;
        object-position: center top;
        animation: none;
        transform: none;
    }
}

/* ---------- Reduced motion: no autoplay, no zoom ---------- */
@media (prefers-reduced-motion: reduce) {
    .hjf-hero__pic,
    .hjf-hero__slide {
        transition: opacity 0.2s linear;
    }
    .hjf-hero__slide {
        transform: none !important;
    }
    .hjf-hero__pic.is-active .hjf-hero__img {
        animation: none;
        transform: none;
    }
    .hjf-hero__dot.is-active .hjf-hero__dot-fill {
        animation: none;
        transform: scaleX(1);
    }
}

