/*
Plugin: XL Custom Samples — frontend
Version: 3.0  (modern shadcn/tailwind-flavored)
*/

:root {
    --xl-brand: #ff3b00;
    --xl-brand-hover: #e63500;
    --xl-brand-soft: #fff1ec;
    --xl-text: #0f172a;
    --xl-muted: #64748b;
    --xl-border: #e5e7eb;
    --xl-border-strong: #d1d5db;
    --xl-soft: #f8fafc;
    --xl-card: #ffffff;
    --xl-radius-sm: 6px;
    --xl-radius: 8px;
    --xl-radius-lg: 12px;
    --xl-shadow-sm: 0 1px 2px rgba(15,23,42,.06);
    --xl-shadow: 0 4px 12px rgba(15,23,42,.08), 0 1px 3px rgba(15,23,42,.04);
    --xl-shadow-lg: 0 20px 40px rgba(15,23,42,.12), 0 4px 12px rgba(15,23,42,.06);
    --xl-ring: 0 0 0 3px rgba(255,59,0,.18);
    --xl-ease: cubic-bezier(.22,1,.36,1);
}

body.no-scroll { overflow: hidden; }

/* =========================================================
   UNIQUE BUTTON SYSTEM (.xl-cs-btn) — defeats theme overrides
   ========================================================= */
.xl-cs-btn,
a.xl-cs-btn,
button.xl-cs-btn {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px !important;
    height: 44px !important;
    min-height: 44px !important;
    padding: 0 18px !important;
    border-radius: 8px !important;
    border: 1px solid transparent !important;
    background: #fff !important;
    color: var(--xl-text) !important;
    font-family: inherit !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    line-height: 1 !important;
    letter-spacing: 0 !important;
    text-decoration: none !important;
    text-transform: none !important;
    cursor: pointer !important;
    box-shadow: none !important;
    transition: background .15s var(--xl-ease), color .15s, border-color .15s, transform .05s, box-shadow .15s !important;
    -webkit-appearance: none !important;
    appearance: none !important;
}
.xl-cs-btn:hover { box-shadow: var(--xl-shadow-sm) !important; }
.xl-cs-btn:active { transform: translateY(1px) !important; }
.xl-cs-btn:focus-visible { outline: none !important; box-shadow: var(--xl-ring) !important; }

.xl-cs-btn-primary,
a.xl-cs-btn-primary,
button.xl-cs-btn-primary {
    background: var(--xl-brand) !important;
    border-color: var(--xl-brand) !important;
    color: #fff !important;
}
.xl-cs-btn-primary:hover { background: var(--xl-brand-hover) !important; border-color: var(--xl-brand-hover) !important; color: #fff !important; }

.xl-cs-btn-ghost,
a.xl-cs-btn-ghost {
    background: var(--xl-soft) !important;
    border-color: var(--xl-border) !important;
    color: var(--xl-text) !important;
}
.xl-cs-btn-ghost:hover { background: #f1f5f9 !important; border-color: var(--xl-border-strong) !important; color: var(--xl-text) !important; }

.xl-cs-btn-block { width: 100% !important; }

.xl-cs-icon-btn {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 36px !important;
    height: 36px !important;
    border-radius: 999px !important;
    background: transparent !important;
    border: 1px solid transparent !important;
    color: var(--xl-text) !important;
    cursor: pointer !important;
    padding: 0 !important;
    transition: background .15s, color .15s, border-color .15s !important;
}
.xl-cs-icon-btn:hover { background: var(--xl-soft) !important; border-color: var(--xl-border) !important; }
.xl-cs-icon-btn:focus-visible { outline: none; box-shadow: var(--xl-ring); }

.xl-cs-close-btn {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 6px !important;
    min-height: 36px !important;
    padding: 8px 10px !important;
    border-radius: 6px !important;
    background: #fff0ec !important;
    border: 1px solid rgba(255, 59, 0, .12) !important;
    color: #ff3b00 !important;
    cursor: pointer !important;
    font-family: Outfit, system-ui, sans-serif !important;
    font-size: 12px !important;
    font-weight: 900 !important;
    line-height: 1 !important;
    text-transform: uppercase !important;
    transition: background .15s, color .15s, border-color .15s !important;
}

.xl-cs-close-btn:hover {
    background: #ffe4dc !important;
    border-color: rgba(255, 59, 0, .2) !important;
}

.xl-cs-close-btn:focus-visible {
    outline: none;
    box-shadow: var(--xl-ring);
}

.xl-cs-close-btn svg {
    display: block;
    height: 18px;
    width: 18px;
}

/* =========================================================
   OFF-CANVAS DRAWER
   ========================================================= */
#xl-cs-drawer-overlay {
    position: fixed; inset: 0;
    background: var(--xl-drawer-overlay-bg, rgba(17, 24, 39, .58));
    backdrop-filter: blur(var(--xl-drawer-overlay-blur, 8px));
    z-index: var(--xl-drawer-overlay-z, 99990);
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    transition: var(--xl-drawer-overlay-transition, opacity .24s ease, visibility .24s ease);
}
body.xl-cs-drawer-open #xl-cs-drawer-overlay {
    opacity: 1;
    pointer-events: auto;
    visibility: visible;
}

#xl-cs-drawer {
    position: fixed; top: 0; right: 0; bottom: 0;
    width: var(--xl-drawer-width, 450px); max-width: var(--xl-drawer-max-width, 90vw);
    background: var(--xl-drawer-bg, #fff);
    visibility: hidden; opacity: 0;
    transform: translateX(100%);
    box-shadow: var(--xl-drawer-shadow, var(--xl-shadow-lg));
    transition: transform var(--xl-drawer-duration, .32s) var(--xl-drawer-ease, var(--xl-ease)), opacity var(--xl-drawer-overlay-duration, .24s) var(--xl-drawer-ease, var(--xl-ease)), visibility var(--xl-drawer-overlay-duration, .24s), z-index 0s linear var(--xl-drawer-duration, .32s);
    z-index: -1;
    pointer-events: none;
    display: flex; flex-direction: column;
}
#xl-cs-drawer.opened {
    visibility: visible; opacity: 1; transform: translateX(0);
    z-index: var(--xl-drawer-panel-z, 99999);
    pointer-events: auto;
    transition: transform var(--xl-drawer-duration, .32s) var(--xl-drawer-ease, var(--xl-ease)), opacity var(--xl-drawer-overlay-duration, .24s) var(--xl-drawer-ease, var(--xl-ease)), visibility var(--xl-drawer-overlay-duration, .24s), z-index 0s;
}
#xl-cs-drawer .inner { display: flex; flex-direction: column; height: 100%; min-height: 0; }
#xl-cs-drawer .fly-samples-wrap {
    flex: 1; min-height: 0;
    overflow-y: auto;
    background: #fff;
    scrollbar-width: thin;
}
.fly-samples-wrap::-webkit-scrollbar { width: 6px; }
.fly-samples-wrap::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 3px; }
.fly-samples-content { display: flex; flex-direction: column; min-height: 100%; }
.fly-samples-body { flex: 1; }
.fly-samples-body-content { padding: 20px 24px; }

/* Drawer header */
.xl-cs-drawer-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 18px 20px 18px 24px;
    border-bottom: 1px solid var(--xl-border);
    background: #fff;
    position: sticky; top: 0; z-index: 2;
}
.xl-cs-drawer-title-wrap { display: flex; align-items: center; gap: 10px; }
h3.fly-samples-title {
    margin: 0; padding: 0;
    font-family: var(--font-heading, Outfit, system-ui, sans-serif);
    font-size: 21px;
    font-weight: 900;
    line-height: 1.05;
    color: #111;
    letter-spacing: 0;
}
.xl-cs-drawer-count {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 24px; height: 24px; padding: 0 8px;
    background: var(--xl-brand-soft); color: var(--xl-brand);
    border-radius: 999px; font-size: 12px; font-weight: 700;
}

/* Progress bar */
.xl-cs-progress { margin-bottom: 18px; }
.xl-cs-progress-meta {
    display: flex; justify-content: space-between;
    font-size: 12px; color: var(--xl-muted); margin-bottom: 6px;
    font-weight: 500;
}
.xl-cs-progress-meta span:last-child { color: var(--xl-brand); font-weight: 600; }
.xl-cs-progress-bar {
    height: 6px; border-radius: 999px;
    background: var(--xl-soft); overflow: hidden;
}
.xl-cs-progress-fill {
    height: 100%; width: 0%;
    background: linear-gradient(90deg, var(--xl-brand), #ff7a4d);
    border-radius: 999px;
    transition: width .35s var(--xl-ease);
}

/* Drawer sample rows */
.product-samples-list {
    display: flex; flex-direction: column; gap: 10px;
}
.xl-cs-row {
    display: grid; grid-template-columns: 64px 1fr 32px;
    align-items: center; gap: 14px;
    padding: 12px;
    border: 1px solid var(--xl-border);
    border-radius: var(--xl-radius);
    background: #fff;
    transition: border-color .15s, box-shadow .15s, transform .15s;
}
.xl-cs-row:hover {
    border-color: var(--xl-border-strong);
    box-shadow: var(--xl-shadow-sm);
}
.xl-cs-row-img {
    width: 64px; height: 64px;
    border-radius: var(--xl-radius-sm);
    overflow: hidden; background: var(--xl-soft);
    border: 1px solid var(--xl-border);
}
.xl-cs-row-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.xl-cs-row-info { min-width: 0; }
.xl-cs-row-name {
    font-size: 14px; font-weight: 600; color: var(--xl-text);
    margin: 0 0 2px; line-height: 1.3;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.xl-cs-row-detail {
    font-size: 12px; color: var(--xl-muted);
    margin: 0 0 4px; line-height: 1.3;
}
.xl-cs-row-free {
    display: inline-flex; align-items: center;
    font-size: 11px; font-weight: 700;
    color: #047857; background: #ecfdf5;
    padding: 2px 8px; border-radius: 999px;
    text-transform: uppercase; letter-spacing: .04em;
}
.xl-cs-row-x,
.remove-sample-btn.xl-cs-row-x {
    display: inline-flex; align-items: center; justify-content: center;
    width: 32px; height: 32px;
    border-radius: 8px;
    color: var(--xl-muted); background: transparent;
    cursor: pointer; font-size: 18px; font-weight: 400;
    transition: background .15s, color .15s;
}
.xl-cs-row-x:hover { background: #fef2f2; color: #dc2626; }

/* "Meer toevoegen" ghost row */
#go-to-samples-page { margin-top: 16px; }
#go-to-samples-page .xl-cs-btn { width: 100% !important; }

/* Empty state */
.xl-cs-empty {
    text-align: center;
    padding: 24px 8px 8px;
    display: flex; flex-direction: column; align-items: center;
}
.xl-cs-empty-art {
    margin-bottom: 18px;
    display: flex; align-items: center; justify-content: center;
}
.empty-samples-heading {
    font-size: 20px; font-weight: 700;
    color: var(--xl-text); margin: 0 0 6px;
    letter-spacing: -.01em;
}
.empty-samples-text {
    font-size: 14px; color: var(--xl-muted);
    margin: 0 0 20px; line-height: 1.55; max-width: 320px;
}
.return-to-samples { margin: 0; }
.xl-cs-empty-perks {
    list-style: none; padding: 0; margin: 24px 0 0;
    display: flex; flex-direction: column; gap: 8px;
    font-size: 13px; color: var(--xl-muted);
    width: 100%; max-width: 280px;
}
.xl-cs-empty-perks li {
    display: flex; align-items: center; gap: 8px;
    padding: 10px 14px;
    background: var(--xl-soft);
    border: 1px solid var(--xl-border);
    border-radius: var(--xl-radius-sm);
    font-weight: 500;
}
.xl-cs-empty-perks li svg { color: #10b981; flex-shrink: 0; }

/* Drawer footer (form) — flows naturally below sample list */
.fly-samples-footer {
    border-top: 1px solid var(--xl-border);
    background: #fff;
    margin-top: 20px;
}

/* =========================================================
   NATIVE FORM (xl-srf-) — already namespaced
   ========================================================= */
.xl-srf-wrap { padding: 0 !important; background: #fff; }
.xl-srf {
    padding: 22px 24px 24px;
    background: #fff;
}
.xl-srf-title {
    margin: 0 0 18px;
    font-size: 18px; font-weight: 700;
    color: var(--xl-text); letter-spacing: -.01em;
}
.xl-srf-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.xl-srf-field { margin-bottom: 14px; position: relative; }
.xl-srf-field label {
    display: block;
    font-size: 12px; font-weight: 600;
    color: var(--xl-text); margin-bottom: 6px;
}
.xl-srf-field .xl-req { color: var(--xl-brand); margin-left: 2px; }
.xl-srf-field input,
.xl-srf-field select {
    width: 100%; height: 42px;
    padding: 0 14px;
    border: 1px solid var(--xl-border);
    border-radius: 10px;
    background: #fff;
    font-size: 14px; color: var(--xl-text);
    box-sizing: border-box;
    transition: border-color .15s, box-shadow .15s;
    font-family: inherit;
}
.xl-srf-field select {
    appearance: none; -webkit-appearance: none;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'><path fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' d='M1 1l5 5 5-5'/></svg>");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 40px;
}
.xl-srf-field input:focus,
.xl-srf-field select:focus {
    outline: none;
    border-color: var(--xl-brand);
    box-shadow: var(--xl-ring);
}
.xl-srf-field input.xl-srf-invalid,
.xl-srf-field select.xl-srf-invalid { border-color: #ef4444; }
.xl-srf-hp { position: absolute !important; left: -9999px !important; width: 1px !important; height: 1px !important; opacity: 0 !important; pointer-events: none !important; }
.xl-srf-error {
    background: #fef2f2; color: #b91c1c;
    border: 1px solid #fecaca; border-radius: 10px;
    padding: 10px 14px; font-size: 13px;
    margin: 4px 0 12px; line-height: 1.45;
}
.xl-srf-submit {
    position: relative; width: 100%; height: 48px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: #ff3b00; color: #fff;
    border: 0; border-radius: 10px;
    font-size: 15px; font-weight: 700;
    line-height: 1;
    text-align: center;
    cursor: pointer;
    transition: none;
    box-shadow: none;
    transform: none;
}
.xl-srf-submit:hover,
.xl-srf-submit:focus,
.xl-srf-submit:focus-visible,
.xl-srf-submit:active {
    background: #ff3b00;
    color: #fff;
    box-shadow: none;
    outline: none;
    transform: none;
}
.xl-srf-submit[disabled] { opacity: .65; cursor: wait; }
.xl-srf-submit-label { display: block; text-align: center; }
.xl-srf-spinner {
    display: none; width: 18px; height: 18px;
    border: 2.5px solid rgba(255,255,255,.35);
    border-top-color: #fff;
    border-radius: 50%;
    vertical-align: middle;
    animation: xl-srf-spin .7s linear infinite;
}
.xl-srf-submit.is-loading .xl-srf-submit-label { opacity: .7; }
.xl-srf-submit.is-loading .xl-srf-spinner { display: inline-block; }
@keyframes xl-srf-spin { to { transform: rotate(360deg); } }

.xl-srf-success {
    padding: 36px 24px; text-align: center;
}
.xl-srf-success-icon {
    width: 64px; height: 64px; margin: 0 auto 14px;
    border-radius: 50%; background: var(--xl-brand-soft);
    display: flex; align-items: center; justify-content: center;
}
.xl-srf-success h3 {
    margin: 0 0 6px;
    font-size: 20px; font-weight: 700;
    color: var(--xl-text);
}
.xl-srf-success p { margin: 0 0 22px; color: var(--xl-muted); font-size: 14px; line-height: 1.5; }
.xl-srf-success-back {
    display: inline-block; background: var(--xl-text);
    color: #fff !important; text-decoration: none;
    padding: 12px 22px; border-radius: 10px;
    font-weight: 600; transition: background .15s;
}
.xl-srf-success-back:hover { background: #000; }

@media (max-width: 480px) {
    .xl-srf-row { grid-template-columns: 1fr; gap: 0; }
    .xl-srf { padding: 20px 18px; }
}
