/* ============================================
   Filmdag Customer Portal — Premium Design System
   ============================================ */

:root {
    /* Colors */
    --fd-cream: #FDF8F3;
    --fd-white: #ffffff;
    --fd-dark: #1c1917;
    --fd-dark-900: #292524;
    --fd-dark-800: #44403c;
    --fd-muted: #595450;
    --fd-muted-light: #78716c;
    --fd-border: #e7e5e4;
    --fd-border-light: #f5f5f4;
    --fd-accent: #F08A5D;
    --fd-accent-hover: #e67a4d;
    --fd-accent-dark: #C45E32;
    --fd-success: #16a34a;
    --fd-error: #ef4444;
    --fd-error-bg: #fef2f2;
    --fd-success-bg: #f0fdf4;
    --fd-warning-bg: #fff7ed;
    --fd-accent-bg: #fff7ed;

    /* Typography */
    --fd-font: Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --fd-h1: clamp(2rem, 5vw, 3.5rem);
    --fd-h2: clamp(1.375rem, 3vw, 1.75rem);
    --fd-h3: 1.125rem;
    --fd-body: 1rem;
    --fd-small: 0.875rem;
    --fd-xs: 0.75rem;

    /* Spacing */
    --fd-space-xs: 0.25rem;
    --fd-space-sm: 0.5rem;
    --fd-space-md: 1rem;
    --fd-space-lg: 1.5rem;
    --fd-space-xl: 2rem;
    --fd-space-2xl: 2.5rem;
    --fd-space-3xl: 3rem;

    /* Shadows */
    --fd-shadow-sm: 0 2px 8px rgba(28, 25, 23, 0.04);
    --fd-shadow-md: 0 4px 16px rgba(28, 25, 23, 0.06);
    --fd-shadow-lg: 0 8px 32px rgba(28, 25, 23, 0.08);
    --fd-shadow-xl: 0 16px 48px rgba(28, 25, 23, 0.12);

    /* Radius */
    --fd-radius-sm: 8px;
    --fd-radius-md: 12px;
    --fd-radius-lg: 16px;
    --fd-radius-xl: 20px;
    --fd-radius-full: 9999px;

    /* Touch targets */
    --fd-touch-min: 44px;
}

/* Reset & base */
*, *::before, *::after {
    box-sizing: border-box;
}

* {
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--fd-font);
    background: var(--fd-cream);
    color: var(--fd-dark);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    padding-bottom: 72px; /* space for bottom nav on mobile */
}

@media (min-width: 769px) {
    body {
        padding-bottom: 0;
    }
}

img, video {
    max-width: 100%;
    display: block;
}

a {
    color: inherit;
    text-decoration: none;
}

button {
    font-family: inherit;
}

/* Focus visible */
:focus-visible {
    outline: 2px solid var(--fd-accent);
    outline-offset: 2px;
}

/* Header */
.portal-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--fd-border);
}

.header-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 14px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--fd-dark);
    letter-spacing: -0.02em;
}

.desktop-nav {
    display: none;
    gap: 8px;
    align-items: center;
}

.desktop-nav a {
    padding: 8px 14px;
    border-radius: var(--fd-radius-full);
    font-size: var(--fd-small);
    font-weight: 500;
    color: var(--fd-dark-800);
    transition: background 0.2s ease, color 0.2s ease;
    min-height: var(--fd-touch-min);
    display: inline-flex;
    align-items: center;
}

.desktop-nav a:hover,
.desktop-nav a.active {
    background: var(--fd-cream);
    color: var(--fd-accent-dark);
}

@media (min-width: 769px) {
    .desktop-nav {
        display: flex;
    }
    .mobile-menu-toggle {
        display: none;
    }
}

/* Mobile menu toggle */
.mobile-menu-toggle {
    width: var(--fd-touch-min);
    height: var(--fd-touch-min);
    background: transparent;
    border: none;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    border-radius: var(--fd-radius-md);
}

.mobile-menu-toggle span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--fd-dark);
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.mobile-menu-toggle[aria-expanded="true"] span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.mobile-menu-toggle[aria-expanded="true"] span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-toggle[aria-expanded="true"] span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* Mobile menu overlay */
.mobile-menu {
    position: fixed;
    inset: 0;
    z-index: 99;
    background: rgba(253, 248, 243, 0.98);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 16px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0.25s ease;
}

.mobile-menu.active {
    opacity: 1;
    visibility: visible;
}

.mobile-menu a {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--fd-dark);
    padding: 12px 24px;
    border-radius: var(--fd-radius-full);
    transition: background 0.2s ease, color 0.2s ease;
    min-height: var(--fd-touch-min);
    display: inline-flex;
    align-items: center;
}

.mobile-menu a:hover,
.mobile-menu a.active {
    background: var(--fd-cream);
    color: var(--fd-accent-dark);
}

/* Bottom nav (mobile) */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 101;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-top: 1px solid var(--fd-border);
    display: flex;
    justify-content: space-around;
    padding: 8px 0 calc(8px + env(safe-area-inset-bottom));
}

.bottom-nav a {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 6px;
    color: var(--fd-muted);
    font-size: var(--fd-xs);
    font-weight: 500;
    min-height: var(--fd-touch-min);
    transition: color 0.2s ease;
}

.bottom-nav a svg {
    width: 24px;
    height: 24px;
    stroke-width: 2;
}

.bottom-nav a.active,
.bottom-nav a:hover {
    color: var(--fd-accent-dark);
}

.bottom-nav a.active svg {
    stroke: var(--fd-accent-dark);
}

@media (min-width: 769px) {
    .bottom-nav {
        display: none;
    }
}

/* Container */
.fd-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: var(--fd-space-xl) var(--fd-space-lg);
}

@media (max-width: 480px) {
    .fd-container {
        padding: var(--fd-space-lg) var(--fd-space-md);
    }
}

/* Typography */
.fd-h1 {
    font-size: var(--fd-h1);
    font-weight: 800;
    line-height: 1.15;
    letter-spacing: -0.03em;
    margin-bottom: var(--fd-space-sm);
}

.fd-h2 {
    font-size: var(--fd-h2);
    font-weight: 700;
    line-height: 1.25;
    letter-spacing: -0.02em;
    margin-bottom: var(--fd-space-md);
}

.fd-h3 {
    font-size: var(--fd-h3);
    font-weight: 700;
    margin-bottom: var(--fd-space-sm);
}

.fd-text-muted {
    color: var(--fd-muted);
}

.fd-text-small {
    font-size: var(--fd-small);
}

/* Hero */
.fd-hero {
    background: var(--fd-white);
    border-radius: var(--fd-radius-xl);
    padding: var(--fd-space-2xl);
    margin-bottom: var(--fd-space-xl);
    box-shadow: var(--fd-shadow-sm);
}

.fd-hero p {
    color: var(--fd-muted);
    font-size: 1.125rem;
    max-width: 600px;
}

@media (max-width: 480px) {
    .fd-hero {
        padding: var(--fd-space-lg);
    }
    .fd-hero p {
        font-size: var(--fd-body);
    }
}

.fd-quick-stats {
    display: flex;
    gap: var(--fd-space-md);
    margin-top: var(--fd-space-lg);
    flex-wrap: wrap;
}

.fd-quick-stat {
    background: var(--fd-cream);
    padding: 12px 18px;
    border-radius: var(--fd-radius-md);
    font-size: var(--fd-small);
    font-weight: 500;
}

.fd-quick-stat strong {
    color: var(--fd-accent-dark);
}

/* Cards */
.fd-card {
    background: var(--fd-white);
    border-radius: var(--fd-radius-lg);
    overflow: hidden;
    box-shadow: var(--fd-shadow-sm);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    display: flex;
    flex-direction: column;
}

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

.fd-card-media {
    position: relative;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    background: var(--fd-dark-900);
}

.fd-card-media img,
.fd-card-media video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.fd-card:hover .fd-card-media img,
.fd-card:hover .fd-card-media video {
    transform: scale(1.03);
}

.fd-card-media video {
    object-fit: contain;
    background: #000;
    cursor: pointer;
}

.fd-play-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    transition: background 0.2s ease;
}

.fd-card-media:hover .fd-play-overlay,
.fd-card-media:focus-within .fd-play-overlay {
    background: rgba(0, 0, 0, 0.15);
}

.fd-play-overlay svg {
    width: 56px;
    height: 56px;
    color: var(--fd-white);
    background: rgba(0, 0, 0, 0.45);
    border-radius: 50%;
    padding: 14px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
    transition: transform 0.2s ease, background 0.2s ease;
}

.fd-card-media:hover .fd-play-overlay svg,
.fd-card-media:focus-within .fd-play-overlay svg {
    transform: scale(1.08);
    background: rgba(0, 0, 0, 0.6);
}

.fd-card-body {
    padding: var(--fd-space-md);
    flex: 1;
    display: flex;
    flex-direction: column;
}

.fd-card-title {
    font-weight: 700;
    font-size: var(--fd-body);
    margin-bottom: 4px;
}

.fd-card-meta {
    font-size: var(--fd-small);
    color: var(--fd-muted);
    margin-bottom: var(--fd-space-sm);
}

.fd-card-specs {
    font-size: var(--fd-xs);
    color: var(--fd-muted-light);
    margin-top: -4px;
    margin-bottom: var(--fd-space-sm);
}

.fd-card-description-wrap {
    margin-top: -2px;
    margin-bottom: var(--fd-space-sm);
}

.fd-card-description {
    font-size: var(--fd-small);
    color: var(--fd-dark);
    line-height: 1.45;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.fd-card-description.expanded {
    -webkit-line-clamp: unset;
    display: block;
}

.fd-description-toggle {
    background: transparent;
    border: none;
    padding: 4px 0 0;
    margin: 0;
    font-size: var(--fd-xs);
    font-weight: 600;
    color: var(--fd-accent-dark);
    cursor: pointer;
    display: inline-flex;
}

.fd-description-toggle:hover {
    text-decoration: underline;
}

.fd-card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: var(--fd-space-sm);
}

.fd-tag {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    background: var(--fd-border-light);
    border: 1px solid var(--fd-border);
    border-radius: var(--fd-radius-full);
    font-size: var(--fd-xs);
    font-weight: 500;
    color: var(--fd-muted);
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.fd-tag:hover,
.fd-tag.active {
    background: var(--fd-accent);
    border-color: var(--fd-accent);
    color: var(--fd-white);
}

.fd-card-formats {
    font-size: var(--fd-xs);
    color: var(--fd-success);
    margin-top: 2px;
    margin-bottom: var(--fd-space-sm);
}

.fd-card-no-preview {
    height: 100%;
    background: var(--fd-border-light);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--fd-muted);
    font-size: var(--fd-small);
}

.fd-type-section {
    grid-column: 1 / -1;
    margin: var(--fd-space-xl) 0 var(--fd-space-sm);
    padding-bottom: var(--fd-space-sm);
    border-bottom: 2px solid var(--fd-accent);
}

.fd-type-section:first-child { margin-top: 0; }
.fd-type-section-title { font-size: var(--fd-h3); font-weight: 700; color: var(--fd-accent); margin: 0; }

.fd-card-actions {
    padding: 0 var(--fd-space-md) var(--fd-space-md);
    display: flex;
    gap: var(--fd-space-sm);
    margin-top: auto;
}

@media (max-width: 480px) {
    .fd-card-actions {
        flex-direction: column;
    }
}

/* Badges */
.fd-badge {
    display: inline-flex;
    align-items: center;
    background: var(--fd-accent-dark);
    color: var(--fd-white);
    padding: 5px 12px;
    border-radius: var(--fd-radius-full);
    font-size: var(--fd-xs);
    font-weight: 700;
    letter-spacing: 0.02em;
    margin-bottom: 8px;
}

.fd-card-media .fd-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    z-index: 2;
    margin-bottom: 0;
}

.fd-count-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    background: rgba(0, 0, 0, 0.55);
    color: var(--fd-white);
    padding: 4px 10px;
    border-radius: var(--fd-radius-full);
    font-size: var(--fd-xs);
    font-weight: 600;
    z-index: 2;
}

/* Buttons */
.fd-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 16px;
    border: none;
    border-radius: var(--fd-radius-md);
    font-size: var(--fd-small);
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.1s ease, box-shadow 0.2s ease;
    min-height: var(--fd-touch-min);
    text-align: center;
    line-height: 1.4;
}

.fd-btn:active {
    transform: scale(0.98);
}

.fd-btn-primary {
    background: var(--fd-accent);
    color: var(--fd-white);
}

.fd-btn-primary:hover {
    background: var(--fd-accent-hover);
}

.fd-btn-primary:disabled {
    background: #d6d3d1;
    cursor: not-allowed;
}

.fd-btn-secondary {
    background: var(--fd-border-light);
    color: var(--fd-dark-800);
}

.fd-btn-secondary:hover {
    background: var(--fd-border);
}

.fd-btn-secondary.active {
    background: #FEF3C7;
    color: #92400E;
}

.fd-btn-danger {
    background: transparent;
    color: var(--fd-error);
    border: 1px solid #fecaca;
}

.fd-btn-danger:hover {
    background: var(--fd-error-bg);
}

.fd-btn-text {
    background: transparent;
    color: var(--fd-muted-light);
    border: none;
    padding: 0;
    min-height: auto;
    font-weight: 500;
    justify-content: flex-start;
}

.fd-btn-text:hover {
    color: var(--fd-accent-dark);
    text-decoration: underline;
}

.fd-btn-full {
    width: 100%;
}

.fd-btn-lg {
    padding: 14px 20px;
    font-size: var(--fd-body);
}

/* Filters */
.fd-filters {
    display: flex;
    gap: var(--fd-space-sm);
    flex-wrap: wrap;
    margin-bottom: var(--fd-space-lg);
}

@media (max-width: 640px) {
    .fd-filters {
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        padding-bottom: 6px;
    }
    .fd-filters::-webkit-scrollbar {
        display: none;
    }
}

.fd-filter-btn {
    padding: 8px 16px;
    background: var(--fd-white);
    border: 1px solid var(--fd-border);
    border-radius: var(--fd-radius-full);
    font-size: var(--fd-small);
    font-weight: 500;
    cursor: pointer;
    color: var(--fd-dark-800);
    transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
    white-space: nowrap;
    min-height: 36px;
}

.fd-filter-btn:hover,
.fd-filter-btn.active {
    background: var(--fd-accent);
    color: var(--fd-white);
    border-color: var(--fd-accent);
}

.fd-production-filter {
    margin-bottom: var(--fd-space-md);
}

.fd-production-filter select {
    padding: 10px 14px;
    border: 1px solid var(--fd-border);
    border-radius: var(--fd-radius-md);
    font-size: var(--fd-body);
    background: var(--fd-white);
    min-height: var(--fd-touch-min);
}

/* Grids */
.fd-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: var(--fd-space-lg);
}

@media (max-width: 640px) {
    .fd-grid {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
        gap: var(--fd-space-md);
    }
}

@media (max-width: 380px) {
    .fd-grid {
        grid-template-columns: 1fr;
    }
}

/* Carousel */
.fd-carousel {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.fd-carousel img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transition: opacity 0.4s ease;
    cursor: pointer;
}

.fd-carousel img.active {
    opacity: 1;
}

.fd-carousel-nav {
    position: absolute;
    bottom: 12px;
    left: 0;
    right: 0;
    display: flex;
    justify-content: center;
    gap: 8px;
    z-index: 3;
}

.fd-carousel-dot {
    width: 10px;
    height: 10px;
    min-width: 24px;
    min-height: 24px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    border: none;
    position: relative;
}

.fd-carousel-dot::after {
    content: '';
    position: absolute;
    inset: -7px;
    border-radius: 50%;
}

.fd-carousel-dot.active {
    background: var(--fd-white);
}

/* Empty state */
.fd-empty {
    background: var(--fd-white);
    border-radius: var(--fd-radius-lg);
    padding: var(--fd-space-3xl) var(--fd-space-lg);
    text-align: center;
    color: var(--fd-muted);
}

.fd-empty h2 {
    font-size: var(--fd-h3);
    margin-bottom: var(--fd-space-sm);
    color: var(--fd-dark);
}

/* Toast */
.fd-toast {
    position: fixed;
    bottom: 90px;
    left: 50%;
    transform: translateX(-50%) translateY(10px);
    background: var(--fd-dark);
    color: var(--fd-white);
    padding: 12px 20px;
    border-radius: var(--fd-radius-md);
    font-size: var(--fd-small);
    font-weight: 500;
    opacity: 0;
    transition: opacity 0.3s ease, transform 0.3s ease;
    z-index: 1000;
    pointer-events: none;
    max-width: calc(100% - 48px);
    text-align: center;
}

@media (min-width: 769px) {
    .fd-toast {
        bottom: 24px;
        left: auto;
        right: 24px;
        transform: translateY(10px);
    }
}

.fd-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

@media (min-width: 769px) {
    .fd-toast.show {
        transform: translateY(0);
    }
}

/* Modal / Lightbox / Video preview */
.fd-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.92);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2002;
    padding: 20px;
    cursor: zoom-out;
}

.fd-overlay.active {
    display: flex;
}

.fd-overlay img {
    max-width: 90vw;
    max-height: 90vh;
    object-fit: contain;
    cursor: default;
}

.fd-overlay video {
    max-width: 90vw;
    max-height: 90vh;
    cursor: default;
}

.fd-overlay-close {
    position: absolute;
    top: 20px;
    right: 24px;
    width: var(--fd-touch-min);
    height: var(--fd-touch-min);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--fd-white);
    font-size: 2rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    cursor: pointer;
    border: none;
    transition: background 0.2s ease;
}

.fd-overlay-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

.fd-lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.15);
    border: none;
    color: #fff;
    width: var(--fd-touch-min);
    height: var(--fd-touch-min);
    border-radius: 50%;
    font-size: 24px;
    cursor: pointer;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease;
}

.fd-lightbox-nav:hover {
    background: rgba(255, 255, 255, 0.3);
}

.fd-lightbox-prev { left: 16px; }
.fd-lightbox-next { right: 16px; }

.fd-lightbox-counter {
    position: absolute;
    top: 24px;
    left: 50%;
    transform: translateX(-50%);
    color: #fff;
    font-size: var(--fd-small);
    font-weight: 600;
    background: rgba(0, 0, 0, 0.4);
    padding: 6px 12px;
    border-radius: var(--fd-radius-full);
    z-index: 10;
}

/* Force carousel cards to 4:5 portrait ratio */
.fd-card[data-type="carousel"] .fd-card-media {
    aspect-ratio: 4 / 5;
}

/* Prevent mobile long-press / callout / save menus on preview media */
.fd-card-media img,
.fd-card-media video,
.fd-carousel img,
.fd-overlay img,
.fd-overlay video,
.fd-package-preview img,
.fd-package-preview video {
    -webkit-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
}

/* Package modal */
.fd-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2001;
    padding: 20px;
}

.fd-modal-overlay.active {
    display: flex;
}

.fd-modal {
    background: var(--fd-white);
    border-radius: var(--fd-radius-xl);
    width: 100%;
    max-width: 520px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--fd-shadow-xl);
    animation: fd-modal-in 0.25s ease;
}

@keyframes fd-modal-in {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

.fd-modal-header {
    padding: var(--fd-space-lg);
    border-bottom: 1px solid var(--fd-border-light);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.fd-modal-header h3 {
    font-size: var(--fd-h3);
    font-weight: 700;
}

.fd-modal-close {
    width: var(--fd-touch-min);
    height: var(--fd-touch-min);
    background: none;
    border: none;
    font-size: 1.75rem;
    color: var(--fd-muted);
    cursor: pointer;
    border-radius: var(--fd-radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
}

.fd-modal-close:hover {
    background: var(--fd-border-light);
}

.fd-modal-body {
    padding: var(--fd-space-lg);
}

.fd-modal-footer {
    padding: var(--fd-space-md) var(--fd-space-lg);
    border-top: 1px solid var(--fd-border-light);
    display: flex;
    justify-content: flex-end;
}

.fd-welcome-message {
    font-size: var(--fd-body);
    line-height: 1.6;
    color: var(--fd-dark);
    margin-bottom: var(--fd-space-md);
    white-space: pre-wrap;
}

.fd-welcome-hint {
    font-size: var(--fd-small);
    color: var(--fd-muted);
    margin: 0;
    padding: var(--fd-space-md);
    background: var(--fd-border-light);
    border-radius: var(--fd-radius-md);
}

.fd-welcome-hint a {
    color: var(--fd-primary);
    text-decoration: underline;
}

/* Package items list */
.fd-package-items {
    display: grid;
    gap: var(--fd-space-sm);
}

.fd-package-item {
    display: flex;
    align-items: center;
    gap: var(--fd-space-md);
    padding: var(--fd-space-sm);
    background: var(--fd-border-light);
    border-radius: var(--fd-radius-md);
    cursor: pointer;
    transition: background 0.15s ease;
}

.fd-package-item:hover {
    background: var(--fd-border);
}

.fd-package-preview {
    position: relative;
    width: 80px;
    height: 80px;
    flex-shrink: 0;
    border-radius: var(--fd-radius-md);
    overflow: hidden;
    background: var(--fd-dark-900);
}

.fd-package-preview img,
.fd-package-preview video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.fd-package-preview.no-preview {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--fd-border-light);
}

.fd-package-preview-icon {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.25);
    opacity: 0;
    transition: opacity 0.2s ease, background 0.2s ease;
    pointer-events: none;
}

.fd-package-item:hover .fd-package-preview-icon,
.fd-package-item:focus-within .fd-package-preview-icon {
    opacity: 1;
    background: rgba(0, 0, 0, 0.45);
}

.fd-package-preview-icon svg {
    width: 28px;
    height: 28px;
    color: var(--fd-white);
    background: rgba(0, 0, 0, 0.5);
    border-radius: 50%;
    padding: 6px;
}

.fd-package-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.fd-package-title {
    font-size: var(--fd-body);
    color: var(--fd-dark-800);
    font-weight: 500;
}

.fd-package-specs {
    font-size: var(--fd-xs);
    color: var(--fd-muted-light);
}

.fd-package-price .original {
    text-decoration: line-through;
    color: var(--fd-muted);
    font-size: var(--fd-small);
    margin-right: 6px;
}

.fd-package-price .sale {
    font-weight: 700;
    font-size: 1.125rem;
    color: var(--fd-dark);
}

.fd-package-savings {
    color: var(--fd-success);
    font-size: var(--fd-small);
    font-weight: 700;
    margin-top: 4px;
}

/* Cart */
.fd-cart-item {
    display: flex;
    gap: var(--fd-space-md);
    align-items: center;
    padding: var(--fd-space-md) 0;
    border-bottom: 1px solid var(--fd-border-light);
}

.fd-cart-item:last-child {
    border-bottom: none;
}

.fd-cart-thumb {
    width: 96px;
    height: 96px;
    object-fit: cover;
    border-radius: var(--fd-radius-md);
    background: var(--fd-border-light);
    flex-shrink: 0;
}

.fd-cart-thumb video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: var(--fd-radius-md);
}

.fd-cart-details {
    flex: 1;
    min-width: 0;
}

.fd-cart-title {
    font-weight: 700;
    font-size: var(--fd-body);
    margin-bottom: 2px;
    overflow-wrap: break-word;
}

.fd-cart-meta {
    font-size: var(--fd-small);
    color: var(--fd-muted);
    overflow-wrap: break-word;
}

.fd-cart-price {
    font-weight: 700;
    font-size: var(--fd-body);
    white-space: nowrap;
    margin-right: var(--fd-space-md);
    text-align: right;
}

.fd-cart-price-original {
    display: block;
    font-size: var(--fd-small);
    font-weight: 500;
    color: var(--fd-muted);
    text-decoration: line-through;
}

.fd-cart-price-discount {
    display: block;
    font-size: var(--fd-xs);
    font-weight: 600;
    color: var(--fd-success);
}

@media (max-width: 640px) {
    .fd-cart-item {
        display: grid;
        grid-template-columns: 72px 1fr auto;
        grid-template-areas:
            "thumb details details"
            "thumb price remove";
        gap: var(--fd-space-sm);
        align-items: start;
    }
    .fd-cart-thumb {
        grid-area: thumb;
        width: 72px;
        height: 72px;
    }
    .fd-cart-details {
        grid-area: details;
        min-width: 0;
    }
    .fd-cart-price {
        grid-area: price;
        text-align: left;
        margin: 0;
        align-self: center;
        white-space: normal;
    }
    .fd-cart-item > .fd-btn-danger {
        grid-area: remove;
        align-self: center;
    }
}

.fd-summary {
    margin-top: var(--fd-space-xl);
    padding-top: var(--fd-space-xl);
    border-top: 1px solid var(--fd-border);
}

.fd-summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--fd-space-xs);
    font-size: var(--fd-body);
    margin-bottom: var(--fd-space-sm);
}

.fd-summary-row.total {
    font-size: 1.25rem;
    font-weight: 700;
}

/* Addon upsell in cart */
.fd-addon-upsell {
    background: linear-gradient(135deg, #fff7ed 0%, #ffedd5 100%);
    border: 1px solid #fed7aa;
    border-radius: var(--fd-radius-md);
    padding: var(--fd-space-lg);
    margin-bottom: var(--fd-space-lg);
}

.fd-addon-upsell-title {
    font-size: var(--fd-h4);
    font-weight: 700;
    color: #9a3412;
    margin-bottom: var(--fd-space-xs);
}

.fd-addon-upsell-lead {
    font-size: var(--fd-small);
    color: var(--fd-muted);
    margin-bottom: var(--fd-space-md);
    line-height: 1.5;
}

.fd-addon-upsell-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--fd-space-md);
    padding: var(--fd-space-md);
    background: #fff;
    border: 1px solid var(--fd-border-light);
    border-radius: var(--fd-radius-md);
}

.fd-addon-upsell-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.fd-addon-upsell-info strong {
    font-weight: 700;
    color: var(--fd-dark);
}

.fd-addon-upsell-detail {
    font-size: var(--fd-small);
    color: var(--fd-muted);
}

.fd-addon-upsell-price {
    font-size: var(--fd-body);
    font-weight: 700;
    color: var(--fd-accent-dark);
}

@media (max-width: 640px) {
    .fd-addon-upsell-item {
        flex-direction: column;
        align-items: flex-start;
    }
    .fd-addon-upsell-item .fd-btn {
        width: 100%;
        margin-top: var(--fd-space-sm);
    }
}

/* Forms */
.fd-form-group {
    margin-bottom: var(--fd-space-md);
}

.fd-label {
    display: block;
    font-size: var(--fd-small);
    font-weight: 600;
    color: var(--fd-dark-800);
    margin-bottom: 6px;
}

.fd-input,
.fd-select {
    width: 100%;
    padding: 12px 14px;
    border: 1.5px solid var(--fd-border);
    border-radius: var(--fd-radius-md);
    font-size: var(--fd-body);
    min-height: var(--fd-touch-min);
    background: var(--fd-white);
}

.fd-input:focus,
.fd-select:focus {
    outline: none;
    border-color: var(--fd-accent);
    box-shadow: 0 0 0 3px rgba(240, 138, 93, 0.15);
}

/* Account / team cards */
.fd-team-grid {
    display: grid;
    gap: var(--fd-space-md);
}

.fd-team-card {
    background: var(--fd-border-light);
    border-radius: var(--fd-radius-md);
    padding: var(--fd-space-md);
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.fd-team-card strong {
    color: var(--fd-dark);
}

.fd-team-card span {
    font-size: var(--fd-small);
    color: var(--fd-muted);
}

@media (min-width: 641px) {
    .fd-team-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Info box */
.fd-info-box {
    background: var(--fd-warning-bg);
    border-left: 4px solid var(--fd-accent);
    padding: var(--fd-space-md) var(--fd-space-lg);
    border-radius: 0 var(--fd-radius-md) var(--fd-radius-md) 0;
    margin-bottom: var(--fd-space-lg);
    font-size: var(--fd-small);
    color: var(--fd-dark-800);
    line-height: 1.6;
}

.fd-info-box a {
    color: var(--fd-accent-dark);
    font-weight: 600;
    text-decoration: underline;
}

/* Success / cancel pages */
.fd-result-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto var(--fd-space-lg);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.fd-result-icon.success {
    background: var(--fd-success-bg);
    color: var(--fd-success);
}

.fd-result-icon.error {
    background: var(--fd-error-bg);
    color: var(--fd-error);
}

/* Loading state */
.fd-loading {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.fd-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.4);
    border-top-color: var(--fd-white);
    border-radius: 50%;
    animation: fd-spin 0.8s linear infinite;
}

@keyframes fd-spin {
    to { transform: rotate(360deg); }
}

/* Utility */
.fd-sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.fd-text-center {
    text-align: center;
}

.fd-mb-sm { margin-bottom: var(--fd-space-sm); }
.fd-mb-md { margin-bottom: var(--fd-space-md); }
.fd-mb-lg { margin-bottom: var(--fd-space-lg); }
.fd-mt-lg { margin-top: var(--fd-space-lg); }

/* Lightbox format variants */
.fd-lightbox-variants {
    position: absolute;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
    background: rgba(0, 0, 0, 0.6);
    padding: 8px;
    border-radius: var(--fd-radius-md);
    z-index: 10;
}

.fd-lightbox-variant-btn {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.4);
    color: #fff;
    padding: 6px 12px;
    border-radius: var(--fd-radius-sm);
    font-size: var(--fd-xs);
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}

.fd-lightbox-variant-btn:hover,
.fd-lightbox-variant-btn.active {
    background: var(--fd-accent);
    border-color: var(--fd-accent);
    color: #fff;
}


