/* ═══════════════════════════════════════════════════════════════════
   Mirchiwale — Modern Design System
   Premium spice eCommerce styling with smooth animations,
   glassmorphism, and modern micro-interactions.
   ═══════════════════════════════════════════════════════════════════ */

/* ─── Design Tokens ─── */
:root {
    --color-cream: #FAF3E0;
    --color-spice-orange: #D97706;
    --color-spice-dark: #8F4C03;
    --color-accent-light: #FCD34D;
    --color-white: #FFFFFF;
    --color-error: #EF4444;
    --color-danger: #DC2626;
    --color-success: #16A34A;

    /* Timing Functions */
    --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
    --ease-smooth: cubic-bezier(0.25, 0.46, 0.45, 0.94);
    --ease-out-expo: cubic-bezier(0.19, 1, 0.22, 1);

    /* Shadows */
    --shadow-sm: 0 1px 3px rgba(143, 76, 3, 0.06);
    --shadow-md: 0 4px 16px rgba(143, 76, 3, 0.08);
    --shadow-lg: 0 12px 40px rgba(143, 76, 3, 0.12);
    --shadow-xl: 0 20px 60px rgba(143, 76, 3, 0.16);
    --shadow-glow: 0 0 30px rgba(217, 119, 6, 0.2);
}

/* ─── Base & Selection ─── */
::selection {
    background: rgba(217, 119, 6, 0.15);
    color: var(--color-spice-dark);
}

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body.loader-active {
    overflow: hidden;
}

/* ─── Custom Scrollbar ─── */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--color-spice-dark);
    border-radius: 99px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--color-spice-orange);
}

/* Firefox */
* {
    scrollbar-width: thin;
    scrollbar-color: var(--color-spice-dark) transparent;
}


/* ═══════════════════════════════════════════════════════════════════
   SCROLL-REVEAL ANIMATIONS (Intersection Observer driven)
   Elements get class `.is-visible` when they enter the viewport.
   ═══════════════════════════════════════════════════════════════════ */

[data-reveal] {
    opacity: 0;
    will-change: transform, opacity;
    transition: opacity 0.7s var(--ease-smooth), transform 0.7s var(--ease-out-expo);
}

[data-reveal="up"] {
    transform: translateY(40px);
}

[data-reveal="down"] {
    transform: translateY(-40px);
}

[data-reveal="left"] {
    transform: translateX(40px);
}

[data-reveal="right"] {
    transform: translateX(-40px);
}

[data-reveal="scale"] {
    transform: scale(0.92);
}

[data-reveal="fade"] {
    transform: none;
}

[data-reveal].is-visible {
    opacity: 1;
    transform: translateY(0) translateX(0) scale(1);
}


/* ═══════════════════════════════════════════════════════════════════
   HERO TEXT REVEAL ANIMATION
   ═══════════════════════════════════════════════════════════════════ */

.hero-text-reveal {
    overflow: hidden;
}

.hero-text-reveal > * {
    animation: heroSlideUp 0.9s var(--ease-out-expo) both;
}

.hero-text-reveal > *:nth-child(1) { animation-delay: 0.15s; }
.hero-text-reveal > *:nth-child(2) { animation-delay: 0.3s; }
.hero-text-reveal > *:nth-child(3) { animation-delay: 0.45s; }
.hero-text-reveal > *:nth-child(4) { animation-delay: 0.6s; }
.hero-text-reveal > *:nth-child(5) { animation-delay: 0.75s; }

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


/* ═══════════════════════════════════════════════════════════════════
   GLASSMORPHISM UTILITIES
   ═══════════════════════════════════════════════════════════════════ */

.glass {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(20px) saturate(1.8);
    -webkit-backdrop-filter: blur(20px) saturate(1.8);
}

.glass-dark {
    background: rgba(26, 26, 26, 0.85);
    backdrop-filter: blur(20px) saturate(1.6);
    -webkit-backdrop-filter: blur(20px) saturate(1.6);
}

.glass-cream {
    background: rgba(250, 243, 224, 0.6);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}


/* ═══════════════════════════════════════════════════════════════════
   NAVBAR — Glassmorphism Sticky Header
   ═══════════════════════════════════════════════════════════════════ */

#main-header {
    transition: background 0.4s ease, box-shadow 0.4s ease, 
                backdrop-filter 0.4s ease, padding 0.3s ease;
    background: rgba(255, 255, 255, 0.95);
}

#main-header.is-scrolled {
    background: rgba(255, 255, 255, 0.8) !important;
    backdrop-filter: blur(20px) saturate(1.8);
    -webkit-backdrop-filter: blur(20px) saturate(1.8);
    box-shadow: 0 1px 20px rgba(143, 76, 3, 0.06);
}

/* Nav link animated underline */
.nav-link {
    position: relative;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 50%;
    width: 0;
    height: 2px;
    background: var(--color-spice-orange);
    border-radius: 1px;
    transition: width 0.3s var(--ease-spring), left 0.3s var(--ease-spring);
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 100%;
    left: 0;
}

/* Dropdown spring animation */
.nav-dropdown {
    opacity: 0;
    transform: translateY(8px) scale(0.96);
    pointer-events: none;
    transition: opacity 0.25s ease, transform 0.35s var(--ease-spring);
}

.group:hover > .nav-dropdown {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}


/* ═══════════════════════════════════════════════════════════════════
   ANIMATED HAMBURGER → X
   ═══════════════════════════════════════════════════════════════════ */

.hamburger-line {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--color-spice-dark);
    border-radius: 2px;
    transition: transform 0.35s var(--ease-spring), opacity 0.2s ease;
}

.hamburger-active .hamburger-line:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.hamburger-active .hamburger-line:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
}

.hamburger-active .hamburger-line:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}


/* ═══════════════════════════════════════════════════════════════════
   BUTTON SYSTEM — Ripple + Loading + Spring Press
   ═══════════════════════════════════════════════════════════════════ */

.btn {
    position: relative;
    overflow: hidden;
    transition: all 0.3s var(--ease-smooth);
    transform: translateZ(0);
    will-change: transform;
}

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

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

/* Color Palette Specified Button Classes */
.btn-primary {
    background-color: #D97706 !important;
    color: #FFFFFF !important;
}
.btn-primary:hover {
    background-color: #B45309 !important;
}
.btn-secondary {
    background-color: #FCD34D !important;
    color: #8F4C03 !important;
}
.btn-secondary:hover {
    background-color: #F7B605 !important;
}
.btn-danger {
    background-color: #DC2626 !important;
    color: #FFFFFF !important;
}
.btn-success {
    background-color: #16A34A !important;
    color: #FFFFFF !important;
}

/* Ripple container */
.btn .ripple {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.35);
    transform: scale(0);
    animation: rippleExpand 0.6s ease-out forwards;
    pointer-events: none;
}

@keyframes rippleExpand {
    to {
        transform: scale(4);
        opacity: 0;
    }
}

/* Arrow slide on CTA buttons */
.btn-arrow .arrow-icon {
    transition: transform 0.3s var(--ease-spring);
}

.btn-arrow:hover .arrow-icon {
    transform: translateX(4px);
}

/* Loading spinner in button */
.btn-loading {
    pointer-events: none;
    opacity: 0.85;
}

.btn-loading .btn-text {
    opacity: 0;
}

.btn-loading .btn-spinner {
    opacity: 1;
}

.btn-spinner {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s ease;
}


/* ═══════════════════════════════════════════════════════════════════
   CARD SYSTEM — Lift, Tilt, Shine
   ═══════════════════════════════════════════════════════════════════ */

.card-modern {
    transition: transform 0.4s var(--ease-smooth), box-shadow 0.4s var(--ease-smooth);
    will-change: transform;
}

.card-modern:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-lg);
}

/* Image shimmer/shine on hover */
.card-shine {
    position: relative;
    overflow: hidden;
}

.card-shine::after {
    content: '';
    position: absolute;
    top: 0;
    left: -75%;
    width: 50%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.2),
        transparent
    );
    transform: skewX(-15deg);
    transition: left 0.7s ease;
    pointer-events: none;
    z-index: 5;
}

.card-shine:hover::after {
    left: 125%;
}

/* Quick action bar slide-up */
.card-actions {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    transform: translateY(100%);
    transition: transform 0.35s var(--ease-spring);
    z-index: 20;
}

.card-modern:hover .card-actions {
    transform: translateY(0);
}

/* Category card 3D tilt */
.card-tilt {
    transition: transform 0.4s var(--ease-smooth);
    transform-style: preserve-3d;
    perspective: 800px;
}

.card-tilt:hover {
    transform: perspective(800px) rotateX(2deg) rotateY(-3deg) scale(1.02);
}

.card-tilt .card-tilt-content {
    transition: transform 0.4s var(--ease-smooth);
}

.card-tilt:hover .card-tilt-content {
    transform: translateZ(20px);
}


/* ═══════════════════════════════════════════════════════════════════
   TRUST MARQUEE — Auto-scrolling Strip
   ═══════════════════════════════════════════════════════════════════ */

.marquee-track {
    display: flex;
    width: max-content;
    animation: marqueeScroll 35s linear infinite;
}

.marquee-track:hover {
    animation-play-state: paused;
}

@keyframes marqueeScroll {
    from { transform: translateX(0); }
    to { transform: translateX(-50%); }
}


/* ═══════════════════════════════════════════════════════════════════
   STATS COUNTER ANIMATION
   ═══════════════════════════════════════════════════════════════════ */

.counter-value {
    display: inline-block;
    transition: transform 0.3s var(--ease-spring);
}

.counter-value.is-counting {
    animation: counterPop 0.4s var(--ease-spring);
}

@keyframes counterPop {
    0% { transform: scale(0.5); opacity: 0; }
    70% { transform: scale(1.08); }
    100% { transform: scale(1); opacity: 1; }
}


/* ═══════════════════════════════════════════════════════════════════
   MODERN LOADER
   ═══════════════════════════════════════════════════════════════════ */

.modern-loader {
    display: flex;
    align-items: center;
    gap: 6px;
}

.modern-loader .dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--color-spice-dark);
    animation: loaderBounce 1.4s var(--ease-smooth) infinite;
}

.modern-loader .dot:nth-child(1) { animation-delay: 0s; }
.modern-loader .dot:nth-child(2) { animation-delay: 0.16s; background: var(--color-spice-orange); }
.modern-loader .dot:nth-child(3) { animation-delay: 0.32s; background: var(--color-accent-light); }

@keyframes loaderBounce {
    0%, 80%, 100% {
        transform: scale(0.6);
        opacity: 0.4;
    }
    40% {
        transform: scale(1.1);
        opacity: 1;
    }
}

/* Loader fade out */
#global-loader {
    transition: opacity 0.5s var(--ease-smooth);
}

#global-loader.fade-out {
    opacity: 0;
    pointer-events: none;
}


/* ═══════════════════════════════════════════════════════════════════
   SWIPER CUSTOMIZATIONS
   ═══════════════════════════════════════════════════════════════════ */

.swiper-pagination-bullet {
    background: var(--color-spice-dark) !important;
    opacity: 0.25;
    width: 8px;
    height: 8px;
    transition: all 0.4s var(--ease-spring);
}

.swiper-pagination-bullet-active {
    background: var(--color-spice-orange) !important;
    opacity: 1 !important;
    width: 24px !important;
    border-radius: 4px !important;
}

.swiper-button-next,
.swiper-button-prev {
    color: var(--color-spice-orange) !important;
    background: rgba(255, 255, 255, 0.92);
    width: 42px !important;
    height: 42px !important;
    border-radius: 12px;
    box-shadow: var(--shadow-md);
    transition: all 0.3s var(--ease-smooth);
}

.swiper-button-next:after,
.swiper-button-prev:after {
    font-size: 16px !important;
    font-weight: 600;
}

.swiper-button-next:hover,
.swiper-button-prev:hover {
    background: var(--color-spice-orange);
    color: var(--color-white) !important;
    transform: scale(1.05);
}


/* ═══════════════════════════════════════════════════════════════════
   FORM ELEMENTS — Modern Focus States
   ═══════════════════════════════════════════════════════════════════ */

input:focus,
textarea:focus,
select:focus {
    border-color: var(--color-spice-orange) !important;
    box-shadow: 0 0 0 3px rgba(217, 119, 6, 0.1), 0 1px 3px rgba(0, 0, 0, 0.05) !important;
    outline: none !important;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

/* Animated placeholder */
.input-modern::placeholder {
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.input-modern:focus::placeholder {
    opacity: 0.4;
    transform: translateX(4px);
}


/* ═══════════════════════════════════════════════════════════════════
   SOCIAL ICON HOVER — Scale + Glow
   ═══════════════════════════════════════════════════════════════════ */

.social-icon {
    transition: all 0.3s var(--ease-spring);
}

.social-icon:hover {
    transform: translateY(-3px) scale(1.1);
    box-shadow: 0 4px 15px rgba(217, 119, 6, 0.3);
}


/* ═══════════════════════════════════════════════════════════════════
   SCROLL-TO-TOP — Progress Ring
   ═══════════════════════════════════════════════════════════════════ */

#scroll-top-btn {
    transition: all 0.4s var(--ease-spring);
}

#scroll-top-btn.is-visible {
    transform: translateY(0) !important;
    opacity: 1 !important;
    pointer-events: auto !important;
}

#scroll-top-btn:hover {
    transform: translateY(-3px) scale(1.1) !important;
    box-shadow: var(--shadow-glow);
}


/* ═══════════════════════════════════════════════════════════════════
   ANIMATED GRADIENT BORDER
   ═══════════════════════════════════════════════════════════════════ */

.gradient-border-animated {
    background: linear-gradient(90deg, 
        var(--color-spice-dark), 
        var(--color-spice-orange), 
        var(--color-accent-light), 
        var(--color-spice-orange), 
        var(--color-spice-dark)
    );
    background-size: 300% 100%;
    animation: gradientShift 4s ease infinite;
}

@keyframes gradientShift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}


/* ═══════════════════════════════════════════════════════════════════
   FLOATING ANIMATION (for badges, decorative elements)
   ═══════════════════════════════════════════════════════════════════ */

.float-gentle {
    animation: floatGentle 6s ease-in-out infinite;
}

.float-gentle-delayed {
    animation: floatGentle 6s ease-in-out 2s infinite;
}

@keyframes floatGentle {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-12px); }
}


/* ═══════════════════════════════════════════════════════════════════
   TEXT GRADIENT UTILITY
   ═══════════════════════════════════════════════════════════════════ */

.text-gradient {
    background: linear-gradient(135deg, var(--color-spice-dark), var(--color-spice-orange));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}


/* ═══════════════════════════════════════════════════════════════════
   MOBILE DRAWER — Smooth Slide
   ═══════════════════════════════════════════════════════════════════ */

#mobile-menu-drawer {
    transition: opacity 0.3s ease;
}

#mobile-menu-drawer .drawer-panel {
    transition: transform 0.4s var(--ease-out-expo);
}

#mobile-menu-drawer.is-open {
    opacity: 1;
    pointer-events: auto;
}

#mobile-menu-drawer.is-open .drawer-panel {
    transform: translateX(0);
}


/* ═══════════════════════════════════════════════════════════════════
   RESPONSIVE REFINEMENTS
   ═══════════════════════════════════════════════════════════════════ */

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

    [data-reveal] {
        opacity: 1;
        transform: none;
    }

    .marquee-track {
        animation: none;
    }
}

/* Better touch targets on mobile */
@media (max-width: 768px) {
    .btn {
        min-height: 44px;
    }

    [data-reveal] {
        transform: translateY(20px) !important;
    }

    [data-reveal].is-visible {
        transform: translateY(0) translateX(0) scale(1) !important;
    }
}


/* ═══════════════════════════════════════════════════════════════════
   NEWSLETTER SECTION — Animated Floating Circles
   ═══════════════════════════════════════════════════════════════════ */

.newsletter-bg-circle {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.06);
    animation: floatCircle 8s ease-in-out infinite;
}

.newsletter-bg-circle:nth-child(2) {
    animation-delay: 2s;
    animation-duration: 10s;
}

.newsletter-bg-circle:nth-child(3) {
    animation-delay: 4s;
    animation-duration: 12s;
}

@keyframes floatCircle {
    0%, 100% {
        transform: translate(0, 0) scale(1);
    }
    33% {
        transform: translate(20px, -20px) scale(1.05);
    }
    66% {
        transform: translate(-15px, 15px) scale(0.95);
    }
}


/* ═══════════════════════════════════════════════════════════════════
   SEARCH MODAL — Modern Entrance
   ═══════════════════════════════════════════════════════════════════ */

#search-modal {
    transition: opacity 0.3s ease;
}

#search-modal #search-panel {
    transition: transform 0.4s var(--ease-spring), opacity 0.3s ease;
}

#search-modal.is-active {
    opacity: 1;
    pointer-events: auto;
}

#search-modal.is-active #search-panel {
    transform: scale(1) translateY(0);
    opacity: 1;
}


/* ═══════════════════════════════════════════════════════════════════
   WHY US CARDS — Border Glow on Hover
   ═══════════════════════════════════════════════════════════════════ */

.why-card {
    position: relative;
    transition: all 0.4s var(--ease-smooth);
}

.why-card::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    padding: 1px;
    background: linear-gradient(135deg, transparent, rgba(217, 119, 6, 0.3), transparent);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.why-card:hover::before {
    opacity: 1;
}

.why-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}


/* ═══════════════════════════════════════════════════════════════════
   TESTIMONIAL CARDS — Modern Quote Style
   ═══════════════════════════════════════════════════════════════════ */

.testimonial-card {
    position: relative;
    transition: transform 0.3s var(--ease-smooth), box-shadow 0.3s ease;
}

.testimonial-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.testimonial-card .quote-mark {
    font-size: 4rem;
    line-height: 1;
    color: rgba(217, 119, 6, 0.08);
    font-family: 'DM Serif Display', serif;
    position: absolute;
    top: 16px;
    right: 24px;
    user-select: none;
}

/* ═══════════════════════════════════════════════════════════════════
   MOBILE RESPONSIVENESS & TOUCH OPTIMIZATION (PUBLIC, CUSTOMER & ADMIN)
   ═══════════════════════════════════════════════════════════════════ */

/* Global horizontal overflow protection */
html, body {
    max-width: 100%;
    overflow-x: hidden !important;
}

/* Touch friendly minimum click areas */
@media (max-width: 768px) {
    a, button, input[type="submit"], input[type="button"], .touch-target {
        min-height: 44px;
        min-width: 44px;
    }
    
    input, select, textarea {
        font-size: 16px !important; /* Prevents auto-zoom on iOS Safari */
    }

    /* Mobile Table Scroll Wrappers */
    .table-responsive {
        display: block;
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        border-radius: 0.75rem;
    }

    /* Custom Mobile Card Table View for data-dense tables */
    .mobile-card-table thead {
        display: none;
    }

    .mobile-card-table tbody tr {
        display: block;
        background: #ffffff;
        border: 1px solid #E5E7EB;
        border-radius: 1rem;
        padding: 1rem;
        margin-bottom: 0.75rem;
        box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    }

    .mobile-card-table tbody td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 0.5rem 0;
        border-bottom: 1px border-dashed #F3F4F6;
        text-align: right;
        font-size: 0.8125rem;
    }

    .mobile-card-table tbody td:last-child {
        border-bottom: none;
    }

    .mobile-card-table tbody td::before {
        content: attr(data-label);
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: 0.05em;
        font-size: 0.6875rem;
        color: #8F4C03;
        text-align: left;
        padding-right: 1rem;
    }

    /* Mobile Header & Bottom Action Bar */
    .mobile-bottom-bar {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        z-index: 90;
        background: rgba(255, 255, 255, 0.95);
        backdrop-filter: blur(12px);
        border-top: 1px solid #E5E7EB;
        box-shadow: 0 -4px 20px rgba(143, 76, 3, 0.08);
    }

    .mobile-bottom-bar a {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        padding: 6px 0;
        color: #8F4C03;
        font-size: 10px;
        font-weight: 700;
    }

    .mobile-bottom-bar a.active {
        color: #D97706;
    }
}

