/* ============================================================
   FestiveFinds — Global Stylesheet (main.css)
   Loaded on every page via views/components/meta.php
   ============================================================ */

/* ── Custom scrollbar ──────────────────────────────────────── */
::-webkit-scrollbar          { width: 6px; height: 6px; }
::-webkit-scrollbar-track    { background: transparent; }
::-webkit-scrollbar-thumb    { background: #e5e7eb; border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: #d1d5db; }

/* ── Branded navigation loading state ──────────────────────── */
.page-loader {
    position: fixed;
    inset: 0;
    z-index: 10000;
    pointer-events: none; /* purely visual — must never block clicks */
    display: grid;
    place-items: center;
    padding: 24px;
    color: #fff8e7;
    background: rgba(36, 3, 6, .97);
    opacity: 0;
    visibility: hidden;
    transition: opacity .2s ease, visibility .2s ease;
}
.page-loader.is-visible { opacity: 1; visibility: visible; }
.page-loader__content { display: grid; justify-items: center; gap: 16px; text-align: center; }
.page-loader__mark {
    display: grid;
    place-items: center;
    width: 58px;
    aspect-ratio: 1;
    color: #2b0305;
    background: #fbbf24;
    border: 3px solid rgba(255, 248, 231, .8);
    border-radius: 17px;
    box-shadow: 0 0 0 8px rgba(251, 191, 36, .1), 0 12px 36px rgba(251, 191, 36, .18);
    font-size: 24px;
    animation: loader-mark 1.1s ease-in-out infinite alternate;
}
.page-loader__title { margin: 0; font: 800 16px/1.3 Inter, sans-serif; }
.page-loader__message { margin: 0; color: rgba(255, 248, 231, .68); font: 500 12px/1.5 Inter, sans-serif; }
.page-loader__track { width: min(180px, 55vw); height: 3px; overflow: hidden; background: rgba(255,255,255,.16); border-radius: 99px; }
.page-loader__track::after {
    display: block;
    width: 42%;
    height: 100%;
    content: "";
    background: #fbbf24;
    border-radius: inherit;
    animation: loader-progress 1.15s ease-in-out infinite;
}

/* Image wrappers keep their dimensions while native lazy loading fetches media. */
.media-loading { position: relative; isolation: isolate; overflow: hidden; background-color: #f3f4f6; }
.media-loading::before {
    position: absolute;
    z-index: 1;
    inset: 0;
    content: "";
    background: linear-gradient(100deg, transparent 20%, rgba(255,255,255,.72) 45%, transparent 70%);
    transform: translateX(-100%);
    animation: media-shimmer 1.4s ease-in-out infinite;
    pointer-events: none;
}
.media-loading > img { position: relative; z-index: 0; }
.media-loading.is-loaded::before, .media-loading.is-failed::before { content: none; animation: none; }
.media-loading.is-failed { background-image: radial-gradient(circle, #fff 0 2px, transparent 3px); background-size: 14px 14px; }

@keyframes loader-mark { to { transform: translateY(-4px) rotate(-3deg); } }
@keyframes loader-progress { 0% { transform: translateX(-110%); } 100% { transform: translateX(260%); } }
@keyframes media-shimmer { to { transform: translateX(100%); } }
@media (prefers-reduced-motion: reduce) {
    .page-loader, .page-loader__mark, .page-loader__track::after, .media-loading::before { animation: none; transition: none; }
}

/* ── Hide horizontal scrollbar for nav strips ──────────────── */
.hide-scroll { -ms-overflow-style: none; scrollbar-width: none; }
.hide-scroll::-webkit-scrollbar { display: none; }

/* ── Glassmorphism panel ───────────────────────────────────── */
.glass {
    background: rgba(255, 255, 255, 0.75);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

/* ── Line-clamp utilities ──────────────────────────────────── */
.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.line-clamp-1 {
    display: -webkit-box;
    -webkit-line-clamp: 1;
    line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ── Countdown timer digits ────────────────────────────────── */
.countdown-digit {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    background: rgba(0, 0, 0, 0.3);
    border-radius: .375rem;
    padding: .15rem .45rem;
    font-weight: 900;
    font-size: 1rem;
    line-height: 1;
    color: #fff;
    min-width: 2rem;
}
.countdown-label {
    font-size: .45rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .05em;
    opacity: .8;
    margin-top: 2px;
}

/* ── Stock progress bar ────────────────────────────────────── */
.stock-bar {
    height: 4px;
    background: #e5e7eb;
    border-radius: 2px;
    overflow: hidden;
}
.stock-bar-fill {
    height: 100%;
    background: linear-gradient(to right, #ef4444, #f97316);
    border-radius: 2px;
    transition: width 1s ease;
}

/* ── Flash deal card hover animation ──────────────────────── */
.deal-card {
    transition: transform .25s ease, box-shadow .25s ease;
}
.deal-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 40px -8px rgba(0, 0, 0, 0.12);
}

/* ── Platform card hover ───────────────────────────────────── */
.platform-card {
    transition: transform .2s ease, box-shadow .2s ease;
}
.platform-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px -6px rgba(0, 0, 0, 0.1);
}

/* ── Category chip hover ───────────────────────────────────── */
.category-chip {
    transition: all .2s ease;
}
.category-chip:hover {
    transform: scale(1.05);
}

/* ── "View Deal" button pulse animation ────────────────────── */
@keyframes pulse-ring {
    0%   { box-shadow: 0 0 0 0 rgba(185, 28, 28, .4); }
    70%  { box-shadow: 0 0 0 8px rgba(185, 28, 28, 0); }
    100% { box-shadow: 0 0 0 0 rgba(185, 28, 28, 0); }
}
.btn-pulse { animation: pulse-ring 2.5s infinite; }

/* ── Newsletter input focus glow ───────────────────────────── */
.newsletter-input:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(185, 28, 28, .15);
    border-color: #b91c1c;
}

/* ── Admin table row hover ─────────────────────────────────── */
.admin-row:hover { background-color: #fafafa; }

/* ── Badge animations ──────────────────────────────────────── */
@keyframes badge-blink {
    0%, 100% { opacity: 1; }
    50%       { opacity: .75; }
}
.badge-live { animation: badge-blink 2s ease-in-out infinite; }

/* ── Admin Settings Input ──────────────────────────────────── */
.setting-input {
    width: 100%;
    padding: 0.5rem 0.75rem;
    background-color: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    font-size: 0.75rem;
    color: #374151;
    font-weight: 500;
    transition: all 0.2s ease;
}
.setting-input:focus {
    outline: none;
    border-color: #b91c1c;
    box-shadow: 0 0 0 2px rgba(185, 28, 28, 0.1);
    background-color: #ffffff;
}

/* ── Custom Select Utilities ─────────────────────────────────── */
.custom-select, .custom-select-sm {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%236B7280'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-color: transparent;
}
.custom-select {
    background-position: right 0.75rem center;
    background-size: 1rem;
    padding-right: 2.25rem !important;
}
.custom-select-sm {
    background-position: right 0.5rem center;
    background-size: 0.75rem;
    padding-right: 1.5rem !important;
}

/* ════════════════════════════════════════════════════════════════
   ADMIN FORM SYSTEM — scoped to .admin-ui (set on the admin <body>)
   Design-only layer. Unifies every input, textarea and select in the
   admin panel: same height, radius, border, focus ring and behaviour.
   Tailwind utilities always win ties — this layer only fills the gaps,
   so no page's existing markup or logic needs to change.
   ════════════════════════════════════════════════════════════════ */

/* ── A. Named system classes (keep priority over page utilities) ── */
.admin-ui .setting-input, .admin-ui .field, .admin-ui .filter-input,
.admin-ui .form-input, .admin-ui .editor-input, .admin-ui .input-field {
    background-color: #ffffff !important;
    border: 1.5px solid #e5e7eb !important;
    border-radius: 10px !important;
    color: #1f2937 !important;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03) !important;
    transition: border-color .15s ease, box-shadow .15s ease, background-color .15s ease;
}
.admin-ui .setting-input:hover, .admin-ui .field:hover, .admin-ui .filter-input:hover,
.admin-ui .form-input:hover, .admin-ui .editor-input:hover, .admin-ui .input-field:hover {
    border-color: #cbd5e1 !important;
}
.admin-ui .setting-input:focus, .admin-ui .field:focus, .admin-ui .filter-input:focus,
.admin-ui .form-input:focus, .admin-ui .editor-input:focus, .admin-ui .input-field:focus {
    border-color: #8a131b !important;
    box-shadow: 0 0 0 3px rgba(138, 19, 27, 0.12) !important;
    outline: none !important;
}

/* ── B. Baseline for every other control (gaps only — utilities win) ── */
.admin-ui :where(input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=submit]):not([type=button]):not([type=reset]):not([type=file]):not([type=image]), textarea, select) {
    font-family: inherit;
    font-size: 0.875rem;
    line-height: 1.45;
    color: #1f2937;
    background-color: #ffffff;
    border: 1.5px solid #e5e7eb;
    border-radius: 10px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
    transition: border-color .15s ease, box-shadow .15s ease;
    max-width: 100%;
}
.admin-ui :where(input, textarea, select):hover { border-color: #cbd5e1; }
.admin-ui :where(input, textarea, select):focus {
    outline: none;
    border-color: #8a131b;
    box-shadow: 0 0 0 3px rgba(138, 19, 27, 0.12);
}
.admin-ui :where(input:disabled, input[readonly], textarea:disabled, textarea[readonly], select:disabled) {
    background-color: #f9fafb;
    color: #9ca3af;
    cursor: not-allowed;
}
.admin-ui :where(select) { cursor: pointer; }

/* Comfortable size for controls that carry no styling at all */
.admin-ui :where(input:not([class]):not([type=checkbox]):not([type=radio]):not([type=range]):not([type=submit]):not([type=button]):not([type=reset]):not([type=file]):not([type=image]),
textarea:not([class]),
select:not([class])) {
    padding: 0.6rem 0.85rem;
    min-height: 40px;
    width: 100%;
}
/* Compact controls inside tables stay table-sized */
.admin-ui table :where(input, select, textarea) {
    padding-top: 0.3rem;
    padding-bottom: 0.3rem;
    min-height: 30px;
    border-radius: 8px;
    font-size: 0.8125rem;
}

/* ── C. Shared details ───────────────────────────────────────────── */
.admin-ui :where(input, textarea, select)::placeholder { color: #9ca3af; opacity: 1; }
.admin-ui :where(input[type=checkbox], input[type=radio]) { accent-color: #8a131b; cursor: pointer; vertical-align: middle; }
.admin-ui :where(input[type=file]) { color: #6b7280; }
.admin-ui :where(input[type=file])::file-selector-button {
    margin-right: 0.8rem;
    padding: 0.5rem 0.95rem;
    border: 0;
    border-radius: 8px;
    background: rgba(138, 19, 27, 0.10);
    color: #8a131b;
    font-weight: 700;
    font-size: 0.8125rem;
    cursor: pointer;
    transition: background-color .15s ease;
}
.admin-ui :where(input[type=file]):hover::file-selector-button { background: rgba(138, 19, 27, 0.18); }
.admin-ui :where(input, textarea):is(:-webkit-autofill, :-webkit-autofill:hover, :-webkit-autofill:focus) {
    -webkit-box-shadow: 0 0 0 1000px #ffffff inset;
    -webkit-text-fill-color: #1f2937;
    transition: background-color 9999s ease-out;
}
.admin-ui label { color: #374151; font-size: 0.8125rem; font-weight: 600; }
.admin-ui :where(fieldset) { border: 1px solid #f3f4f6; border-radius: 12px; padding: 1rem; }

/* ── D. Mobile / touch friendliness ──────────────────────────────── */
/* 16px kills the iOS auto-zoom that makes mobile form editing painful */
@media (max-width: 640px) {
    .admin-ui :where(input, textarea, select) { font-size: 16px !important; }
    .admin-ui .setting-input, .admin-ui .field, .admin-ui .filter-input,
    .admin-ui .form-input, .admin-ui .editor-input, .admin-ui .input-field {
        font-size: 16px !important;
    }
    .admin-ui :where(input:not([class]), textarea:not([class]), select:not([class])) {
        padding: 0.7rem 0.85rem;
        min-height: 44px;
    }
}

/* ── Admin: Add Product — Content Blocks (left rail) ─────────── */
.block-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.55rem 0.7rem;
    border-radius: 0.75rem;
    border: 1px solid transparent;
    transition: background-color .15s ease, border-color .15s ease, transform .15s ease, box-shadow .15s ease;
}
.block-item:hover {
    background-color: #faf8f6;
    border-color: #f3f4f6;
    transform: translateY(-1px);
    box-shadow: 0 3px 10px -3px rgba(0, 0, 0, 0.07);
}
.block-item:active { transform: translateY(0); }

/* ── Admin: Add Product — Design Template picker ─────────────── */
.template-option { cursor: pointer; }
.template-box {
    transition: border-color .15s ease, box-shadow .15s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}
.template-option:hover .template-box { border-color: #d1d5db; }
.template-option.is-selected .template-box {
    border: 2px solid #ef4444;
    box-shadow: 0 4px 12px -4px rgba(239, 68, 68, 0.25);
}
.check-bubble { transition: opacity .2s ease, transform .2s ease; }

/* ── Admin: Blog editor canvas scrollbar ─────────────────────── */
.custom-scrollbar::-webkit-scrollbar { width: 8px; height: 8px; }
.custom-scrollbar::-webkit-scrollbar-thumb { background: #e5e7eb; border-radius: 99px; }
.custom-scrollbar::-webkit-scrollbar-thumb:hover { background: #d1d5db; }
.custom-scrollbar::-webkit-scrollbar-track { background: transparent; }

/* ── Admin: Products table components ────────────────────────── */
.table-checkbox {
    width: 15px;
    height: 15px;
    border-radius: 4px;
    border: 1.5px solid #d1d5db;
    accent-color: #8a131b;
    cursor: pointer;
}
.table-action-btn {
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    border: 1px solid #f3f4f6;
    background: #ffffff;
    color: #9ca3af;
    font-size: 11px;
    transition: color .15s ease, background-color .15s ease, border-color .15s ease, transform .15s ease, box-shadow .15s ease;
}
.table-action-btn:hover {
    color: #8a131b;
    border-color: #e5e7eb;
    background: #faf8f6;
    transform: translateY(-1px);
    box-shadow: 0 3px 8px -2px rgba(0, 0, 0, 0.08);
}
.table-action-btn.action-danger:hover {
    color: #dc2626 !important;
    background: #fef2f2 !important;
    border-color: #fecaca !important;
}

