/* ========================================================
   DiwaliFrames / FrameVexa — Global Typography & Responsive Stylesheet
   Global Font: Poppins (400, 500, 600, 700)
   ======================================================== */

@import url('https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,400;0,500;0,600;0,700;1,400;1,600&display=swap');

/* ========================================================
   1. GLOBAL POPPINS TYPOGRAPHY ENFORCEMENT
   ======================================================== */
*, *::before, *::after {
    box-sizing: border-box;
}

html {
    font-family: 'Poppins', system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    -webkit-tap-highlight-color: transparent;
    text-rendering: optimizeLegibility;
}

body {
    font-family: 'Poppins', system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif !important;
    overflow-x: hidden;
    min-width: 320px;
}

/* Enforce Poppins on all headings, paragraphs, inputs, dropdowns, and components */
h1, h2, h3, h4, h5, h6,
p, a, span, label, strong, b, em,
button, input, select, textarea, optgroup, option,
table, th, td, ul, ol, li, blockquote,
.font-sans, .font-serif, .font-festive {
    font-family: 'Poppins', system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif !important;
}

/* Strictly preserve Font Awesome icons so icon glyphs render accurately */
.fa, .fas, .far, .fal, .fad, .fab, 
.fa-solid, .fa-regular, .fa-brands, 
[class*="fa-"], [class^="fa-"] {
    font-family: "Font Awesome 6 Free", "Font Awesome 6 Brands", "FontAwesome" !important;
    font-style: normal;
    text-transform: none;
    letter-spacing: normal;
}

/* ========================================================
   2. MOBILE-FIRST RESPONSIVE MEDIA & LAYOUT
   ======================================================== */
img, svg, video, canvas, audio, iframe, embed, object {
    max-width: 100%;
}

/* Prevent horizontal overflow on mobile viewports */
.overflow-x-hidden {
    overflow-x: hidden !important;
}

/* Form input ergonomics: iOS Safari zoom prevention (requires 16px min on focus) */
@media (max-width: 639px) {
    input[type="text"],
    input[type="email"],
    input[type="search"],
    input[type="password"],
    input[type="tel"],
    select,
    textarea {
        font-size: 16px !important;
    }
}

/* Comfortable tap targets on touch devices */
button, 
[role="button"],
.btn-touch {
    touch-action: manipulation;
}

/* ========================================================
   3. PHOTO EDITOR & PREVIEW CANVAS ERGONOMICS
   ======================================================== */
#previewContainer {
    max-width: 100% !important;
    max-height: min(65vh, 540px) !important;
    object-fit: contain;
}

#previewContainer canvas {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

/* Smooth momentum scrolling for category tabs & gallery lists */
.scrollbar-thin {
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
}

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

.scrollbar-thin::-webkit-scrollbar-track {
    background: #FFF5E8;
    border-radius: 9999px;
}

.scrollbar-thin::-webkit-scrollbar-thumb {
    background: #D4A34A;
    border-radius: 9999px;
}

/* Hide horizontal scrollbar while keeping scrolling functional */
.no-scrollbar {
    -webkit-overflow-scrolling: touch;
    -ms-overflow-style: none; /* IE and Edge */
    scrollbar-width: none; /* Firefox */
}

.no-scrollbar::-webkit-scrollbar {
    display: none; /* Chrome, Safari, Opera */
    width: 0;
    height: 0;
}

/* Mobile Responsive Category Section */
@media (max-width: 639px) {
    .category-scroll-container {
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none !important;
        -ms-overflow-style: none !important;
        scroll-snap-type: x proximity;
        scroll-padding: 0 16px;
    }

    .category-scroll-container::-webkit-scrollbar {
        display: none !important;
        width: 0 !important;
        height: 0 !important;
    }

    /* Never stretch category buttons to full screen width on mobile */
    .category-scroll-container .category-btn {
        width: auto !important;
        max-width: 75vw;
        flex-shrink: 0 !important;
        scroll-snap-align: start;
    }

    /* Hide chevron right inside category buttons on mobile */
    .category-scroll-container .category-btn .fa-chevron-right,
    .category-btn .fa-chevron-right {
        display: none !important;
    }
}

/* Responsive table styling for admin */
.table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}
