/**
 * Fabrilife Fashion Theme - Main Stylesheet
 * Google Stitch UI Minimalist Apparel Aesthetic
 *
 * @package Fabrilife_Theme
 * @version 2.0.0
 */

/* ==========================================================================
   Base & Resets
   ========================================================================== */
*, ::before, ::after {
    box-sizing: border-box;
}

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
    -webkit-tap-highlight-color: transparent;
    scroll-behavior: smooth;
}

body {
    margin: 0;
    padding: 0;
    background-color: var(--fl-surface, #F9F9FF);
    color: var(--fl-text, #111827);
    font-family: var(--fl-font-body, 'Inter', sans-serif);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Material Symbols configuration */
.material-symbols-outlined {
    font-family: 'Material Symbols Outlined';
    font-weight: normal;
    font-style: normal;
    font-size: 20px;
    line-height: 1;
    letter-spacing: normal;
    text-transform: none;
    display: inline-block;
    white-space: nowrap;
    word-wrap: normal;
    direction: ltr;
    -webkit-font-feature-settings: 'liga';
    -webkit-font-smoothing: antialiased;
    vertical-align: middle;
}

/* Scrollbar hides */
.no-scrollbar::-webkit-scrollbar,
.scrollbar-none::-webkit-scrollbar {
    display: none;
}
.no-scrollbar,
.scrollbar-none {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

/* Safe area inset padding for bottom navigation */
.pb-safe {
    padding-bottom: env(safe-area-inset-bottom, 0.5rem);
}

/* Typography & Design Tokens */
.font-display {
    font-family: var(--fl-font-display, 'Plus Jakarta Sans', sans-serif);
}

/* ==========================================================================
   Mega Menu & Header Animations
   ========================================================================== */
.mega-menu-panel {
    transform-origin: top center;
    transition: opacity 0.2s cubic-bezier(0.16, 1, 0.3, 1), transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.2s;
}

/* ==========================================================================
   Promotional Banner Slider
   ========================================================================== */
.fabrilife-slider-section {
    user-select: none;
}
.fabrilife-slider-track {
    will-change: transform;
}
.fabrilife-slide img {
    image-rendering: auto;
}

/* ==========================================================================
   Product Cards & Hover Transitions
   ========================================================================== */
.product-card {
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
.product-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.08), 0 8px 10px -6px rgba(0, 0, 0, 0.04);
}

/* Circular Black Add to Cart Button */
.fabrilife-card-cart-btn {
    transition: transform 0.15s ease, background-color 0.15s ease;
}
.fabrilife-card-cart-btn:active {
    transform: scale(0.9);
}

/* Buttons */
.btn-primary {
    background-color: var(--fl-primary, #111827);
    color: #ffffff;
    border-radius: var(--fl-btn-radius, 8px);
    font-weight: 600;
    transition: all 0.15s ease-in-out;
}
.btn-primary:hover {
    background-color: var(--fl-hover-bg, #1f2937);
}
.btn-primary:active {
    transform: scale(0.98);
}

/* Variation Size Chips */
.size-chip {
    transition: all 0.15s ease;
}

/* Floating Bottom Navigation Bar */
#mobile-bottom-bar {
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

/* Quantity Stepper Input reset */
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
input[type="number"] {
    -moz-appearance: textfield;
}

/* Line clamps */
.line-clamp-1 {
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* WooCommerce Checkout Overrides */
.woocommerce-checkout .form-row {
    margin-bottom: 0;
    padding: 0;
}
.woocommerce-checkout .woocommerce-input-wrapper {
    width: 100%;
}

/* ==========================================================================
   Header Consistency & Strict Logo Bounds (All Pages Guaranteed)
   ========================================================================== */
.site-header {
    position: relative;
    z-index: 50;
    background-color: #ffffff;
    border-bottom: 1px solid #e5e7eb;
    height: auto !important;
}
.site-header .custom-logo-link,
.site-header .site-logo a,
.site-header .header-logo a {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    max-width: 250px !important;
    width: auto !important;
    height: auto !important;
    flex-shrink: 0 !important;
}
.site-header .custom-logo,
.site-header .site-logo img,
.site-header .header-logo img,
.site-header .site-branding img,
.site-header a img {
    width: auto !important;
    max-width: var(--fl-logo-width, 180px) !important;
    height: auto !important;
    max-height: 48px !important;
    object-fit: contain !important;
    display: block !important;
}

/* STRICT MOBILE LOGO REQUIREMENT (320px - 767px) */
@media (max-width: 767px) {
    .site-header .custom-logo,
    .site-header .site-logo img,
    .site-header .header-logo img {
        width: auto;
        max-width: 200px;
        height: auto;
        max-height: 80px;
        object-fit: contain;
        display: block;
        margin-left: auto;
        margin-right: auto;
    }
    .mobile-header {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        width: 100%;
        padding: 10px 16px 12px;
    }
}

/* Real-Time AJAX Search Dropdown Results */
.ajax-search-dropdown {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    background: #ffffff;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    z-index: 60;
    max-height: 380px;
    overflow-y: auto;
}
.ajax-search-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-bottom: 1px solid #f3f4f6;
    transition: background-color 0.15s ease;
    text-decoration: none;
    color: inherit;
}
.ajax-search-item:last-child {
    border-bottom: none;
}
.ajax-search-item:hover {
    background-color: #f9fafb;
}

/* Floating WhatsApp Customer Support Button */
.fabrilife-whatsapp-btn {
    position: fixed;
    right: 16px;
    bottom: 80px; /* Above mobile bottom bar */
    z-index: 45;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background-color: #25D366;
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 20px -3px rgba(37, 211, 102, 0.4), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.2s ease;
}
@media (min-width: 768px) {
    .fabrilife-whatsapp-btn {
        bottom: 24px;
        width: 56px;
        height: 56px;
    }
}
.fabrilife-whatsapp-btn:hover {
    transform: scale(1.08);
    box-shadow: 0 14px 28px -4px rgba(37, 211, 102, 0.5);
}
.fabrilife-whatsapp-btn:active {
    transform: scale(0.95);
}

/* ==========================================================================
   Mobile Responsive Guard (320px - 767px)
   ========================================================================== */
html, body {
    overflow-x: hidden !important;
    max-width: 100vw !important;
}
img, svg, video {
    max-width: 100%;
    height: auto;
}

/* ==========================================================================
   1:1 Square Product Cards & Gallery Viewport (Exact 1:1 Aspect Ratio)
   ========================================================================== */
.aspect-square,
.product-card .aspect-square,
.product-card .aspect-\[3\/4\],
#fabrilife-gallery-viewport {
    aspect-ratio: 1 / 1 !important;
}
.product-card img {
    aspect-ratio: 1 / 1 !important;
    object-fit: cover !important;
    object-position: center !important;
}
#fabrilife-gallery-viewport {
    position: relative;
    overflow: hidden;
    width: 100% !important;
}
#fabrilife-gallery-viewport img {
    will-change: transform;
    object-fit: contain !important;
}
#fabrilife-lightbox-modal {
    touch-action: pinch-zoom;
}

/* ==========================================================================
   Reduced Motion Accessibility 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;
    }
}

/* ==========================================================================
   Card Quantity Stepper & Add to Cart Controls
   ========================================================================== */
.card-qty-stepper {
    user-select: none;
    -webkit-user-select: none;
}
.card-qty-btn {
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}
.card-qty-btn:active {
    transform: scale(0.9);
}

/* ==========================================================================
   Product Variations Chips
   ========================================================================== */
.variation-chip {
    transition: all 0.15s ease-in-out;
}
.variation-chip:active {
    transform: scale(0.95);
}

/* ==========================================================================
   AJAX Live Search Dropdown Styling
   ========================================================================== */
.ajax-search-dropdown {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    width: 100%;
    background-color: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    z-index: 60;
    max-height: 380px;
    overflow-y: auto;
}
.ajax-search-item {
    transition: background-color 0.15s ease;
}

/* ==========================================================================
   Checkout Validation Errors
   ========================================================================== */
.checkout-error-border {
    border-color: #ef4444 !important;
    box-shadow: 0 0 0 1px #ef4444 !important;
}
/* ==========================================================================
   Moriam Fashion Luxury Design System & Account Tracker
   ========================================================================== */
.font-serif {
    font-family: 'Noto Serif', Georgia, serif;
}
.tracker-pulse {
    animation: trackerPulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}
@keyframes trackerPulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(1.15); }
}
.shadow-2xs {
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.03);
}
.shadow-xs {
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}
