/* ===== Variables & Theme ===== */
:root {
    --bg-dark: #0f0f13;
    --bg-card: #1a1a24;
    --bg-surface: #22223a;
    --accent-1: #7c3aed;
    --accent-2: #f472b6;
    --accent-3: #06b6d4;
    --accent-gradient: linear-gradient(135deg, #7c3aed, #f472b6, #06b6d4);
    --text-primary: #f1f1f6;
    --text-secondary: #9ca3af;
    --border-color: #2d2d44;
    --radius: 12px;
    --shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background: var(--bg-dark);
    color: var(--text-primary);
    min-height: 100vh;
}

/* ===== Navbar ===== */
.bg-dark-custom {
    background: rgba(15, 15, 19, 0.95) !important;
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 1030;
}

.navbar-brand {
    font-size: 1.4rem;
    letter-spacing: -0.5px;
}

.text-gradient {
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nav-link {
    color: var(--text-secondary) !important;
    transition: color 0.2s;
    font-weight: 500;
}

.nav-link:hover {
    color: var(--text-primary) !important;
}

/* ===== Hero ===== */
.hero-section {
    padding: 80px 0 60px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(ellipse at 30% 50%, rgba(124, 58, 237, 0.12) 0%, transparent 50%),
                radial-gradient(ellipse at 70% 50%, rgba(244, 114, 182, 0.08) 0%, transparent 50%);
    z-index: 0;
}

.hero-section > * {
    position: relative;
    z-index: 1;
}

.hero-section h1 {
    font-family: 'Poppins', sans-serif;
    font-weight: 800;
    font-size: 3rem;
    line-height: 1.1;
    margin-bottom: 1rem;
}

.hero-section p {
    color: var(--text-secondary);
    font-size: 1.15rem;
    max-width: 600px;
    margin: 0 auto 2rem;
}

/* ===== Buttons ===== */
.btn-gradient {
    background: var(--accent-gradient);
    color: white;
    border: none;
    padding: 12px 32px;
    border-radius: 50px;
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.3s;
    text-decoration: none;
    display: inline-block;
}

.btn-gradient:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(124, 58, 237, 0.4);
    color: white;
}

.btn-outline-light-custom {
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 12px 32px;
    border-radius: 50px;
    font-weight: 500;
    transition: all 0.3s;
    background: transparent;
    text-decoration: none;
    display: inline-block;
}

.btn-outline-light-custom:hover {
    background: var(--bg-surface);
    border-color: var(--accent-1);
    color: white;
}

/* ===== Cards ===== */
.card-custom {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    overflow: hidden;
    transition: all 0.3s;
}

.card-custom:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow);
    border-color: var(--accent-1);
}

.card-custom .card-img-top {
    height: 200px;
    object-fit: cover;
    background: var(--bg-surface);
}

.card-custom .card-body {
    padding: 1.25rem;
}

.card-custom .card-title {
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.card-custom .card-text {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* ===== Template Preview Card ===== */
.template-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    overflow: hidden;
    transition: all 0.3s;
    cursor: pointer;
    position: relative;
}

.template-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 32px rgba(124, 58, 237, 0.25);
    border-color: var(--accent-1);
}

.template-card .preview {
    aspect-ratio: 1;
    background: var(--bg-surface);
    overflow: hidden;
    position: relative;
}

/* Fabric.js inserts a .canvas-container wrapper — make it fill the preview */
.template-card .preview .canvas-container {
    width: 100% !important;
    height: 100% !important;
    position: absolute !important;
    top: 0; left: 0;
}

.template-card .preview canvas,
.template-card .preview img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover;
    display: block;
}

.template-card .info {
    padding: 12px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.template-card .info .name {
    font-weight: 600;
    font-size: 0.95rem;
}

.template-card .actions {
    display: flex;
    gap: 4px;
}

.template-card .actions .btn {
    padding: 4px 8px;
    font-size: 0.8rem;
    border-radius: 6px;
}

.badge-predefined {
    background: var(--accent-gradient);
    font-size: 0.7rem;
    padding: 3px 8px;
    border-radius: 20px;
    font-weight: 600;
}

/* ===== Editor Layout ===== */
.editor-container {
    display: grid;
    grid-template-columns: 280px 1fr 280px;
    height: calc(100vh - 56px);
    overflow: hidden;
}

.editor-sidebar {
    background: var(--bg-card);
    border-right: 1px solid var(--border-color);
    padding: 16px;
    overflow-y: auto;
}

.editor-sidebar-right {
    background: var(--bg-card);
    border-left: 1px solid var(--border-color);
    padding: 16px;
    overflow-y: auto;
}

.editor-canvas-area {
    display: flex;
    flex-direction: column;
    background: #0a0a0f;
    overflow: hidden;
}

/* ===== Format Tabs (Editor) ===== */
.format-tabs-bar {
    display: flex;
    gap: 8px;
    padding: 12px 24px;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border-color);
    flex-shrink: 0;
    overflow-x: auto;
}

.format-tab {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: var(--bg-surface);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.format-tab:hover {
    border-color: var(--accent-1);
    color: var(--text-primary);
}

.format-tab.active {
    border-color: var(--accent-1);
    background: rgba(124, 58, 237, 0.15);
    color: var(--text-primary);
}

.format-tab small {
    color: var(--text-secondary);
    font-weight: 400;
    font-size: 0.75rem;
}

.canvas-scroll-area {
    flex: 1;
    display: flex;
    /* When canvas is tall (9:16), align to start so top content can be scrolled into view */
    align-items: flex-start;
    justify-content: center;
    overflow: auto;
    /* provide extra vertical padding so elements near the top/bottom aren't flush */
    padding: 48px 24px;
}

/* ===== Background Image Upload ===== */
.bg-upload-btn {
    position: relative;
    overflow: hidden;
}

.bg-upload-btn input[type="file"] {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.bg-image-preview {
    width: 100%;
    height: 50px;
    background: var(--bg-surface);
    border: 1px dashed var(--border-color);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    font-size: 0.75rem;
    margin-bottom: 8px;
    overflow: hidden;
}

.bg-image-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 8px;
}

.canvas-wrapper {
    background: white;
    box-shadow: 0 0 60px rgba(124, 58, 237, 0.15);
    border-radius: 4px;
}

/* ===== Sidebar Sections ===== */
.sidebar-section {
    margin-bottom: 20px;
}

.sidebar-section h6 {
    font-weight: 700;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.tool-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 10px 14px;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    margin-bottom: 6px;
}

.tool-btn:hover {
    background: var(--accent-1);
    border-color: var(--accent-1);
}

.tool-btn i {
    font-size: 1.1rem;
}

/* ===== Property Panel ===== */
.prop-group {
    margin-bottom: 16px;
}

.prop-group label {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.prop-group input,
.prop-group select {
    width: 100%;
    padding: 8px 12px;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 0.9rem;
}

.prop-group input:focus,
.prop-group select:focus {
    outline: none;
    border-color: var(--accent-1);
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.2);
}

.prop-group input[type="color"] {
    height: 36px;
    padding: 4px;
    cursor: pointer;
}

.prop-group input[type="range"] {
    height: 6px;
    background: var(--bg-surface);
    border-radius: 3px;
    border: none;
    padding: 0;
}

.prop-group input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    background: var(--accent-1);
    border-radius: 50%;
    cursor: pointer;
}

/* ===== Generate Page ===== */
.generate-container {
    max-width: 1320px;
    margin: 0 auto;
    padding: 40px 20px;
}

.generate-hero {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 24px;
}

.generate-eyebrow,
.generate-section-label {
    margin: 0 0 8px;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-size: 0.72rem;
    color: var(--text-secondary);
}

.generate-hero h2 {
    margin: 0 0 8px;
}

.generate-subtitle {
    max-width: 720px;
    margin: 0;
    color: var(--text-secondary);
}

.generate-edit-link {
    white-space: nowrap;
}

.generate-toolbar,
.generate-preview-panel,
.generate-list-panel {
    border: 1px solid var(--border-color);
}

.generate-toolbar {
    padding: 20px;
    margin-bottom: 24px;
}

.generate-toolbar-help {
    margin: 12px 0 0;
    color: var(--text-secondary);
    font-size: 0.95rem;
}

/* ===== Default format selector ===== */
.generate-default-format {
    border: 1px solid var(--border-color);
    padding: 10px 14px;
    margin-bottom: 24px;
}

.generate-default-format-header {
    margin-bottom: 8px;
}

.generate-default-format-header .generate-section-label {
    margin-bottom: 2px;
}

.generate-default-format-help {
    margin: 0;
    color: var(--text-secondary);
    font-size: 0.78rem;
}

.generate-default-format-options {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
}

.format-default-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    padding: 8px 6px;
    border-radius: 10px;
    border: 2px solid var(--border-color);
    background: var(--bg-card);
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
}

.format-default-btn:hover {
    border-color: rgba(124, 58, 237, 0.45);
    background: rgba(124, 58, 237, 0.07);
}

.format-default-btn.active {
    border-color: var(--accent-1);
    background: rgba(124, 58, 237, 0.12);
}

.format-default-btn.active .format-default-ratio {
    color: #c4b5fd;
}

.format-default-visual {
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.format-default-shape {
    border-radius: 3px;
    border: 2px solid var(--text-secondary);
    background: rgba(255, 255, 255, 0.06);
    transition: border-color 0.2s ease, background 0.2s ease;
}

.format-default-btn.active .format-default-shape {
    border-color: #a78bfa;
    background: rgba(124, 58, 237, 0.2);
}

.format-default-btn:hover .format-default-shape {
    border-color: #a78bfa;
}

/* Proporciones visuales escaladas a max 22px en el eje mayor */
.ratio-1-1   { width: 20px; height: 20px; }
.ratio-191-1 { width: 22px; height: 12px; }
.ratio-4-5   { width: 18px; height: 22px; }
.ratio-9-16  { width: 13px; height: 22px; }

.format-default-ratio {
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--text-secondary);
    line-height: 1;
}

.format-default-name {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.2;
}

.format-default-dims {
    font-size: 0.65rem;
    color: var(--text-secondary);
    line-height: 1;
}

@media (max-width: 600px) {
    .generate-default-format-options {
        grid-template-columns: repeat(2, 1fr);
    }
}

.generate-list-shell {
    position: relative;
}

.generate-preview-panel,
.generate-list-panel {
    padding: 24px;
}

.generate-list-panel {
    min-height: 360px;
}

.generate-preview-header,
.generate-list-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 20px;
}

.generate-preview-header h5,
.generate-list-header h5 {
    margin: 0 0 6px;
}

.generate-preview-meta,
.generate-list-meta {
    margin: 0;
    color: var(--text-secondary);
}

.generate-preview-actions,
.generate-bulk-actions,
.generate-bulk-downloads,
.generated-item-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.generate-preview-controls {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.generate-preview-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    min-width: 44px;
    height: 44px;
    padding: 0;
}

.generate-preview-drawer {
    position: fixed;
    top: 0;
    right: 0;
    width: min(720px, 100vw);
    height: 100vh;
    padding: 24px;
    background: rgba(8, 8, 12, 0.74);
    backdrop-filter: blur(18px);
    transform: translateX(100%);
    transition: transform 0.28s ease;
    z-index: 1200;
    overflow-y: auto;
}

.generate-preview-drawer.is-open {
    transform: translateX(0);
}

.generate-preview-drawer .generate-preview-panel {
    min-height: calc(100vh - 48px);
}

.generate-preview-card {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.generate-preview-details {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.generate-preview-pill {
    display: inline-flex;
    align-items: center;
    padding: 8px 12px;
    border-radius: 999px;
    border: 1px solid var(--border-color);
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-secondary);
    font-size: 0.86rem;
}

.generate-canvas-shell {
    padding: 14px;
    border-radius: 24px;
    background: radial-gradient(circle at top, rgba(124, 58, 237, 0.18), rgba(15, 15, 19, 0.8));
    box-shadow: 0 0 60px rgba(124, 58, 237, 0.15);
}

.url-input-group {
    display: flex;
    gap: 12px;
    margin-bottom: 32px;
}

.url-input-group input {
    flex: 1;
    padding: 14px 20px;
    background: var(--bg-card);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    color: var(--text-primary);
    font-size: 1rem;
    transition: border-color 0.2s;
}

.url-input-group input:focus {
    outline: none;
    border-color: var(--accent-1);
}

.url-input-group input::placeholder {
    color: var(--text-secondary);
}

.format-selector {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 0;
}

.format-option {
    flex: 1;
    padding: 12px;
    background: var(--bg-card);
    border: 2px solid var(--border-color);
    border-radius: 10px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
}

.format-option:hover,
.format-option.active {
    border-color: var(--accent-1);
    background: rgba(124, 58, 237, 0.1);
}

.format-option .ratio {
    font-weight: 700;
    font-size: 1.1rem;
}

.format-option .dims {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.generate-bulk-downloads {
    margin-bottom: 18px;
}

.generated-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.generated-empty-state {
    min-height: 220px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 14px;
    color: var(--text-secondary);
    text-align: center;
    border: 1px dashed var(--border-color);
    border-radius: 18px;
    padding: 24px;
}

.generated-empty-state i {
    font-size: 2rem;
    color: var(--accent-1);
}

.generated-item {
    display: grid;
    grid-template-columns: auto 88px minmax(0, 1fr) auto;
    grid-template-areas:
        "check thumb body actions"
        "affiliate affiliate affiliate affiliate";
    align-items: center;
    gap: 14px;
    padding: 14px;
    border-radius: 18px;
    border: 1px solid var(--border-color);
    background: rgba(255, 255, 255, 0.02);
    transition: border-color 0.2s ease, transform 0.2s ease, background 0.2s ease;
}

.generated-item.is-active {
    border-color: var(--accent-1);
    background: rgba(124, 58, 237, 0.08);
}

.generated-item:hover {
    transform: translateY(-1px);
    border-color: rgba(124, 58, 237, 0.45);
}

.generated-item-select input {
    width: 18px;
    height: 18px;
}

.generated-item-select {
    grid-area: check;
}

.generated-item-thumb-wrap {
    grid-area: thumb;
    width: 88px;
    height: 88px;
    border-radius: 14px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.04);
    display: flex;
    align-items: center;
    justify-content: center;
}

.generated-item-thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.generated-item-thumb-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px;
    text-align: center;
    font-size: 0.82rem;
    color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.04);
}

.generated-item-body {
    grid-area: body;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.generated-item-body strong,
.generated-item-body span,
.generated-item-body small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.generated-item-body span,
.generated-item-body small {
    color: var(--text-secondary);
}

.generated-item-format {
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    gap: 6px;
    min-width: 92px;
    color: var(--text-secondary);
    font-size: 0.78rem;
}

.generated-item-actions {
    grid-area: actions;
    justify-content: flex-end;
}

.generated-item-format span {
    margin: 0;
    line-height: 1;
}

.generated-item-format select {
    height: 40px;
    padding: 8px 10px;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    color: var(--text-primary);
}

.generated-item-delete {
    color: #ff8f8f;
    border-color: rgba(255, 143, 143, 0.35);
}

.generated-item-download,
.generated-item-delete {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    min-width: 40px;
    height: 40px;
    padding: 0;
}

.generated-item-download {
    color: var(--text-primary);
}

.generated-item-download:hover {
    background: rgba(124, 58, 237, 0.12);
    border-color: rgba(124, 58, 237, 0.45);
}

.generated-item-delete:hover {
    color: #ffd6d6;
    border-color: rgba(255, 143, 143, 0.6);
    background: rgba(190, 24, 93, 0.12);
}

.generated-item-affiliate {
    grid-area: affiliate;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    margin-top: 4px;
    padding: 8px 10px;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    background: rgba(255, 255, 255, 0.03);
}

.generated-item-affiliate strong {
    font-size: 0.83rem;
    color: #d7d8ff;
}

.generated-item-affiliate-input {
    width: 100%;
    min-width: 0;
    height: 34px;
    padding: 6px 10px;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    color: var(--text-primary);
    font-size: 0.82rem;
    outline: none;
}

.generated-item-affiliate-input:focus {
    border-color: var(--accent-1);
    box-shadow: 0 0 0 2px rgba(124, 58, 237, 0.2);
}

.generated-item-affiliate-copy {
    min-width: 78px;
}

.generated-item-affiliate-copy.is-copied {
    color: #42d392;
    border-color: rgba(66, 211, 146, 0.55);
    background: rgba(66, 211, 146, 0.12);
}

.generated-item-affiliate-copy.is-copied i {
    color: #42d392;
}

.generated-item-affiliate.is-warning {
    border-color: rgba(250, 204, 21, 0.35);
    background: rgba(250, 204, 21, 0.12);
}

.generated-item-affiliate-warning {
    color: #ffe8a3;
    font-size: 0.82rem;
}

/* ===== Pagination ===== */
.generated-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
    flex-wrap: wrap;
}

.pagination-btn {
    min-width: 40px;
    height: 40px;
    padding: 8px 10px;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    color: var(--text-primary);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pagination-btn:hover:not(:disabled) {
    border-color: rgba(124, 58, 237, 0.45);
    background: rgba(124, 58, 237, 0.1);
    color: var(--text-primary);
}

.pagination-btn.active {
    border-color: var(--accent-1);
    background: var(--accent-1);
    color: white;
}

.pagination-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ===== History page ===== */
.history-page {
    max-width: 1240px;
}

.history-filters {
    padding: 18px;
    border: 1px solid var(--border-color);
    margin-bottom: 20px;
}

.history-filters-form {
    display: grid;
    grid-template-columns: 220px minmax(220px, 1fr) auto;
    gap: 12px;
    align-items: end;
}

.history-filter-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.history-filter-field label {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.history-filter-field input,
.history-filter-field select {
    height: 42px;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 10px 12px;
    background: var(--bg-card);
    color: var(--text-primary);
    font-size: 0.9rem;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.history-filter-field input:focus,
.history-filter-field select:focus {
    border-color: var(--accent-primary, #a855f7);
    box-shadow: 0 0 0 3px rgba(168, 85, 247, 0.18);
}

.history-filter-field input[type="date"] {
    cursor: pointer;
    color-scheme: dark;
}

.history-filter-field input[type="date"]::-webkit-calendar-picker-indicator {
    filter: invert(0.7) sepia(1) saturate(3) hue-rotate(240deg);
    cursor: pointer;
    opacity: 0.8;
}

.history-filter-field input[type="date"]::-webkit-calendar-picker-indicator:hover {
    opacity: 1;
}

.history-filter-actions {
    display: flex;
    gap: 10px;
}

.history-group {
    border: 1px solid var(--border-color);
    padding: 20px;
    margin-bottom: 18px;
}

.history-group-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
}

.history-group-header h5 {
    margin: 0;
}

.history-group-header span {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.history-group-meta {
    display: flex;
    align-items: center;
    gap: 10px;
}

.history-download-date-btn {
    white-space: nowrap;
}

.history-items {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.history-item {
    grid-template-columns: 88px minmax(0, 1fr) auto;
    grid-template-areas: "thumb body actions";
}

.history-item-actions {
    justify-content: flex-end;
}

.history-preview-image-wrap {
    border: 1px solid var(--border-color);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.03);
    padding: 16px;
    display: flex;
    justify-content: center;
}

.history-preview-image {
    max-width: 100%;
    max-height: 72vh;
    border-radius: 14px;
}

@media (max-width: 1100px) {
    .generate-preview-grid {
        grid-template-columns: 1fr;
    }

    .history-filters-form {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .generate-container {
        padding: 28px 14px;
    }

    .generate-hero,
    .generate-preview-header,
    .generate-list-header,
    .url-input-group,
    .generated-item {
        grid-template-columns: 1fr;
        flex-direction: column;
        align-items: stretch;
    }

    .generate-edit-link,
    .generate-preview-actions button,
    .generate-bulk-actions button,
    .generate-bulk-downloads button,
    .generated-item-actions button,
    .url-input-group button {
        width: 100%;
    }

    .generated-item {
        grid-template-columns: 1fr;
        grid-template-areas:
            "check"
            "thumb"
            "body"
            "actions"
            "affiliate";
        justify-items: start;
    }

    .history-item {
        grid-template-areas:
            "thumb"
            "body"
            "actions";
    }

    .generated-item-affiliate {
        grid-column: 1 / -1;
        grid-template-columns: 1fr;
        align-items: start;
    }

    .generated-item-affiliate-copy {
        width: 100%;
    }

    .history-group-header {
        align-items: flex-start;
        gap: 10px;
        flex-direction: column;
    }

    .history-group-meta {
        width: 100%;
        justify-content: space-between;
    }

        .generate-preview-drawer {
            width: 100vw;
            padding: 12px;
        }

        .generate-preview-drawer .generate-preview-panel {
            min-height: calc(100vh - 24px);
        }

    .generated-item-thumb-wrap {
        width: 100%;
        height: 140px;
    }
}

/* ===== Loading Spinner ===== */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 15, 19, 0.9);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    gap: 16px;
}

.spinner-glow {
    width: 48px;
    height: 48px;
    border: 3px solid var(--border-color);
    border-top-color: var(--accent-1);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* ===== Affiliate page ===== */
.aff-page { max-width: 780px; margin: 0 auto; padding: 3rem 1rem 5rem; }

.aff-hero { text-align: center; margin-bottom: 3rem; }
.aff-hero h1 {
    font-family: 'Poppins', sans-serif;
    font-size: 2.2rem;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: .5rem;
}
.aff-hero p {
    color: var(--text-secondary);
    font-size: 1rem;
    max-width: 520px;
    margin: 0 auto;
    line-height: 1.65;
}

.how-strip { display: flex; gap: 1rem; margin-bottom: 3rem; flex-wrap: wrap; }
.how-step {
    flex: 1;
    min-width: 160px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 1.25rem 1rem;
    text-align: center;
}
.how-step-num {
    width: 32px; height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-1), var(--accent-2));
    color: white;
    font-weight: 700;
    font-size: .85rem;
    display: flex; align-items: center; justify-content: center;
    margin: 0 auto .75rem;
}
.how-step p { color: var(--text-secondary); font-size: .82rem; line-height: 1.5; margin: 0; }
.how-step strong { color: var(--text-primary); }
.how-arrow {
    display: flex; align-items: center; justify-content: center;
    color: var(--text-secondary);
    font-size: 1.1rem;
    padding-top: 1rem;
    flex-shrink: 0;
}

.store-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    overflow: hidden;
    margin-bottom: 1.75rem;
}
.store-card-header {
    padding: 1.5rem 1.75rem 1.25rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 1.25rem;
}
.store-logo-wrap {
    width: 130px; height: 56px;
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
}
.store-logo-wrap img { width: 100%; height: 100%; object-fit: contain; }
.store-card-header-text h4 {
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--text-primary);
    margin: 0 0 .2rem;
}
.store-card-header-text span { font-size: .82rem; color: var(--text-secondary); }
.store-card-body { padding: 1.5rem 1.75rem; }

.mini-steps { margin-bottom: 1.25rem; }
.mini-step { display: flex; gap: .85rem; align-items: flex-start; margin-bottom: .85rem; }
.mini-step-num {
    width: 24px; height: 24px;
    border-radius: 50%;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-size: .75rem;
    font-weight: 700;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
    margin-top: .1rem;
}
.mini-step-text { font-size: .875rem; color: var(--text-secondary); line-height: 1.55; }
.mini-step-text strong { color: var(--text-primary); }

.example-pair { margin-bottom: 1.25rem; }
.example-block {
    background: var(--bg-dark);
    border-radius: 8px;
    padding: .65rem 1rem;
    margin-bottom: .5rem;
    border-left: 3px solid var(--border-color);
}
.example-block.is-result { border-left-color: #7c3aed; }
.example-block .ex-label {
    font-size: .68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    margin-bottom: .3rem;
    color: var(--text-secondary);
}
.example-block.is-result .ex-label { color: #a78bfa; }
.example-block code {
    font-size: .8rem;
    color: #e2e8f0;
    background: none;
    padding: 0;
    word-break: break-all;
    line-height: 1.5;
}
.example-block.is-result code { color: #c4b5fd; }

.aff-field-wrap { margin-top: 1.1rem; }
.aff-field-label {
    display: flex;
    align-items: center;
    gap: .5rem;
    font-weight: 600;
    color: var(--text-primary);
    font-size: .9rem;
    margin-bottom: .45rem;
}
.aff-field-label i { color: var(--accent-1); }
.aff-input {
    width: 100%;
    background: rgba(124, 58, 237, 0.07);
    border: 1.5px dashed rgba(124, 58, 237, 0.45);
    border-radius: 8px;
    color: var(--text-primary);
    padding: .65rem 1rem;
    font-size: .875rem;
    font-family: 'Roboto Mono', 'Courier New', monospace;
    transition: border-color .2s, box-shadow .2s, background .2s;
    outline: none;
}
.aff-input::placeholder { color: #a78bfa; opacity: .6; }
.aff-input:focus {
    background: rgba(124, 58, 237, 0.13);
    border-style: solid;
    border-color: var(--accent-1);
    box-shadow: 0 0 0 3px rgba(124,58,237,.22);
}
.aff-input--set {
    background: rgba(16, 185, 129, 0.07);
    border-color: rgba(16, 185, 129, 0.45);
    border-style: solid;
}
.aff-input--set:focus {
    background: rgba(16, 185, 129, 0.12);
    border-color: #10b981;
    box-shadow: 0 0 0 3px rgba(16,185,129,.18);
}

.aff-configured-badge {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    font-size: .72rem;
    font-weight: 600;
    color: #34d399;
    background: rgba(16,185,129,.12);
    border: 1px solid rgba(16,185,129,.3);
    border-radius: 50px;
    padding: 2px 9px;
    margin-left: .5rem;
    vertical-align: middle;
    letter-spacing: .02em;
}
.aff-configured-badge i { font-size: .78rem; }

.aff-hint {
    font-size: .78rem;
    color: var(--text-secondary);
    margin-top: .4rem;
    display: flex;
    align-items: center;
    gap: .35rem;
}
.aff-hint--ok {
    color: #34d399;
}
.aff-hint--ok i { color: #34d399; }

.aff-actions { display: flex; gap: 1rem; margin-top: 2rem; flex-wrap: wrap; }
.btn-cancel {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    border-radius: 50px;
    padding: 10px 24px;
    font-weight: 500;
    text-decoration: none;
    transition: border-color .2s, color .2s;
}
.btn-cancel:hover { border-color: var(--text-secondary); color: var(--text-primary); }

.aff-info {
    background: rgba(6,182,212,.06);
    border: 1px solid rgba(6,182,212,.18);
    border-radius: var(--radius);
    padding: 1.4rem 1.6rem;
    margin-top: 2.5rem;
}
.aff-info h6 { color: #67e8f9; font-weight: 700; margin-bottom: .7rem; font-size: .95rem; }
.aff-info ul { padding-left: 1.1rem; margin: 0; }
.aff-info li { color: var(--text-secondary); font-size: .875rem; line-height: 1.6; margin-bottom: .4rem; }
.aff-info li:last-child { margin-bottom: 0; }

@media (max-width: 576px) {
    .how-arrow { display: none; }
    .store-card-header { flex-direction: column; align-items: flex-start; gap: .75rem; }
}

/* ===== Footer ===== */
.footer-custom {
    background: var(--bg-card);
    border-top: 1px solid var(--border-color);
}

/* ===== Responsive ===== */
@media (max-width: 992px) {
    .editor-container {
        grid-template-columns: 1fr;
        height: auto;
    }
    .editor-sidebar,
    .editor-sidebar-right {
        border: none;
        border-bottom: 1px solid var(--border-color);
    }
    .hero-section h1 {
        font-size: 2rem;
    }
}

/* ===== Scrollbar ===== */
::-webkit-scrollbar {
    width: 6px;
}
::-webkit-scrollbar-track {
    background: var(--bg-dark);
}
::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--accent-1);
}

/* ===== Landing Page ===== */
.landing-hero {
    min-height: 92vh;
    display: flex;
    align-items: center;
    padding: 80px 0 60px;
    position: relative;
    overflow: hidden;
}

.landing-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse at 20% 40%, rgba(124, 58, 237, 0.18) 0%, transparent 55%),
        radial-gradient(ellipse at 80% 60%, rgba(244, 114, 182, 0.12) 0%, transparent 50%),
        radial-gradient(ellipse at 55% 10%, rgba(6, 182, 212, 0.08) 0%, transparent 45%);
    z-index: 0;
    pointer-events: none;
}

.landing-hero > .container { position: relative; z-index: 1; }

.landing-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(124, 58, 237, 0.15);
    border: 1px solid rgba(124, 58, 237, 0.4);
    color: #c4b5fd;
    padding: 6px 18px;
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.3px;
    margin-bottom: 1.5rem;
}

.landing-title {
    font-family: 'Poppins', sans-serif;
    font-weight: 800;
    font-size: clamp(2.4rem, 5vw, 3.8rem);
    line-height: 1.1;
    margin-bottom: 1.5rem;
}

.landing-subtitle {
    color: var(--text-secondary);
    font-size: 1.2rem;
    max-width: 560px;
    margin-bottom: 2.5rem;
    line-height: 1.65;
}

/* ===== Hero layout ===== */
.hero-visual {
    display: flex;
    align-items: center;
    gap: 22px;
    justify-content: flex-start;
    margin-left: 200px;
}

/* ===== Banner cards cluster ===== */
.banner-cards-cluster {
    position: relative;
    width: 410px;
    height: 700px;
    flex-shrink: 0;
}

.banner-card {
    position: absolute;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 12px 40px rgba(0,0,0,.55), 0 0 0 1px rgba(255,255,255,.06);
    transition: transform .3s ease, box-shadow .3s ease, z-index 0s;
}

.banner-card:hover {
    transform: translateY(-5px) scale(1.02) !important;
    box-shadow: 0 22px 60px rgba(0,0,0,.7);
    z-index: 20 !important;
}

.bc-inner { width: 100%; height: 100%; display: flex; flex-direction: column; }

/* Card 1 — 1:1 top-right */
.bc-sq1 { width: 290px; height: 290px; top: 0; right: 0; transform: rotate(5deg); z-index: 3; }
/* Card 2 — 1:1 middle-left */
.bc-sq2 { width: 275px; height: 275px; top: 235px; left: 0; transform: rotate(-6deg); z-index: 2; }
/* Card 3 — 4:5 bottom-right */
.bc-45  { width: 240px; height: 300px; bottom: 0; right: 20px; transform: rotate(2deg); z-index: 1; }

/* ===== iPhone 17 Pro Max frame ===== */
@keyframes floatMockup {
    0%, 100% { transform: perspective(1200px) rotateY(-8deg) rotateX(3deg) translateY(0); }
    50%       { transform: perspective(1200px) rotateY(-8deg) rotateX(3deg) translateY(-10px); }
}

@keyframes gradientShift {
    0%   { background-position: 0% 50%; }
    50%  { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.animated-gradient {
    background: linear-gradient(135deg, #7c3aed, #f472b6, #06b6d4, #7c3aed);
    background-size: 300% 300%;
    animation: gradientShift 5s ease infinite;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-mockup {
    position: relative;
    width: 248px;
    aspect-ratio: 393/852;
    border-radius: 44px;
    padding: 4px;
    background: linear-gradient(160deg,
        #b8b8c0 0%, #9a9aa8 8%, #d4d4dc 18%,
        #7c7c88 28%, #c8c8d0 40%,
        #a4a4b0 55%, #d8d8e0 68%,
        #8c8c98 78%, #bcbcc8 88%, #a0a0ac 100%);
    box-shadow:
        0 0 0 1px rgba(180,180,200,.4),
        0 40px 100px rgba(0,0,0,.7),
        0 20px 50px rgba(0,0,0,.5),
        inset 0 1px 0 rgba(255,255,255,.25);
    flex-shrink: 0;
    overflow: visible !important;
    border: none !important;
    animation: floatMockup 5s ease-in-out infinite;
}

.hero-mockup:hover {
    animation: none;
}

/* Side buttons */
.iphone-btn { position: absolute; background: linear-gradient(90deg,#8a8a96,#b4b4c0,#8a8a96); border-radius: 3px; }
.action-btn   { width: 3px; height: 28px; left: -3px; top: 95px;  border-radius: 3px 0 0 3px; }
.vol-up-btn   { width: 3px; height: 40px; left: -3px; top: 140px; border-radius: 3px 0 0 3px; }
.vol-down-btn { width: 3px; height: 40px; left: -3px; top: 192px; border-radius: 3px 0 0 3px; }
.power-btn    { width: 3px; height: 60px; right: -3px; top: 150px; border-radius: 0 3px 3px 0; }

/* iPhone screen */
.iphone-screen {
    position: relative;
    width: 100%;
    height: 100%;
    border-radius:40px;
    overflow: hidden;
    background: #000;
}

/* ===== iPhone internal overlays ===== */
.iphone-topbar {
    position: absolute; top: 0; left: 0; right: 0; z-index: 11;
    height: 38px; display: flex; align-items: center; justify-content: center;
    background: linear-gradient(to bottom, rgba(0,0,0,.55) 0%, transparent 100%);
    pointer-events: none;
}
.dynamic-island {
    width: 30%; height: 24px;
    background: #0a0a0a;
    border-radius: 18px;
    box-shadow: 0 0 0 1px #1a1a1c;
}
.iphone-statusbar {
    position: absolute; top: 0; left: 0; right: 0; z-index: 9;
    height: 38px; padding: 0 14px;
    display: flex; align-items: center; justify-content: space-between;
    background: transparent; flex-shrink: 0; pointer-events: none;
}
.sb-time { font-size: .55rem; font-weight: 700; color: #fff; letter-spacing: .2px; text-shadow: 0 1px 3px rgba(0,0,0,.8); }
.sb-icons { display: flex; align-items: center; gap: 3px; }

.iphone-app-bar {
    position: absolute; bottom: 28px; left: 0; right: 0; z-index: 10;
    height: 34px; padding: 0 11px;
    display: flex; align-items: center; justify-content: space-between;
    background: linear-gradient(to top, rgba(0,0,0,.7) 0%, transparent 100%);
    flex-shrink: 0; pointer-events: none;
}
.app-bar-title  { font-size: .65rem; font-weight: 800; color: #fff; letter-spacing: .4px; text-shadow: 0 1px 4px rgba(0,0,0,.9); }
.app-bar-icons  { display: flex; align-items: center; gap: 7px; }
.app-bar-avatar {
    width: 19px; height: 19px; border-radius: 50%;
    background: linear-gradient(135deg,#7c3aed,#f472b6);
    display: flex; align-items: center; justify-content: center;
    font-size: .5rem; font-weight: 800; color: #fff;
}

.iphone-home-indicator {
    position: absolute; bottom: 0; left: 0; right: 0; z-index: 10;
    height: 20px; display: flex; align-items: center; justify-content: center;
    pointer-events: none;
}
.iphone-home-indicator::before {
    content: ''; display: block;
    width: 32%; height: 4px; border-radius: 3px;
    background: rgba(255,255,255,.28);
}

/* ===== Carousel ===== */
.mockup-carousel { position: absolute; inset: 0; overflow: hidden; }
.carousel-track  { display: flex; flex-wrap: nowrap; height: 100%; transition: transform .55s cubic-bezier(.4,0,.2,1); will-change: transform; }
.banner-slide    { width: 100%; min-width: 100%; flex-shrink: 0; height: 100%; overflow: hidden; position: relative; }

/* Slides */
.slide-1 { background: #0a0f1e; }
.slide-1 .s-art      { position: absolute; inset: 0; }

.slide-2 { background: #09090b; }
.slide-2 .shoe-wrap  { position: absolute; inset: 0; }

.slide-3 { background: #150825; }
.slide-3 .headphone-wrap { position: absolute; inset: 0; }

.slide-4 { background: #011a10; }
.slide-4 .laptop-wrap { position: absolute; inset: 0; }

/* Slide info bottom overlay */
.slide-info {
    position: absolute; bottom: 0; left: 0; right: 0; z-index: 5;
    padding: 10px 14px 28px;
    background: linear-gradient(to top, rgba(0,0,0,.92) 0%, rgba(0,0,0,.6) 70%, transparent 100%);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}
.slide-info .s-row1  { display: flex; align-items: center; justify-content: space-between; margin-bottom: 2px; }
.slide-info .s-store { font-size: .56rem; font-weight: 800; letter-spacing: 1px; text-transform: uppercase; }
.slide-info .s-stars { font-size: .58rem; color: #f59e0b; }
.slide-info .s-title { font-size: .76rem; font-weight: 700; color: #fff; line-height: 1.25; margin-bottom: 5px; }
.slide-info .s-prices { display: flex; align-items: baseline; gap: 8px; margin-bottom: 5px; }
.slide-info .s-orig  { font-size: .62rem; color: rgba(255,255,255,.38); text-decoration: line-through; }
.slide-info .s-offer { font-size: .92rem; font-weight: 800; font-family: 'Poppins', sans-serif; }
.slide-info .s-cta   {
    display: block; text-align: center; padding: 4px 0; border-radius: 7px;
    font-size: .6rem; font-weight: 700; letter-spacing: .5px;
    background: rgba(255,255,255,.07); color: rgba(255,255,255,.5);
    border: 1px solid rgba(255,255,255,.1);
}

/* Carousel dots */
.carousel-dots { position: absolute; bottom: 6px; left: 50%; transform: translateX(-50%); display: flex; gap: 4px; z-index: 15; }
.c-dot {
    width: 14px; height: 3px; border-radius: 2px;
    background: rgba(255,255,255,.25); cursor: pointer;
    transition: background .3s, width .3s;
}
.c-dot.active { background: #fff; width: 22px; }

/* Feature section */
.features-section {
    padding: 80px 0;
    border-top: 1px solid var(--border-color);
}

.section-label {
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--accent-1);
    margin-bottom: 0.75rem;
}

.section-title {
    font-family: 'Poppins', sans-serif;
    font-weight: 700;
    font-size: clamp(1.8rem, 3vw, 2.5rem);
    margin-bottom: 0.75rem;
}

.section-sub {
    color: var(--text-secondary);
    font-size: 1.05rem;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
    text-align: center;
}

.feature-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 28px 24px;
    transition: all 0.3s;
    height: 100%;
}

.feature-card:hover {
    transform: translateY(-4px);
    border-color: var(--accent-1);
    box-shadow: 0 8px 32px rgba(124, 58, 237, 0.2);
}

.feature-icon {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    margin-bottom: 18px;
}

.feature-icon.purple { background: rgba(124, 58, 237, 0.15); color: #c4b5fd; }
.feature-icon.pink   { background: rgba(244, 114, 182, 0.15); color: #fbcfe8; }
.feature-icon.cyan   { background: rgba(6, 182, 212, 0.15); color: #a5f3fc; }
.feature-icon.orange { background: rgba(251, 146, 60, 0.15); color: #fed7aa; }
.feature-icon.green  { background: rgba(52, 211, 153, 0.15); color: #a7f3d0; }
.feature-icon.yellow { background: rgba(250, 204, 21, 0.15); color: #fef08a; }

.feature-card h5 {
    font-weight: 700;
    font-size: 1.05rem;
    margin-bottom: 8px;
}

.feature-card p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.6;
    margin: 0;
}

/* Stores section */
.stores-section {
    padding: 70px 0 60px;
    border-top: 1px solid var(--border-color);
    overflow: hidden;
}

/* ── Marquee strip ── */
.stores-marquee-wrap {
    position: relative;
    overflow: hidden;
    mask-image: linear-gradient(90deg, transparent 0%, #000 8%, #000 92%, transparent 100%);
    -webkit-mask-image: linear-gradient(90deg, transparent 0%, #000 8%, #000 92%, transparent 100%);
}

.stores-marquee-track {
    display: flex;
    gap: 0;
    width: max-content;
    /* animation se aplica por JS con el pixel exacto */
}

/* ── Individual logo cards ── */
.store-logo-card {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 28px 36px;
    min-width: 200px;
    margin-right: 170px;
    transition: border-color 0.3s, transform 0.3s;
    cursor: default;
}

.store-logo-card:hover {
    border-color: var(--accent-1);
    transform: translateY(-4px);
}

.store-brand-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 44px;
}

.store-logo-img {
    height: 44px;
    width: auto;
    max-width: 140px;
    object-fit: contain;
    opacity: 0.9;
    transition: opacity 0.3s;
}

.store-logo-img.meli-logo   { height: 62px; max-width: 160px; }
.store-logo-img.sodimac-logo { height: 62px; max-width: 160px; }

.store-logo-card:hover .store-logo-img { opacity: 1; }

.adidas-logo {
    opacity: 0.5;
    filter: brightness(0) invert(1);
    height: 62px;
    max-width: 160px;
}

.store-logo-name {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--text-secondary);
    letter-spacing: 0.5px;
}

.store-logo-sub {
    font-size: 0.6rem;
    color: var(--text-secondary);
    opacity: 0.6;
    margin-top: -6px;
}

/* ── Próximamente card ── */
.store-logo-soon {
    opacity: 0.6;
    border-style: dashed;
}

.store-logo-soon:hover {
    opacity: 1;
    border-color: var(--accent-2);
    transform: translateY(-4px);
}

.soon-badge {
    position: absolute;
    top: -11px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, var(--accent-1), var(--accent-2));
    color: #fff;
    font-size: 0.6rem;
    font-weight: 800;
    letter-spacing: 0.8px;
    padding: 3px 10px;
    border-radius: 20px;
    white-space: nowrap;
    text-transform: uppercase;
}


/* Steps */
.steps-section {
    padding: 70px 0;
    border-top: 1px solid var(--border-color);
}

.step-item {
    display: flex;
    gap: 20px;
    margin-bottom: 36px;
}

.step-number {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: var(--accent-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.step-item h5 { font-weight: 700; margin-bottom: 4px; }
.step-item p  { color: var(--text-secondary); font-size: 0.9rem; margin: 0; }

/* CTA section */
.cta-section {
    padding: 80px 0;
    border-top: 1px solid var(--border-color);
    text-align: center;
}

.cta-box {
    background: linear-gradient(135deg, rgba(124,58,237,0.15), rgba(244,114,182,0.1));
    border: 1px solid rgba(124, 58, 237, 0.3);
    border-radius: 24px;
    padding: 60px 40px;
    position: relative;
    overflow: hidden;
}

.cta-box::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at 50% 0%, rgba(124,58,237,0.12) 0%, transparent 60%);
    pointer-events: none;
}

/* ===== Login Page ===== */
.login-wrapper {
    min-height: calc(100vh - 62px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    position: relative;
    overflow: hidden;
}

.login-wrapper::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse at 30% 50%, rgba(124,58,237,0.14) 0%, transparent 55%),
        radial-gradient(ellipse at 75% 40%, rgba(244,114,182,0.1) 0%, transparent 50%);
    pointer-events: none;
}

.login-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 48px 40px;
    width: 100%;
    max-width: 420px;
    position: relative;
    z-index: 1;
    box-shadow: 0 32px 80px rgba(0,0,0,0.5);
}

.login-card .login-logo {
    text-align: center;
    margin-bottom: 32px;
}

.login-card .login-logo i {
    font-size: 2.5rem;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.login-card h2 {
    font-family: 'Poppins', sans-serif;
    font-weight: 700;
    font-size: 1.6rem;
    text-align: center;
    margin-bottom: 6px;
}

.login-card .login-sub {
    color: var(--text-secondary);
    text-align: center;
    font-size: 0.95rem;
    margin-bottom: 32px;
}

.login-field label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.login-field {
    margin-bottom: 20px;
}

.btn-login {
    width: 100%;
    padding: 14px;
    background: var(--accent-gradient);
    border: none;
    border-radius: 10px;
    color: white;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    margin-top: 8px;
}

.btn-login:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 24px rgba(124, 58, 237, 0.4);
}

.generate-container {
    color: var(--text-secondary) !important;
}
