/* ==========================================================================
   Cartones (cartones.php) — diseño 2026, prefijo ct-. Único CSS propio de la página.
   Parte 1: base heredada del antiguo pages/cartones.css (taller de marca, cartones generados en pantalla,
   modales y controles). El 01/10/2026 se quitaron sus reglas sin uso y se trajo aquí el resto, en el mismo
   orden, para que la página se vea igual. Copia del original: Backup bingu/2026-09-30_limpieza-diseno-2026/tanda7/.
   Parte 2: diseño 2026 (va después y manda sobre la parte 1).
   Los controles conservan sus clases antiguas (format-btn, theme-option, qty-btn, batch-btn…)
   porque las usa el JS; dentro de #ctTool se anulan sus estilos antiguos y se pintan de nuevo.
   ========================================================================== */

/* ======================= PARTE 1: base heredada ======================= */

body {
    --header-edge-fill: var(--bg);
    background: var(--bg);
}

/* ===== PAGE LAYOUT ===== */

/* ===== CONFIG SECTION ===== */

/* cartonesArea ya esta dentro de la columna principal */

/* ===== CONFIG GROUP ===== */

/* ===== FORMAT TOGGLE ===== */

.format-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    padding: 12px 22px;
    border-radius: 14px;
    border: 2px solid #e5e7eb;
    background: linear-gradient(180deg, #ffffff 0%, #f1f5f9 100%);
    font-family: inherit;
    font-size: 0.92rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    cursor: pointer;
    transition: all 0.15s;
    position: relative;
    top: 0;
    color: var(--gray-dark);
    box-shadow:
        0 5px 0 #d1d5db,
        0 8px 14px rgba(0, 0, 0, 0.06);
    overflow: hidden;
}

.format-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.45), transparent);
    transition: left 0.5s;
    pointer-events: none;
}

.format-btn:hover {
    top: 3px;
    color: var(--blue-dark);
    box-shadow:
        0 2px 0 #d1d5db,
        0 4px 8px rgba(0, 0, 0, 0.05);
}

.format-btn:hover::before {
    left: 100%;
}

.format-btn:active {
    top: 5px;
    box-shadow:
        0 0 0 #d1d5db,
        0 1px 2px rgba(0, 0, 0, 0.03);
}

.format-btn.active {
    color: #ffffff;
    border-color: transparent;
    background: linear-gradient(180deg, #4cc1ff 0%, var(--blue) 100%);
    box-shadow:
        0 5px 0 #0b8fc4,
        0 9px 18px rgba(21, 151, 239, 0.28);
}

.format-btn.active:hover {
    color: #ffffff;
    background: linear-gradient(180deg, #4cc1ff 0%, var(--blue) 100%);
    box-shadow:
        0 2px 0 #0b8fc4,
        0 4px 8px rgba(21, 151, 239, 0.18);
}

.format-btn.active:active {
    box-shadow:
        0 0 0 #0b8fc4,
        0 1px 2px rgba(21, 151, 239, 0.1);
}

/* ===== IMAGE CARD PACKS ===== */
.image-card-theme-options,
#cardThemeOptions {
    display: grid;
    gap: 12px;
    scroll-margin-top: clamp(88px, 11vh, 132px);
}

.image-card-theme-options[hidden],
#cardThemeOptions[hidden] {
    display: none;
}

.image-pack-option {
    display: grid;
    gap: 10px;
    min-width: 0;
    padding: 14px;
    border: 2px solid #e5e7eb;
    border-radius: 16px;
    background: #ffffff;
    color: var(--gray-dark);
    font-family: inherit;
    cursor: pointer;
    text-align: left;
    transition: transform 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
    box-shadow:
        0 4px 0 #d1d5db,
        0 7px 14px rgba(0, 0, 0, 0.06);
}

.image-pack-option:hover {
    transform: translateY(-2px);
    border-color: rgba(14, 165, 233, 0.38);
}

.image-pack-option.active {
    border-color: #ec4899;
    box-shadow:
        0 4px 0 #be185d,
        0 0 0 4px rgba(236, 72, 153, 0.13),
        0 10px 24px rgba(236, 72, 153, 0.14);
}

.image-card-theme-selector {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.cartones-grid.image-cards-grid {
    grid-template-columns: minmax(0, 1fr);
    max-width: 980px;
    margin-inline: auto;
}

@media (min-width: 1180px) {
    .cartones-grid.image-cards-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        max-width: 1320px;
    }
}

.image-card-theme-option {
    display: grid;
    grid-template-columns: 74px 1fr;
    align-items: center;
    gap: 12px;
    min-width: 0;
    padding: 12px;
    border: 2px solid #e5e7eb;
    border-radius: 16px;
    background: #ffffff;
    color: var(--gray-dark);
    font-family: inherit;
    cursor: pointer;
    text-align: left;
    box-shadow:
        0 4px 0 #d1d5db,
        0 7px 14px rgba(0, 0, 0, 0.06);
}

.image-card-theme-option.active {
    border-color: var(--image-card-theme-accent, #0ea5e9);
    box-shadow:
        0 4px 0 var(--image-card-theme-relief, #0369a1),
        0 0 0 4px var(--image-card-theme-ring, rgba(14, 165, 233, 0.13)),
        0 10px 24px var(--image-card-theme-glow, rgba(14, 165, 233, 0.14));
}

.image-card-theme-preview {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 4px;
    padding: 7px;
    aspect-ratio: 1;
    border-radius: 12px;
    background: linear-gradient(135deg, #e0f2fe, #ffffff 52%, #fef3c7);
    border: 1px solid rgba(14, 165, 233, 0.2);
}

.image-card-theme-preview span {
    border-radius: 7px;
    background: #ffffff;
    border: 1px solid rgba(15, 23, 42, 0.1);
    box-shadow: inset 0 -6px 0 rgba(14, 165, 233, 0.08);
}

@media (max-width: 720px) {
    .image-card-theme-selector {
        grid-template-columns: 1fr;
    }

    .image-card-theme-option {
        grid-template-columns: 60px minmax(0, 1fr);
    }
}

.image-card-theme-name {
    font-size: var(--text-base);
    font-weight: 800;
}

/* ===== THEME SELECTOR ===== */
.theme-selector {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 12px;
}

.theme-option {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    padding: 0;
    border: 2px solid var(--t-border, #e5e7eb);
    border-radius: 16px;
    background: var(--white);
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
    top: 0;
    overflow: hidden;
    box-shadow:
        0 4px 0 var(--t-relief, #d1d5db),
        0 6px 12px rgba(0, 0, 0, 0.06);
}

.theme-option:hover {
    top: -3px;
    box-shadow:
        0 7px 0 var(--t-relief, #d1d5db),
        0 10px 20px rgba(0, 0, 0, 0.1);
}

.theme-option:active {
    top: 4px;
    box-shadow:
        0 0px 0 var(--t-relief, #d1d5db),
        0 1px 3px rgba(0, 0, 0, 0.04);
}

.theme-option.active {
    box-shadow:
        0 4px 0 var(--t-relief, #d1d5db),
        0 6px 14px rgba(0, 0, 0, 0.12);
    outline: 3px solid #ec4899;
    outline-offset: -1px;
}

.theme-option.active:hover {
    top: -3px;
    box-shadow:
        0 7px 0 var(--t-relief, #d1d5db),
        0 10px 20px rgba(0, 0, 0, 0.15);
}

.theme-option.active:active {
    top: 4px;
    box-shadow:
        0 0px 0 var(--t-relief, #d1d5db),
        0 1px 3px rgba(0, 0, 0, 0.04);
}

/* Mini card preview */
.theme-preview {
    width: 100%;
    aspect-ratio: 4 / 3;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: rgba(0, 0, 0, 0.03);
}

.theme-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.theme-option:hover .theme-preview {
    transform: scale(1.04);
}

/* Theme name label */

/* Check badge */

/* ===== QUANTITY SELECTOR ===== */

.qty-btn {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: inherit;
    font-weight: 700;
    font-size: var(--text-lg);
    border: 1px solid rgba(0, 0, 0, 0.08);
    background: linear-gradient(to bottom, #ffffff, #f1f5f9);
    cursor: pointer;
    transition: all 0.15s;
    position: relative;
    top: 0;
    color: var(--gray-dark);
    box-shadow:
        0 4px 0 #d1d5db,
        0 6px 10px rgba(0, 0, 0, 0.06),
        inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.qty-btn[hidden] {
    display: none;
}

.qty-btn:hover {
    top: 2px;
    color: var(--blue-dark);
    box-shadow:
        0 2px 0 #d1d5db,
        0 3px 6px rgba(0, 0, 0, 0.05),
        inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.qty-btn:active {
    top: 4px;
    box-shadow:
        0 0px 0 #d1d5db,
        0 1px 3px rgba(0, 0, 0, 0.03);
}

.qty-btn.active {
    background: linear-gradient(to bottom, #2dd4f0, #0ea5e9);
    color: var(--white);
    border-color: transparent;
    box-shadow:
        0 4px 0 #0b7bb5,
        0 6px 10px rgba(26, 188, 245, 0.25);
}

.qty-btn.active:hover {
    top: 2px;
    box-shadow:
        0 2px 0 #0b7bb5,
        0 3px 6px rgba(26, 188, 245, 0.2);
}

.qty-btn.active:active {
    top: 4px;
    box-shadow:
        0 0px 0 #0b7bb5,
        0 1px 3px rgba(26, 188, 245, 0.15);
}

/* ===== GENERATE BUTTON ===== */
.btn-generate {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    max-width: none;
    min-height: 66px;
    margin: 12px auto 0;
    padding: 18px 32px;
    border-radius: 50px;
    font-family: inherit;
    font-size: var(--text-lg);
    font-weight: 900;
    border: none;
    cursor: pointer;
    transition: all 0.15s;
    position: relative;
    top: 0;
    background: linear-gradient(to bottom, #f472b6, #ec4899);
    color: var(--white);
    text-transform: uppercase;
    box-shadow:
        0 5px 0 #be185d,
        0 7px 12px rgba(255, 29, 186, 0.3);
    overflow: hidden;
}

.btn-generate::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    transition: left 0.5s;
}

.btn-generate:hover::before {
    left: 100%;
}

.btn-generate:hover {
    top: 3px;
    box-shadow:
        0 2px 0 #be185d,
        0 3px 6px rgba(255, 29, 186, 0.2);
}

.btn-generate:active {
    top: 5px;
    box-shadow:
        0 0px 0 #be185d,
        0 1px 3px rgba(255, 29, 186, 0.15);
}

.btn-generate svg {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
}

/* ===== CARDS AREA ===== */
#cartonesArea {
    max-width: 1400px;
    margin: 40px auto 0;
}

#cartonesGrid .bingo-card .bingo-cell:not(.free) {
    font-size: clamp(15.4px, 2.75vw, 26.4px) !important;
}

/* ===== ACTION BUTTONS ===== */
.cartones-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: center;
    margin-bottom: 24px;
}

.btn-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 52px;
    padding: 13px 22px;
    color: var(--gray-dark);
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    text-decoration: none;
    border: 2px solid #e5e7eb;
    border-radius: 14px;
    background: linear-gradient(180deg, #ffffff 0%, #f1f5f9 100%);
    cursor: pointer;
    position: relative;
    top: 0;
    box-shadow:
        0 5px 0 #d1d5db,
        0 8px 14px rgba(0, 0, 0, 0.06);
    transition: all 0.15s;
    overflow: hidden;
}

.btn-action::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.45), transparent);
    transition: left 0.5s;
    pointer-events: none;
}

.btn-action:hover {
    top: 3px;
    box-shadow:
        0 2px 0 #d1d5db,
        0 4px 8px rgba(0, 0, 0, 0.05);
}

.btn-action:hover::before {
    left: 100%;
}

.btn-action:active {
    top: 5px;
    box-shadow:
        0 0 0 #d1d5db,
        0 1px 2px rgba(0, 0, 0, 0.03);
}

.btn-action svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.btn-action.btn-pdf {
    color: #ffffff;
    background: linear-gradient(180deg, #4cc1ff 0%, var(--blue) 100%);
    border-color: transparent;
    box-shadow:
        0 5px 0 #0b8fc4,
        0 9px 18px rgba(21, 151, 239, 0.28);
}

.btn-action.btn-pdf:hover {
    background: linear-gradient(180deg, #4cc1ff 0%, var(--blue) 100%);
    box-shadow:
        0 2px 0 #0b8fc4,
        0 4px 8px rgba(21, 151, 239, 0.18);
}

.btn-action.btn-pdf:active {
    box-shadow:
        0 0 0 #0b8fc4,
        0 1px 2px rgba(21, 151, 239, 0.1);
}

/* ===== PAGE HEADER — título sólido + acento ===== */

/* ===== 2-COLUMN LAYOUT ===== */

/* ===== BATCH CARDS ===== */
.batch-card {
    padding: clamp(14px, 1.6vw, 20px);
    border: 2px solid #e5e7eb;
    border-radius: 16px;
    background: linear-gradient(180deg, #f8fafc 0%, #ffffff 100%);
    box-shadow: 0 3px 0 #e5e7eb, 0 5px 10px rgba(0, 0, 0, 0.04);
}

.batch-flag {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    border: 2px solid #ffffff;
    box-shadow: 0 2px 0 #d1d5db;
}

/* ===== BATCH BUTTONS ===== */
.batch-buttons {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.batch-btn {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 12px 14px;
    border-radius: 12px;
    border: none;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
    top: 0;
    background: linear-gradient(to bottom, #2dd4f0, #0ea5e9);
    color: var(--white);
    box-shadow:
        0 3px 0 #0b7bb5,
        0 5px 10px rgba(26, 188, 245, 0.2);
}

.batch-btn:hover {
    top: 2px;
    box-shadow:
        0 1px 0 #0b7bb5,
        0 2px 6px rgba(26, 188, 245, 0.15);
}

.batch-btn:active {
    top: 3px;
    box-shadow:
        0 0px 0 #0b7bb5,
        0 1px 3px rgba(26, 188, 245, 0.1);
}

.batch-btn-dot {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    flex-shrink: 0;
    background: #000000;
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.4);
    margin-left: auto;
    margin-right: 10px;
}

.batch-btn.locked .batch-btn-dot {
    opacity: 0.4;
}

.batch-btn-info {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 1px;
}

.batch-btn-pages {
    font-size: var(--text-sm);
    font-weight: 700;
}

.batch-btn-cards {
    font-size: 11px;
    opacity: 0.85;
}

.batch-btn-icon {
    width: 26px;
    height: 26px;
    flex-shrink: 0;
}

.batch-btn-lock {
    display: none;
}

/* Locked state */
.batch-btn.locked {
    background: #e5e7eb;
    color: #9ca3af;
    box-shadow:
        0 3px 0 #d1d5db,
        0 5px 10px rgba(0, 0, 0, 0.04);
}

.batch-btn.locked:hover {
    box-shadow:
        0 1px 0 #d1d5db,
        0 2px 6px rgba(0, 0, 0, 0.03);
}

.batch-btn.locked .batch-btn-icon {
    display: none;
}

.batch-btn.locked .batch-btn-lock {
    display: block;
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

/* Generating / bloqueo global de lotes normales */
.batch-btn:disabled {
    cursor: not-allowed;
    pointer-events: none;
    opacity: 0.72;
}

.batch-btn.generating {
    pointer-events: none;
    opacity: 0.7;
}

.batch-btn:disabled:hover,
.batch-btn.generating:hover {
    top: 0;
    box-shadow:
        0 3px 0 #0b7bb5,
        0 5px 10px rgba(26, 188, 245, 0.2);
}

/* ===== SIDEBAR HEADER ===== */

.card-access-select {
    width: 100%;
    min-height: 46px;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    padding: 10px 12px;
    background: #ffffff;
    color: var(--gray-dark);
    font: inherit;
    font-size: var(--text-sm);
    font-weight: 700;
    box-shadow: 0 3px 0 #e5e7eb;
}

/* ===== CARD BRANDING WORKSHOP ===== */
.card-branding-section {
    --brand-primary-btn-radius: 12px;
    --brand-primary-btn-bg: linear-gradient(135deg, var(--blue), #0ea5e9);
    --brand-primary-btn-shadow: 0 4px 0 #0b8fc4, 0 8px 16px rgba(26, 188, 245, 0.18);
    --brand-primary-btn-shadow-hover: 0 3px 0 #0b8fc4, 0 6px 12px rgba(26, 188, 245, 0.16);
    --brand-primary-btn-shadow-active: 0 2px 0 #0b8fc4, 0 4px 8px rgba(26, 188, 245, 0.12);
    width: 100%;
    max-width: 1400px;
    margin: 28px auto 0;
    display: grid;
    gap: clamp(22px, 3vw, 34px);
    padding: clamp(26px, 3.5vw, 44px);
    border: 2px solid #e5e7eb;
    border-radius: 20px;
    background:
        radial-gradient(circle at 90% 10%, rgba(255, 63, 168, 0.1), transparent 250px),
        linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(240, 249, 255, 0.96)),
        #ffffff;
    box-shadow:
        0 5px 0 #d1d5db,
        0 7px 16px rgba(0, 0, 0, 0.08);
}

.card-branding-section.is-collapsed {
    gap: 0;
}

.card-branding-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
}

.card-branding-kicker {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    width: fit-content;
    min-height: 38px;
    margin-bottom: 12px;
    padding: 7px 12px;
    border-radius: 999px;
    background: rgba(255, 63, 168, 0.12);
    color: var(--pink-dark);
    font-size: var(--text-xs);
    font-weight: 900;
    text-transform: uppercase;
}

.card-branding-kicker::before {
    content: '';
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--pink);
}

.card-branding-header h2 {
    margin: 0;
    color: var(--gray-dark);
    font-size: clamp(1.55rem, 2.25vw, 2.35rem);
    line-height: 1.06;
    font-weight: 900;
    letter-spacing: 0;
}

.card-branding-header p {
    max-width: 780px;
    margin: 14px 0 0;
    color: var(--gray);
    font-size: clamp(1rem, 1.08vw, 1.14rem);
    line-height: 1.45;
    font-weight: 700;
}

.card-branding-workbench {
    display: grid;
    grid-template-columns: minmax(320px, 0.72fr) minmax(480px, 1.28fr);
    gap: clamp(22px, 3.5vw, 46px);
    align-items: start;
}

.card-branding-workbench[hidden] {
    display: none;
}

.card-branding-form,
.card-branding-preview {
    min-width: 0;
    border: 1px solid var(--line);
    border-radius: 20px;
    background: #ffffff;
    box-shadow: 0 16px 38px rgba(18, 60, 118, 0.07);
}

.card-branding-form {
    display: grid;
    gap: 16px;
    padding: clamp(20px, 2.5vw, 30px);
}

.card-branding-form h3 {
    margin: 0;
    color: var(--gray-dark);
    font-size: clamp(1.35rem, 1.55vw, 1.7rem);
    line-height: 1.08;
    font-weight: 900;
}

.card-branding-form p {
    margin: -6px 0 0;
    color: var(--gray);
    font-size: var(--text-sm);
    line-height: 1.45;
}

.card-branding-field {
    display: grid;
    gap: 8px;
    min-width: 0;
}

.card-branding-field label,
.card-branding-upload-list label {
    color: var(--gray-dark);
    font-size: clamp(0.98rem, 1vw, 1.05rem);
    line-height: 1.35;
    font-weight: 800;
}

.card-branding-field input[type="text"],
.card-branding-field input[type="file"],
.card-branding-upload-list input[type="file"] {
    width: 100%;
    min-width: 0;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #f8fafc;
    color: var(--gray-dark);
    font-family: inherit;
    font-size: clamp(0.96rem, 1vw, 1.04rem);
}

.card-branding-field input[type="text"] {
    min-height: 54px;
    padding: 0 16px;
    font-weight: 800;
}

.card-branding-field input[type="file"],
.card-branding-upload-list input[type="file"] {
    padding: 12px;
    cursor: pointer;
}

.card-branding-hint {
    color: var(--gray);
    font-size: var(--text-sm);
    line-height: 1.45;
}

.card-branding-hint strong {
    color: var(--pink-dark);
    font-weight: 900;
}

.card-branding-upload-list {
    display: grid;
    gap: 12px;
}

.card-branding-upload-list label {
    display: grid;
    gap: 7px;
    padding: 12px;
    border: 1px dashed rgba(255, 63, 168, 0.4);
    border-radius: 14px;
    background: rgba(255, 63, 168, 0.07);
}

.card-branding-upload-list span {
    color: var(--pink-dark);
}

.card-branding-upload-status,
.card-branding-upload-list small {
    min-height: 18px;
    color: var(--gray);
    font-size: var(--text-xs);
    font-weight: 800;
}

.card-branding-upload-status.is-ok,
.card-branding-upload-list small.is-ok {
    color: #047857;
}

.card-branding-upload-status.is-error,
.card-branding-upload-list small.is-error {
    color: #be123c;
}

.card-branding-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 56px;
    padding: 14px 22px;
    border: none;
    border-radius: 14px;
    background: linear-gradient(180deg, #ff65c2 0%, var(--pink) 100%);
    color: #ffffff;
    font-family: inherit;
    font-size: clamp(0.98rem, 1vw, 1.05rem);
    font-weight: 900;
    text-transform: uppercase;
    box-shadow: 0 5px 0 var(--pink-dark), 0 12px 22px rgba(255, 63, 168, 0.22);
    cursor: pointer;
}

.card-branding-btn svg {
    width: 22px;
    height: 22px;
    flex-shrink: 0;
}

.card-branding-toggle-icon {
    transition: transform 0.18s ease;
}

.card-branding-btn[aria-expanded="true"] .card-branding-toggle-icon {
    transform: rotate(180deg);
}

.card-branding-preview {
    display: grid;
    gap: 14px;
    padding: clamp(18px, 2.4vw, 28px);
    background:
        radial-gradient(circle at 88% 10%, rgba(255, 63, 168, 0.12), transparent 220px),
        linear-gradient(135deg, #f7fbff, #ffffff);
}

.card-branding-preview-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.card-branding-preview-head strong {
    color: var(--gray-dark);
    font-size: clamp(1.08rem, 1.16vw, 1.22rem);
    font-weight: 900;
}

.card-branding-preview-head span {
    color: var(--gray);
    font-size: var(--text-sm);
    font-weight: 800;
}

.brand-card-preview {
    --brand-preview-border: var(--blue);
    --brand-preview-shadow: rgba(18, 60, 118, 0.16);
    --brand-preview-surface: #ffffff;
    --brand-preview-top-bg: #f8f8f8;
    --brand-preview-line: #d9d9d9;
    --brand-preview-text: #050505;
    --brand-preview-cell-bg: #fbfbfb;
    --brand-preview-cell-alt: #f7f7f7;
    --brand-preview-footer-bg: #f5f5f5;
    --brand-preview-footer-text: #6b7280;
    --brand-preview-header-bg: linear-gradient(180deg, #ff65c2, var(--pink));
    --brand-preview-header-text: #ffffff;
    --brand-preview-free-bg: #fff5fb;
    --brand-preview-free-text: var(--pink-dark);
    --brand-preview-ad-bg: rgba(255, 63, 168, 0.08);
    --brand-preview-ad-border: rgba(255, 63, 168, 0.42);
    --brand-preview-ad-text: var(--pink-dark);
    width: 100%;
    max-width: 760px;
    margin: 0 auto;
    overflow: hidden;
    padding: 0;
    border: 4px solid var(--brand-preview-border);
    border-radius: 18px;
    background: var(--brand-preview-surface);
    box-shadow: 0 22px 48px var(--brand-preview-shadow);
}

.brand-card-preview[data-brand-format="es"] {
    max-width: 720px;
    border: 2px solid var(--brand-preview-border);
    border-radius: 12px;
    box-shadow: 0 16px 34px var(--brand-preview-shadow);
}

.brand-card-preview[data-brand-format="image-49"],
.brand-card-preview[data-brand-format="image-36"] {
    background:
        linear-gradient(var(--brand-preview-pattern, rgba(14, 165, 233, 0.08)) 1px, transparent 1px),
        linear-gradient(90deg, var(--brand-preview-pattern, rgba(14, 165, 233, 0.08)) 1px, transparent 1px),
        var(--brand-preview-surface-gradient, linear-gradient(135deg, #ffffff, #fffdf4));
    background-size: 18px 18px, 18px 18px, 100% 100%;
}

.brand-card-preview[data-brand-theme="clasico"] {
    --brand-preview-border: #111827;
    --brand-preview-shadow: rgba(15, 23, 42, 0.14);
    --brand-preview-top-bg: #f5f5f5;
    --brand-preview-line: #d9d9d9;
    --brand-preview-text: #050505;
    --brand-preview-cell-bg: #fbfbfb;
    --brand-preview-cell-alt: #f7f7f7;
    --brand-preview-footer-bg: #f5f5f5;
    --brand-preview-footer-text: #6b7280;
    --brand-preview-header-bg: #111827;
}

.brand-card-top {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 18px;
    min-width: 0;
    min-height: 59px;
    padding: 11px 18px;
    border-bottom: 2px solid var(--brand-preview-line);
    background: var(--brand-preview-top-bg);
}

.brand-card-qr {
    width: calc(59px + 22px);
    height: calc(59px + 22px);
    margin-block: -11px;
    margin-left: -18px;
}

.brand-card-preview[data-brand-format="image-49"] .brand-card-top,
.brand-card-preview[data-brand-format="image-36"] .brand-card-top {
    justify-content: space-between;
    border-bottom-color: var(--brand-preview-line);
    background: var(--brand-preview-top-bg);
}

.brand-card-preview[data-brand-format="us"] .brand-card-top {
    border-bottom-color: var(--brand-preview-line);
    background: var(--brand-preview-top-bg);
}

.brand-logo-preview,
.brand-contact-preview,
.brand-ad-preview {
    display: grid;
    place-items: center;
    overflow: hidden;
    border: 1px dashed rgba(21, 151, 239, 0.48);
    border-radius: 14px;
    background: #f0f9ff;
    color: var(--blue-dark);
    text-align: center;
    font-weight: 900;
}

.brand-logo-preview {
    flex: 0 0 clamp(112px, 20%, 154px);
    width: clamp(112px, 20%, 154px);
    height: calc(59px + 22px);
    margin-block: -11px;
    min-width: 0;
    min-height: 0;
    padding: 6px;
    box-sizing: border-box;
    border: 0;
    border-radius: 0;
    background: transparent;
}

.brand-logo-preview.has-image,
.brand-ad-preview.has-image {
    background: #ffffff;
    border-style: solid;
}

.brand-logo-preview.has-image {
    background: transparent;
    border: 0;
}

.brand-logo-preview img,
.brand-ad-preview img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transform-origin: center;
}

.brand-logo-preview img {
    max-width: 154px;
    max-height: 100%;
}

.brand-logo-preview.has-image img {
    max-width: none;
    max-height: none;
}

.brand-contact-preview {
    flex: 1 1 auto;
    min-width: 0;
    min-height: 36px;
    padding: 4px 8px;
    border: 0;
    background: transparent;
    color: var(--brand-preview-text);
    font-size: clamp(0.95rem, 1.55vw, 1.55rem);
    word-break: break-word;
}

.brand-ticket-grid {
    display: grid;
    grid-template-columns: repeat(9, 1fr);
    gap: 0;
    background: var(--brand-preview-line);
    border-bottom: 2px solid var(--brand-preview-line);
}

.brand-card-preview[data-brand-format="us"] .brand-ticket-grid {
    grid-template-columns: repeat(5, 1fr);
}

.brand-card-preview[data-brand-format="image-49"] .brand-ticket-grid {
    grid-template-columns: repeat(4, 1fr);
}

.brand-card-preview[data-brand-format="image-36"] .brand-ticket-grid {
    grid-template-columns: repeat(4, 1fr);
}

.brand-ticket-grid span {
    display: grid;
    place-items: center;
    min-height: clamp(46px, 5vw, 72px);
    border-radius: 0;
    background: var(--brand-preview-cell-bg);
    color: var(--brand-preview-text);
    font-size: clamp(1.16rem, 2.2vw, 2.1rem);
    font-weight: 900;
    border-top: 1px solid var(--brand-preview-line);
    border-left: 1px solid var(--brand-preview-line);
}

.brand-ticket-grid span.blank {
    background: var(--brand-preview-cell-alt);
}

.brand-ticket-grid span.header {
    background: var(--brand-preview-header-bg);
    color: var(--brand-preview-header-text);
    min-height: clamp(34px, 4vw, 54px);
    font-size: clamp(1.15rem, 2.1vw, 2rem);
}

.brand-ticket-grid span.free {
    background: var(--brand-preview-free-bg);
    color: var(--brand-preview-free-text);
    font-size: clamp(0.78rem, 1.3vw, 1.05rem);
}

.brand-ticket-grid span.image-cell {
    min-height: clamp(74px, 8vw, 116px);
    border-radius: 10px;
    margin: 4px;
    border: 1px solid var(--brand-preview-line);
    background: var(--brand-preview-cell-bg);
    color: var(--brand-preview-text);
    font-size: clamp(0.75rem, 1vw, 0.95rem);
}

.brand-ticket-grid span.image-cell.animal {
    grid-template-rows: 1fr auto;
    gap: 6px;
    padding: 8px;
}

.brand-ticket-grid span.image-cell.animal::before {
    display: block;
    font-size: clamp(2.1rem, 4.2vw, 4.4rem);
    line-height: 1;
}

.brand-ticket-grid span.image-cell.bee::before { content: '🐝'; }
.brand-ticket-grid span.image-cell.pig::before { content: '🐷'; }
.brand-ticket-grid span.image-cell.hippo::before { content: '🦛'; }
.brand-ticket-grid span.image-cell.zebra::before { content: '🦓'; }
.brand-ticket-grid span.image-cell.camel::before { content: '🐪'; }
.brand-ticket-grid span.image-cell.octopus::before { content: '🐙'; }
.brand-ticket-grid span.image-cell.duck::before { content: '🦆'; }
.brand-ticket-grid span.image-cell.owl::before { content: '🦉'; }
.brand-ticket-grid span.image-cell.deer::before { content: '🦌'; }
.brand-ticket-grid span.image-cell.squirrel::before { content: '🐿️'; }
.brand-ticket-grid span.image-cell.dog::before { content: '🐶'; }
.brand-ticket-grid span.image-cell.whale::before { content: '🐋'; }
.brand-ticket-grid span.image-cell.cat::before { content: '🐱'; }

.brand-ticket-grid span.ad-slot {
    overflow: hidden;
    padding: 4px;
    border: 1px dashed var(--brand-preview-ad-border);
    background: var(--brand-preview-ad-bg);
    color: var(--brand-preview-ad-text);
    font-size: clamp(0.68rem, 0.95vw, 0.9rem);
}

.brand-ticket-grid span.ad-slot.has-image {
    background: #ffffff;
    border-style: solid;
}

.brand-ticket-grid span.ad-slot img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transform-origin: center;
}

.brand-ad-row {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    padding: 10px 12px 12px;
    border-top: 1px solid var(--brand-preview-line);
    background: var(--brand-preview-cell-bg);
}

.brand-ad-preview {
    aspect-ratio: 2.7 / 1;
    min-height: 70px;
    border-color: rgba(255, 63, 168, 0.45);
    background: rgba(255, 63, 168, 0.07);
    color: var(--pink-dark);
    font-size: var(--text-xs);
}

.brand-crop-open-btn {
    width: fit-content;
    min-height: 34px;
    margin-top: 2px;
    padding: 7px 12px;
    border: 1px solid rgba(14, 165, 233, 0.32);
    border-radius: 10px;
    background: #ffffff;
    color: var(--blue-dark);
    font-family: inherit;
    font-size: var(--text-xs);
    font-weight: 900;
    cursor: pointer;
    box-shadow: 0 2px 0 #c8d8e8;
}

.brand-crop-open-btn:hover {
    transform: translateY(1px);
    box-shadow: 0 1px 0 #c8d8e8;
}

.brand-card-footer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
    min-height: 34px;
    padding: 7px 12px;
    background: var(--brand-preview-footer-bg);
    color: var(--brand-preview-footer-text);
    font-size: clamp(0.7rem, 1vw, 0.9rem);
    font-weight: 900;
}

.brand-card-footer span + span::before {
    content: '·';
    margin-right: 8px;
    color: #a0a7b2;
}

.brand-card-serial {
    color: #64748b;
    letter-spacing: 0.03em;
}

.brand-preview-controls {
    display: grid;
    gap: 16px;
}

.brand-format-control {
    display: grid;
    gap: 10px;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: #ffffff;
}

.brand-theme-control {
    display: grid;
    gap: 10px;
    padding: 14px 16px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: #ffffff;
}

.brand-theme-control[hidden] {
    display: none;
}

.brand-format-control > span,
.brand-theme-control > span,
.brand-custom-print-head strong {
    color: var(--gray-dark);
    font-size: clamp(0.98rem, 1vw, 1.05rem);
    font-weight: 800;
}

.brand-format-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.brand-format-buttons button {
    min-height: 38px;
    padding: 8px 14px;
    border: 1px solid var(--line);
    border-radius: var(--brand-primary-btn-radius);
    background: #ffffff;
    color: var(--gray-dark);
    font-family: inherit;
    font-size: clamp(0.82rem, 0.86vw, 0.92rem);
    font-weight: 900;
    line-height: 1.2;
    cursor: pointer;
    box-shadow: 0 3px 0 #d8e2ef;
    transition: background 0.2s ease, box-shadow 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.brand-format-buttons button:hover:not(.active) {
    border-color: rgba(26, 188, 245, 0.35);
    box-shadow: 0 2px 0 #d8e2ef;
}

.brand-format-buttons button.active {
    color: #ffffff;
    border-color: transparent;
    background: var(--brand-primary-btn-bg);
    box-shadow: var(--brand-primary-btn-shadow);
}

.brand-theme-buttons {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 8px;
}

.brand-theme-buttons--image {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.brand-theme-buttons button {
    display: grid;
    grid-template-columns: 20px minmax(0, 1fr);
    align-items: center;
    gap: 7px;
    min-height: 36px;
    min-width: 0;
    padding: 8px 10px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #ffffff;
    color: var(--gray-dark);
    font-family: inherit;
    font-size: clamp(0.82rem, 0.86vw, 0.9rem);
    font-weight: 800;
    cursor: pointer;
    text-align: left;
    box-shadow: 0 3px 0 #d8e2ef;
}

.brand-theme-buttons button span:last-child {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.brand-theme-buttons button.active {
    border-color: var(--brand-theme-color, var(--blue));
    box-shadow:
        0 3px 0 color-mix(in srgb, var(--brand-theme-color, var(--blue)) 70%, #111827),
        0 0 0 3px color-mix(in srgb, var(--brand-theme-color, var(--blue)) 16%, transparent);
}

.brand-theme-swatch {
    width: 20px;
    height: 20px;
    border-radius: 6px;
    background: var(--brand-theme-color, var(--blue));
    box-shadow: inset 0 -4px 0 rgba(0, 0, 0, 0.12);
}

.brand-custom-print {
    display: grid;
    gap: 12px;
    margin-top: 18px;
    padding-top: 18px;
    border-top: 1px solid rgba(255, 63, 168, 0.18);
    scroll-margin-top: clamp(88px, 11vh, 132px);
    scroll-margin-bottom: 24px;
    transition:
        box-shadow 0.4s ease,
        border-color 0.4s ease,
        background 0.4s ease,
        padding 0.4s ease;
}

.brand-custom-print.is-ready {
    padding: 16px;
    border-top: 0;
    border-radius: 18px;
    border: 2px solid rgba(255, 63, 168, 0.42);
    background: linear-gradient(180deg, rgba(255, 247, 252, 0.98) 0%, #ffffff 100%);
    box-shadow:
        0 0 0 4px rgba(255, 63, 168, 0.1),
        0 14px 34px rgba(255, 63, 168, 0.16);
}

.brand-custom-print.is-spotlight {
    animation: brandCustomPrintSpotlight 2.2s ease;
}

@keyframes brandCustomPrintSpotlight {
    0% {
        border-color: rgba(255, 63, 168, 0.75);
        box-shadow:
            0 0 0 0 rgba(255, 63, 168, 0.35),
            0 14px 34px rgba(255, 63, 168, 0.16);
    }

    45% {
        border-color: rgba(255, 63, 168, 0.88);
        box-shadow:
            0 0 0 10px rgba(255, 63, 168, 0.16),
            0 18px 42px rgba(255, 63, 168, 0.24);
    }

    100% {
        border-color: rgba(255, 63, 168, 0.42);
        box-shadow:
            0 0 0 4px rgba(255, 63, 168, 0.1),
            0 14px 34px rgba(255, 63, 168, 0.16);
    }
}

@media (prefers-reduced-motion: reduce) {
    .brand-custom-print.is-spotlight {
        animation: none;
    }
}

.brand-custom-print-head {
    display: grid;
    gap: 4px;
}

.brand-custom-print-head span {
    color: var(--gray);
    font-size: var(--text-sm);
    font-weight: 800;
    line-height: 1.45;
}

.brand-custom-print-status {
    margin: 0;
    color: var(--pink-dark);
    font-size: var(--text-sm);
    font-weight: 800;
    line-height: 1.45;
}

.brand-custom-print-note {
    margin: 0;
    color: var(--gray);
    font-size: var(--text-xs);
    font-weight: 700;
    line-height: 1.5;
}

.brand-custom-print-buttons {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
    margin-top: 2px;
}

.brand-custom-print-buttons .batch-btn.brand-batch-btn {
    flex-direction: column;
    align-items: stretch;
    justify-content: space-between;
    min-height: 92px;
    padding: 10px 12px;
    border: none;
    border-radius: var(--brand-primary-btn-radius);
    background: var(--brand-primary-btn-bg);
    color: #ffffff;
    font-family: inherit;
    font-weight: 900;
    box-shadow: var(--brand-primary-btn-shadow);
    top: 0;
    transition: top 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
}

.brand-custom-print-buttons .batch-btn.brand-batch-btn:hover:not(:disabled):not(.generating) {
    top: 1px;
    box-shadow: var(--brand-primary-btn-shadow-hover);
}

.brand-custom-print-buttons .batch-btn.brand-batch-btn:active:not(:disabled):not(.generating) {
    top: 2px;
    box-shadow: var(--brand-primary-btn-shadow-active);
}

.brand-custom-print-buttons .batch-btn-dot {
    display: none;
}

.brand-custom-print-buttons .batch-btn-icon {
    width: 22px;
    height: 22px;
    align-self: flex-end;
    margin-top: 6px;
}

.brand-custom-print-buttons .batch-btn.brand-batch-btn:not(:disabled):not(.generating) .batch-btn-pages {
    color: #ffffff;
    font-size: var(--text-sm);
    font-weight: 900;
    line-height: 1.25;
}

.brand-custom-print-buttons .batch-btn.brand-batch-btn:not(:disabled):not(.generating) .batch-btn-cards {
    color: rgba(255, 255, 255, 0.88);
    font-size: clamp(0.82rem, 0.86vw, 0.9rem);
    font-weight: 900;
    opacity: 1;
    line-height: 1.25;
}

.brand-custom-print-buttons .batch-btn.brand-batch-btn:disabled .batch-btn-cards,
.brand-custom-print-buttons .batch-btn.brand-batch-btn.generating .batch-btn-cards {
    color: #9ca3af;
    opacity: 1;
}

.brand-custom-print-buttons .batch-btn.brand-batch-btn:disabled,
.brand-custom-print-buttons .batch-btn.brand-batch-btn.generating {
    cursor: not-allowed;
    pointer-events: none;
    background: #e5e7eb;
    color: #9ca3af;
    box-shadow: 0 3px 0 #d1d5db;
    opacity: 0.78;
    top: 0;
}

.brand-custom-print-buttons .batch-btn.brand-batch-btn:disabled:hover,
.brand-custom-print-buttons .batch-btn.brand-batch-btn.generating:hover {
    top: 0;
    box-shadow: 0 3px 0 #d1d5db;
}

.brand-design-manager {
    display: grid;
    gap: 12px;
    margin-top: 18px;
    padding-top: 18px;
    border-top: 1px solid #e5e7eb;
}

.brand-design-manager-head {
    display: grid;
    gap: 4px;
}

.brand-design-manager-head strong {
    color: var(--gray-dark);
    font-size: var(--text-base);
    font-weight: 900;
}

.brand-design-manager-head span {
    color: var(--gray);
    font-size: var(--text-sm);
    font-weight: 700;
    line-height: 1.45;
}

.brand-design-slots {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
}

.brand-design-slot {
    min-height: 42px;
    padding: 8px 10px;
    border: 1px solid #dbe5f0;
    border-radius: 12px;
    background: #fff;
    color: var(--gray-dark);
    font-family: inherit;
    font-size: var(--text-xs);
    font-weight: 900;
    cursor: pointer;
    transition: transform 0.15s, border-color 0.15s, background 0.15s;
}

.brand-design-slot.is-empty {
    color: #94a3b8;
    background: #f8fafc;
}

.brand-design-slot.is-saved {
    background: #eff6ff;
    border-color: rgba(26, 188, 245, 0.28);
}

.brand-design-slot.is-active {
    border-color: var(--blue);
    box-shadow: 0 0 0 2px rgba(26, 188, 245, 0.18);
}

.brand-design-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.brand-design-save-btn,
.brand-design-delete-btn {
    min-height: 44px;
    padding: 10px 16px;
    border: none;
    border-radius: var(--brand-primary-btn-radius);
    font-family: inherit;
    font-size: var(--text-sm);
    font-weight: 900;
    line-height: 1.2;
    cursor: pointer;
}

.brand-design-save-btn {
    background: var(--brand-primary-btn-bg);
    color: #fff;
    box-shadow: var(--brand-primary-btn-shadow);
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.brand-design-save-btn:hover:not(:disabled) {
    box-shadow: var(--brand-primary-btn-shadow-hover);
    transform: translateY(1px);
}

.brand-design-save-btn:active:not(:disabled) {
    box-shadow: var(--brand-primary-btn-shadow-active);
    transform: translateY(2px);
}

.brand-design-delete-btn {
    background: #fff;
    color: #b91c1c;
    border: 1px solid #fecaca;
}

.brand-design-status {
    margin: 0;
    font-size: var(--text-sm);
    font-weight: 800;
}

.brand-design-status.is-ok {
    color: #166534;
}

.brand-design-status.is-error {
    color: #991b1b;
}

.brand-card-print {
    box-shadow: none !important;
}

/* ===== PREMIUM MODAL ===== */
.batch-modal {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.batch-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

.batch-modal-content {
    position: relative;
    background: var(--white);
    border-radius: 20px;
    padding: 40px 32px;
    max-width: 420px;
    width: 90%;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
    animation: batchModalIn 0.25s ease-out;
}

@keyframes batchModalIn {
    from { opacity: 0; transform: scale(0.9) translateY(10px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

.batch-modal.is-closing .batch-modal-content {
    animation: batchModalOut 0.18s ease-in forwards;
}

.batch-modal.is-closing .batch-modal-backdrop {
    animation: batchBackdropOut 0.18s ease-in forwards;
}

@keyframes batchModalOut {
    from { opacity: 1; transform: scale(1) translateY(0); }
    to { opacity: 0; transform: scale(0.94) translateY(8px); }
}

@keyframes batchBackdropOut {
    from { opacity: 1; }
    to { opacity: 0; }
}

.batch-modal-close {
    position: absolute;
    top: 14px;
    right: 14px;
    background: none;
    border: none;
    color: var(--gray);
    cursor: pointer;
    padding: 4px;
    border-radius: 8px;
    transition: background 0.15s;
}

.batch-modal-close:hover {
    background: #f3f4f6;
}

.batch-modal-icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: linear-gradient(135deg, #fef3c7, #fde68a);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    color: #f59e0b;
}

.batch-modal-content h3 {
    font-size: var(--text-xl);
    font-weight: 700;
    color: var(--gray-dark);
    margin-bottom: 8px;
}

.batch-modal-content p {
    font-size: var(--text-sm);
    color: var(--gray);
    line-height: 1.6;
    margin-bottom: 20px;
}

.batch-modal-btn {
    display: inline-block;
    padding: 14px 32px;
    background: linear-gradient(to bottom, #f472b6, #ec4899);
    color: var(--white);
    border-radius: 50px;
    font-size: var(--text-base);
    font-weight: 600;
    text-decoration: none;
    box-shadow:
        0 4px 0 #be185d,
        0 6px 10px rgba(255, 29, 186, 0.25);
    transition: all 0.15s;
    position: relative;
    top: 0;
}

.batch-modal-btn:hover {
    top: 2px;
    box-shadow:
        0 2px 0 #be185d,
        0 3px 6px rgba(255, 29, 186, 0.2);
}

/* ===== CONFIRM MODAL ===== */
.confirm-modal {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.confirm-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

.confirm-modal-content {
    position: relative;
    background: var(--white);
    border-radius: 20px;
    padding: 32px 28px 24px;
    max-width: 380px;
    width: 90%;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
    animation: batchModalIn 0.25s ease-out;
}

.confirm-modal-icon {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, #fef3c7, #fde68a);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 14px;
    color: #f59e0b;
}

.confirm-modal-content h3 {
    font-size: var(--text-lg);
    font-weight: 700;
    color: var(--gray-dark);
    margin-bottom: 6px;
}

.confirm-modal-content p {
    font-size: var(--text-sm);
    color: var(--gray);
    line-height: 1.6;
    margin-bottom: 20px;
}

.confirm-modal-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.confirm-btn-cancel,
.confirm-btn-ok {
    padding: 12px 28px;
    border-radius: 50px;
    font-family: inherit;
    font-size: var(--text-sm);
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all 0.15s;
    position: relative;
    top: 0;
}

.confirm-btn-cancel {
    background: var(--white);
    color: var(--gray-dark);
    box-shadow:
        0 3px 0 #d1d5db,
        0 5px 10px rgba(0, 0, 0, 0.06);
}

.confirm-btn-cancel:hover {
    top: 2px;
    box-shadow:
        0 1px 0 #d1d5db,
        0 2px 6px rgba(0, 0, 0, 0.04);
}

.confirm-btn-ok {
    background: linear-gradient(to bottom, #f472b6, #ec4899);
    color: var(--white);
    box-shadow:
        0 3px 0 #be185d,
        0 5px 10px rgba(255, 29, 186, 0.25);
}

.confirm-btn-ok:hover {
    top: 2px;
    box-shadow:
        0 1px 0 #be185d,
        0 2px 6px rgba(255, 29, 186, 0.2);
}

/* ===== RESPONSIVE ===== */

/* Mobile: < 480px */
@media (max-width: 479px) {
    

    

    

    .format-btn {
        text-align: center;
    }

    

    .theme-selector {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }

    

    .qty-btn {
        width: 42px;
        height: 42px;
        font-size: var(--text-base);
    }

    .btn-generate {
        max-width: 100%;
        min-height: 66px;
    }

    .cartones-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .btn-action {
        justify-content: center;
    }

    

    
}

/* Tablet: 480-767px */
@media (min-width: 480px) and (max-width: 767px) {
    

    

    .theme-selector {
        grid-template-columns: repeat(3, 1fr);
        gap: 10px;
    }

    

    

    

    

    
}

/* Small desktop: 768-1023px */
@media (min-width: 768px) and (max-width: 1023px) {
    

    

    

    .theme-selector {
        grid-template-columns: repeat(5, 1fr);
        gap: 10px;
    }

    

    

    

    
}

/* Desktop: 1024px+ */

/* ================================================
   STYLE GUIDE ALIGNMENT - BINGU 2026
   ================================================ */

body:has(.cartones-page) {
    background:
        radial-gradient(circle at 9% 16%, rgba(21, 151, 239, 0.13), transparent 30%),
        radial-gradient(circle at 88% 8%, rgba(255, 63, 168, 0.09), transparent 25%),
        linear-gradient(180deg, #ffffff 0%, #f7fbff 48%, #ffffff 100%);
}

.card-branding-section,
#cartonesArea {
    width: 100%;
    max-width: none;
}

.batch-modal-content,
.confirm-modal-content {
    border: 1px solid var(--line);
    border-radius: var(--radius-card);
    background: rgba(255, 255, 255, 0.94);
    box-shadow: 0 18px 44px rgba(18, 60, 118, 0.08);
}

.card-branding-section {
    margin-top: clamp(24px, 3vw, 38px);
}

.batch-btn-cards {
    font-size: clamp(0.88rem, 0.92vw, 0.96rem);
    color: var(--gray);
    font-weight: 700;
}

.format-btn,
.btn-generate,
.btn-action,
.batch-btn,
.batch-modal-btn,
.confirm-btn-cancel,
.confirm-btn-ok {
    min-height: 52px;
    border-radius: var(--radius-control);
    font-size: clamp(0.98rem, 1vw, 1.05rem);
    font-weight: 800;
}

.format-btn {
    padding: 12px 22px;
}

.format-btn.active,
.qty-btn.active,
.batch-btn:not(.locked):not(.brand-batch-btn) {
    background: linear-gradient(180deg, #35b7ff 0%, var(--blue) 100%);
    box-shadow: 0 5px 0 var(--blue-dark), 0 12px 20px rgba(21, 151, 239, 0.24);
}

.theme-selector {
    grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
    gap: 16px;
}

.theme-option {
    border-radius: var(--radius-card);
    border: 1px solid var(--line);
    box-shadow: 0 12px 28px rgba(18, 60, 118, 0.08);
}

.theme-option:hover,
.theme-option.active:hover {
    top: -2px;
    box-shadow: 0 18px 38px rgba(18, 60, 118, 0.13);
}

.theme-option.active {
    outline: 4px solid rgba(255, 63, 168, 0.72);
    box-shadow: 0 18px 38px rgba(255, 63, 168, 0.14);
}

.qty-btn {
    width: 52px;
    height: 52px;
    font-size: 1.05rem;
    font-weight: 800;
}

.btn-generate {
    max-width: none;
    min-height: 60px;
    padding: 16px 30px;
    font-size: clamp(1rem, 1.08vw, 1.12rem);
    text-transform: uppercase;
    background: linear-gradient(180deg, #ff65c2 0%, var(--pink) 100%);
    box-shadow: 0 6px 0 var(--pink-dark), 0 14px 24px rgba(255, 63, 168, 0.28);
}

.btn-action {
    padding: 15px 26px;
    border: 1px solid var(--line);
}

.batch-buttons {
    gap: 12px;
}

.batch-btn {
    padding: 12px 14px;
}

.batch-btn.locked {
    background: #eef3fb;
    color: #7b8799;
    box-shadow: 0 4px 0 #d8e2ef, 0 9px 18px rgba(18, 60, 118, 0.06);
}

.batch-btn-pages {
    font-size: clamp(0.98rem, 1vw, 1.05rem);
}

.batch-btn:not(.locked):not(.brand-batch-btn) .batch-btn-cards {
    color: rgba(245, 250, 255, 0.82);
    opacity: 1;
}

.batch-btn-dot {
    width: 26px;
    height: 26px;
}

.batch-modal-content,
.confirm-modal-content {
    max-width: 480px;
    padding: clamp(32px, 4vw, 44px);
}

.batch-modal-content h3,
.confirm-modal-content h3 {
    font-size: clamp(1.45rem, 2.4vw, 1.9rem);
}

.batch-modal-content p,
.confirm-modal-content p {
    font-size: clamp(0.98rem, 1vw, 1.05rem);
}

@media (max-width: 1023px) {
    

    

    .card-branding-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .card-branding-workbench {
        grid-template-columns: 1fr;
    }

    .brand-ad-row {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 6px;
    }

    .brand-theme-buttons,
    .brand-theme-buttons--image {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 767px) {
    

    

    

    .card-branding-section,
.card-branding-form,
.card-branding-preview {
        padding: 22px;
    }

    .brand-card-top {
        flex-wrap: wrap;
        justify-content: center;
        gap: 10px 8px;
        min-height: 0;
    }

    .brand-card-qr,
    .brand-logo-preview {
        margin-block: -8px 0;
    }

    .brand-card-qr {
        margin-left: 0;
    }

    .brand-logo-preview {
        flex-basis: 104px;
        width: 104px;
    }

    .brand-contact-preview {
        flex: 1 0 100%;
        min-height: 32px;
    }

    .card-branding-btn {
        width: 100%;
    }

    .brand-custom-print-buttons {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .format-btn,
    .btn-generate,
    .btn-action,
    .batch-btn:not(.brand-batch-btn),
    .card-branding-btn,
    .batch-modal-btn,
    .confirm-btn-cancel,
    .confirm-btn-ok {
        min-height: 52px;
        font-size: 1rem;
    }

    .brand-format-buttons button {
        min-height: 38px;
        font-size: clamp(0.82rem, 0.86vw, 0.92rem);
    }

    .brand-custom-print-buttons .batch-btn.brand-batch-btn {
        min-height: 92px;
    }

    .btn-generate {
        min-height: 58px;
        width: 100%;
    }

    .theme-selector {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px;
    }

    

    .qty-btn {
        width: 48px;
        height: 48px;
    }
}

/* ================================================
   PRINT SIDEBAR — Imprime los cartones
   ================================================ */

.card-access-select {
    min-height: 48px;
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 10px 12px;
    font-size: clamp(0.94rem, 0.98vw, 1rem);
    font-weight: 700;
    box-shadow: 0 3px 0 #d8e2ef;
}

.batch-card {
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: var(--radius-card);
    background: rgba(255, 255, 255, 0.94);
    box-shadow: 0 10px 24px rgba(18, 60, 118, 0.07);
    border-top: 4px solid var(--blue);
}

.batch-card[data-batch-section="us"] {
    border-top-color: var(--pink);
}

.batch-card[data-batch-section="image"] {
    border-top-color: var(--purple);
}

.batch-flag {
    width: 34px;
    height: 34px;
    border: 2px solid #ffffff;
    box-shadow: 0 0 0 1px var(--line), 0 6px 14px rgba(18, 60, 118, 0.12);
}

.batch-btn-dot {
    display: none;
}

.batch-btn:not(.locked):not(.brand-batch-btn) .batch-btn-icon {
    margin-left: auto;
}

.batch-modal-icon {
    background: linear-gradient(135deg, var(--blue-soft), #ffffff);
    color: var(--blue-dark);
    box-shadow: 0 0 0 6px rgba(21, 151, 239, 0.1);
}

.batch-modal-content h3 {
    font-weight: 900;
}

.batch-modal-btn {
    min-height: 54px;
    padding: 14px 28px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    background: linear-gradient(180deg, #ff65c2 0%, var(--pink) 100%);
    box-shadow: 0 5px 0 var(--pink-dark), 0 12px 22px rgba(255, 63, 168, 0.24);
}

/* ===== CARD PACKS (puntuales) ===== */

/* ======================= PARTE 2: diseño 2026 ======================= */

body:has(.ct) { background: var(--b-bg); }
.ct { width: var(--b-max); margin: 0 auto; padding: 36px 0 80px; }
.ct-head h1 { font-size: var(--b-fs-h1, clamp(34px, 3.4vw, 50px)); font-weight: 800; line-height: 1.05; }
.ct-head p { margin-top: 8px !important; color: var(--b-muted); font-size: var(--b-fs-lead, 20px); }
.ct .visually-hidden {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

/* ---- Anular los estilos antiguos de los controles ---- */
#ctTool :is(.format-btn, .theme-option, .image-pack-option, .image-card-theme-option, .qty-btn, .btn-generate,
            .batch-card, .batch-buttons, .batch-btn, .batch-btn-info, .batch-btn-pages, .batch-btn-cards,
            .batch-btn-icon, .batch-btn-lock, .batch-btn-dot) {
    all: revert;
    box-sizing: border-box;
}
#ctTool :is(.format-btn, .theme-option, .image-pack-option, .image-card-theme-option, .qty-btn, .btn-generate, .batch-btn)::before,
#ctTool :is(.format-btn, .theme-option, .image-pack-option, .image-card-theme-option, .qty-btn, .btn-generate, .batch-btn)::after {
    content: none;
}
#ctTool [hidden] { display: none !important; }

/* ---- Distribución ---- */
.ct-layout { display: grid; grid-template-columns: minmax(0, 1fr) 440px; gap: 24px; align-items: start; margin-top: 28px; }
.ct-steps { display: grid; gap: 20px; }
.ct-label { margin: 0 0 10px !important; font-size: 17px; font-weight: 800; }
.ct-label small { display: block; margin-top: 2px; color: var(--b-muted); font-size: 15px; font-weight: 600; }
.ct-group + .ct-group { margin-top: 18px; }

/* ---- Opción elegible (mismo aspecto que .b-pick; seleccionada = .active, que pone card-ui.js) ---- */
#ctTool .ct-pick {
    position: relative; display: block; width: 100%;
    padding: 16px; border: 3px solid var(--b-line); border-radius: 22px;
    background: var(--b-surface); color: var(--b-text);
    font: inherit; text-align: left; cursor: pointer;
    transition: transform .12s ease, border-color .15s ease, box-shadow .15s ease;
}
#ctTool .ct-pick:hover { border-color: var(--b-line-strong); box-shadow: var(--b-shadow-hover); }
#ctTool .ct-pick:active { transform: scale(.98); }
#ctTool .ct-pick.active { border-color: var(--b-blue); background: var(--b-blue-soft); }
#ctTool .ct-pick:focus-visible { outline: 3px solid var(--b-blue-ink); outline-offset: 2px; }
.ct-check {
    position: absolute; top: -10px; right: -10px; z-index: 2;
    width: 30px; height: 30px; border-radius: 50%;
    display: grid; place-items: center;
    background: var(--b-blue); border: 3px solid var(--b-surface); color: var(--b-text);
    font-size: 15px; font-weight: 800;
    opacity: 0; transform: scale(.6); transition: opacity .15s ease, transform .15s ease;
    pointer-events: none;
}
#ctTool .ct-pick.active .ct-check { opacity: 1; transform: scale(1); }

/* Paso 1: tipo */
.ct-formats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
#ctTool .ct-format { text-align: center; }
.ct-format strong { display: block; font-size: 20px; font-weight: 800; }
.ct-format span:not(.ct-check) { color: var(--b-muted); font-size: 15px; font-weight: 600; }

/* Paso 2: estilo */
.ct-styles { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
#ctTool .ct-style { padding: 8px; }
.ct-style img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: contain; border-radius: 12px; background: var(--b-surface-2); }
/* 90 y 75 bolas: la caja toma la proporción real del cartón (90 apaisado, 75 vertical) sin huecos */
#cardThemeOptions .ct-style img { aspect-ratio: auto; height: auto; }
/* 90 y 75 bolas: 4 estilos por fila (2 en móvil) */
#cardThemeOptions .ct-styles { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.ct-style-name { display: flex; align-items: center; gap: 8px; margin-top: 8px; padding: 0 4px; font-size: 16px; font-weight: 800; }
.ct-dot { width: 12px; height: 12px; border-radius: 50%; flex-shrink: 0; }
.ct-packs { display: flex; flex-wrap: wrap; gap: 8px; }
#ctTool .ct-pack {
    display: inline-flex; align-items: center; gap: 8px; min-height: 48px;
    padding: 4px 14px 4px 6px; border: 3px solid var(--b-line); border-radius: 999px;
    background: var(--b-surface); color: var(--b-text); font: inherit; font-weight: 700; font-size: 16px; cursor: pointer;
}
#ctTool .ct-pack:hover { border-color: var(--b-line-strong); }
#ctTool .ct-pack.active { border-color: var(--b-blue); background: var(--b-blue-soft); }
.ct-pack img { width: 34px; height: 34px; border-radius: 50%; background: var(--b-surface-2); object-fit: contain; }

/* ---- Panel «Tu PDF» ---- */
.ct-panel { position: sticky; top: calc(var(--site-header-h, 80px) + 16px); padding: 22px; }
.ct-panel h2 { font-size: 24px; font-weight: 800; }
.ct-preview {
    margin: 14px 0 18px; height: 230px; border-radius: 20px; display: grid; place-items: center;
    background: radial-gradient(circle at 1px 1px, rgba(26, 26, 46, .08) 1.5px, transparent 0) 0 0 / 20px 20px, linear-gradient(135deg, var(--b-blue-soft), var(--b-pink-soft));
}
.ct-preview img { max-width: 78%; max-height: 190px; padding: 6px; border-radius: 12px; background: #fff; box-shadow: 0 16px 30px -12px rgba(26, 26, 46, .35); }
/* 90/75 bolas: hoja A4 real (4 cartones) tal como sale en el PDF; 20 % más grande que la miniatura base para leerla mejor */
.ct-preview.is-sheet { height: 408px; }
.ct-preview.is-sheet img { max-width: 92%; max-height: 372px; padding: 0; border-radius: 3px; }
/* Leyenda bajo la hoja: solo visible cuando la vista previa es el A4 real */
.ct-preview.is-sheet:has(+ .ct-preview-caption:not([hidden])) { margin-bottom: 8px; }
.ct-preview-caption { margin: 0 0 18px; text-align: center; font-size: 14px; font-weight: 700; color: var(--b-muted); }

/* Cantidades = botones de lote: al pulsar, card-batch.js genera y descarga el PDF */
#ctTool .ct-qty { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
#ctTool .ct-qty-btn {
    position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
    min-height: 74px; padding: 12px 8px; border: 3px solid var(--b-blue); border-radius: 18px;
    background: var(--b-blue-soft); color: var(--b-text); font: inherit; text-align: center; cursor: pointer;
    box-shadow: 0 4px 0 var(--b-blue-dark);
    transition: transform .12s ease, background-color .15s ease, box-shadow .15s ease;
}
#ctTool .ct-qty-btn:hover { background: #fff; box-shadow: 0 4px 0 var(--b-blue-dark), var(--b-shadow-hover); }
#ctTool .ct-qty-btn:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--b-blue-dark); }
#ctTool .ct-qty-btn:focus-visible { outline: 3px solid var(--b-pink); outline-offset: 2px; }
#ctTool .ct-qty-btn .batch-btn-info { display: flex; flex-direction: column; align-items: center; }
#ctTool .ct-qty-btn .batch-btn-pages { font-size: 19px; font-weight: 800; line-height: 1.15; }
#ctTool .ct-qty-btn .batch-btn-cards { color: var(--b-blue-ink); font-size: 14px; font-weight: 700; }
#ctTool .ct-qty-btn :is(.batch-btn-dot, .batch-btn-icon, .batch-btn-lock) { display: none; }
#ctTool .ct-qty-btn.locked { border-color: var(--b-line); background: var(--b-surface-2); color: var(--b-muted); box-shadow: none; }
#ctTool .ct-qty-btn.locked .batch-btn-cards { color: var(--b-muted); }
#ctTool .ct-qty-btn.generating { border-color: var(--b-pink); background: var(--b-pink-soft); box-shadow: none; cursor: progress; }
#ctTool .ct-qty-btn:disabled:not(.generating) { opacity: .55; cursor: not-allowed; }

/* Última opción: cantidad escrita por el usuario (ocupa toda la fila) */
:is(#ctTool, .brand-custom-print) .ct-qty-custom {
    grid-column: 1 / -1; padding: 12px 14px; border: 3px dashed var(--b-blue); border-radius: 18px; background: var(--b-surface);
}
:is(#ctTool, .brand-custom-print) .ct-qty-custom label { display: block; margin-bottom: 8px; font-size: 17px; font-weight: 800; }
:is(#ctTool, .brand-custom-print) .ct-qty-custom-row { display: flex; gap: 10px; }
:is(#ctTool, .brand-custom-print) .ct-qty-custom-input {
    flex: 1 1 0; min-width: 0; height: 56px; padding: 0 14px; border: 3px solid var(--b-line); border-radius: 14px;
    background: #fff; color: var(--b-text); font: inherit; font-size: 22px; font-weight: 800;
}
:is(#ctTool, .brand-custom-print) .ct-qty-custom-input:focus { border-color: var(--b-blue); outline: none; box-shadow: 0 0 0 4px var(--b-blue-soft); }
:is(#ctTool, .brand-custom-print) .ct-qty-custom .ct-qty-go { flex: 0 0 auto; min-height: 56px; padding: 8px 18px; }
:is(#ctTool, .brand-custom-print) .ct-qty-custom .ct-qty-go .batch-btn-pages { font-size: 17px; }
:is(#ctTool, .brand-custom-print) .ct-qty-custom-info { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 10px; min-height: 20px; margin: 8px 0 0 !important; font-size: 15px; font-weight: 700; }
:is(#ctTool, .brand-custom-print) .ct-qty-custom-pages { color: var(--b-blue-ink); }
:is(#ctTool, .brand-custom-print) .ct-qty-custom-max { margin-left: auto; color: var(--b-muted); }
:is(#ctTool, .brand-custom-print) .ct-qty-custom.is-invalid .ct-qty-custom-input { border-color: var(--b-pink); }
:is(#ctTool, .brand-custom-print) .ct-qty-custom.is-invalid .ct-qty-custom-pages { color: var(--b-pink-ink); }
:is(#ctTool, .brand-custom-print) .ct-qty-custom.locked { border-color: var(--b-line); }
:is(#ctTool, .brand-custom-print) .ct-qty-custom.locked .ct-qty-custom-input { background: var(--b-surface-2); cursor: not-allowed; }
/* Junto al último botón (cartones.php, .ct-qty-custom--side): ocupa las dos casillas de la derecha, más compacta */
#ctTool .ct-qty-custom--side { grid-column: span 2; padding: 8px 10px; }
#ctTool .ct-qty-custom--side label { margin-bottom: 6px; font-size: 15px; }
#ctTool .ct-qty-custom--side .ct-qty-custom-row { gap: 8px; }
#ctTool .ct-qty-custom--side .ct-qty-custom-input { height: 46px; padding: 0 10px; font-size: 19px; }
#ctTool .ct-qty-custom--side .ct-qty-go { min-height: 46px; padding: 6px 12px; }
#ctTool .ct-qty-custom--side .ct-qty-go .batch-btn-pages { font-size: 15px; }
#ctTool .ct-qty-custom--side .ct-qty-custom-info { margin-top: 6px !important; font-size: 13px; }
/* Pantallas muy estrechas: no cabe en dos casillas, vuelve a la fila entera */
@media (max-width: 380px) {
    #ctTool .ct-qty-custom--side { grid-column: 1 / -1; }
}
.ct-batch-sub { margin-top: 8px !important; color: var(--b-muted); font-size: 14px; font-weight: 600; text-align: center; }

.ct-allow { margin-top: 14px; font-size: 16px; font-weight: 600; }
.ct-allow b { font-weight: 800; }
.ct-allow small { display: block; margin-top: 2px; color: var(--b-muted); font-size: 14px; }
.ct-meter { margin-bottom: 14px; }
.ct-meter-row { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 10px; font-size: 16px; font-weight: 700; }
.ct-meter-row b { font-size: 18px; }
.ct-meter-bar { height: 12px; margin-top: 8px; border-radius: 999px; background: var(--b-line); overflow: hidden; }
.ct-meter-bar i { display: block; height: 100%; border-radius: inherit; background: var(--b-blue); }
.ct-meter small { margin-top: 4px; }
.ct-lock { margin-top: 14px !important; padding: 14px 16px; border-radius: 16px; background: var(--b-pink-soft); font-size: 16px; font-weight: 600; }
.ct-lock a { color: var(--b-pink-ink); font-weight: 800; }

/* Cartones de muestra en pantalla */
.ct-screen { margin-top: 16px; padding-top: 14px; border-top: 2px solid var(--b-line); }
.ct-screen p { color: var(--b-muted); font-size: 15px; }
.ct-screen p strong { color: var(--b-text); }
.ct-screen-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 10px; }
.ct-screen-qty { display: flex; gap: 6px; }
#ctTool .qty-btn {
    width: 44px; height: 44px; border: 3px solid var(--b-line); border-radius: 14px;
    background: var(--b-surface); color: var(--b-text); font: inherit; font-weight: 800; font-size: 17px; cursor: pointer;
}
#ctTool .qty-btn:hover { border-color: var(--b-line-strong); }
#ctTool .qty-btn.active { border-color: var(--b-blue); background: var(--b-blue-soft); }
#ctTool .btn-generate {
    flex: 1; min-height: 44px; padding: 8px 16px; border: 3px solid var(--b-line); border-radius: 14px;
    background: var(--b-surface); color: var(--b-text); font: inherit; font-weight: 800; font-size: 16px; cursor: pointer;
}
#ctTool .btn-generate:hover { border-color: var(--b-line-strong); box-shadow: var(--b-shadow-hover); }

/* ---- Cartones generados en pantalla (ajustes sobre la parte 1) ---- */
.ct #cartonesArea { margin-top: 28px; }

/* ---- Marca y packs: dentro de .ct-steps, bajo «Estilo del cartón» (en tablet/móvil, tras «Tu PDF») ---- */
.ct-more { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr)); gap: 20px; }
.ct-more-card { display: flex; flex-direction: column; padding: 24px; }
.ct-more-card h2 { font-size: 22px; font-weight: 800; }
.ct-more-card > p { margin-top: 6px !important; color: var(--b-muted); font-size: 17px; }
.ct-rows { list-style: none; padding: 0; margin: 14px 0 18px; }
.ct-rows li { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px 12px; padding: 10px 0; border-bottom: 1px solid var(--b-line); font-size: 17px; font-weight: 600; }
.ct-rows li:last-child { border-bottom: 0; }
.ct-rows strong { font-weight: 800; white-space: nowrap; }
.ct-pack-buy { display: inline-flex; align-items: center; gap: 12px; }
.ct-pack-btn { min-height: 40px; padding: 6px 14px; font-size: 15px; }
.ct-more-card > .b-btn { align-self: flex-start; margin-top: auto; }

/* El taller de marca solo aparece al abrirlo desde «Cartones con tu marca» */
.ct .card-branding-section.is-collapsed { display: none; }
.ct .card-branding-section { max-width: none; margin-top: 24px; }

@media (max-width: 1100px) {
    .ct-layout { grid-template-columns: 1fr; }
    .ct-panel { position: static; }
    /* Una sola columna: los pasos se reparten en la rejilla para que marca y packs queden después de «Tu PDF» */
    .ct-steps { display: contents; }
    .ct-more { order: 1; }
}
@media (max-width: 640px) {
    .ct { padding-top: 22px; }
    .ct-formats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .ct-styles,
    #cardThemeOptions .ct-styles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
    .ct-more { grid-template-columns: 1fr; }
    .ct-more-card > .b-btn { align-self: stretch; }
    .ct-panel { padding: 18px 14px; }
}

/* ---- Taller de marca: vista previa vectorial (mismo dibujo que el PDF, card-vector-pdf.js) ---- */
.brand-vector-preview { width: 100%; max-width: 760px; margin: 0 auto; }
.brand-vector-preview[data-format="us"] { max-width: 400px; }
.brand-vector-preview canvas { display: block; width: 100%; height: auto; filter: drop-shadow(0 14px 22px rgba(15, 23, 42, .16)); }
.brand-vector-note { margin: 12px 0 0; color: var(--b-muted, #5b6474); font-size: 14px; font-weight: 700; text-align: center; }
.brand-vector-preview[hidden], .brand-card-preview[hidden] { display: none !important; }
.brand-custom-print .brand-qty-custom { margin-top: 14px; }
.brand-custom-print .brand-qty-custom .ct-qty-go {
    display: flex; align-items: center; justify-content: center; flex: 0 0 auto; width: auto; min-width: 0;
    min-height: 56px; padding: 8px 18px; border: none; border-radius: var(--brand-primary-btn-radius, 14px);
    background: var(--brand-primary-btn-bg, var(--b-pink)); color: #fff; font: inherit; font-weight: 900;
    box-shadow: var(--brand-primary-btn-shadow, none); cursor: pointer;
}
.brand-custom-print .brand-qty-custom .ct-qty-go .batch-btn-pages { color: #fff; font-size: 17px; }
.brand-custom-print .brand-qty-custom .ct-qty-go:disabled { opacity: .5; cursor: not-allowed; }

/* ---- Cartones personalizados: botones de cantidad con el texto centrado (sin hueco vacío debajo) ---- */
.brand-custom-print-buttons .batch-btn.brand-batch-btn {
    justify-content: center;
    align-items: center;
    min-height: 74px;
    padding: 12px 10px;
    text-align: center;
}
.brand-custom-print-buttons .batch-btn.brand-batch-btn .batch-btn-info { align-items: center; gap: 3px; }
.brand-custom-print-buttons .batch-btn.brand-batch-btn:not(:disabled):not(.generating) .batch-btn-pages { font-size: 19px; line-height: 1.15; }

/* ---- Confirmación de descarga con barras de consumo (card-usage-confirm.js) ---- */
.ct-meter-bar i.is-growing { transition: width 1.1s cubic-bezier(.22, .9, .3, 1); }
body.ct-confirm-open { overflow: hidden; }
.ct-confirm { position: fixed; inset: 0; z-index: 10050; display: grid; place-items: center; padding: 16px; }
.ct-confirm[hidden] { display: none; }
.ct-confirm-backdrop { position: absolute; inset: 0; background: rgba(15, 23, 42, .55); }
.ct-confirm-box {
    position: relative; width: min(100%, 460px); max-height: calc(100vh - 32px); overflow-y: auto;
    padding: 28px 26px 24px; border-radius: 24px; background: #fff; color: var(--b-text, #1a1a2e);
    box-shadow: 0 30px 60px -20px rgba(15, 23, 42, .45);
    font-family: inherit; animation: ct-confirm-in .22s ease-out;
}
@keyframes ct-confirm-in { from { opacity: 0; transform: translateY(12px) scale(.97); } to { opacity: 1; transform: none; } }
.ct-confirm-title { margin: 0; font-size: 24px; font-weight: 800; line-height: 1.2; }
.ct-confirm-pages { margin: 6px 0 0; color: var(--b-blue-ink, #0b7bb5); font-size: 16px; font-weight: 800; }
.ct-confirm-text { margin: 14px 0 18px; font-size: 17px; font-weight: 600; line-height: 1.4; color: var(--b-muted, #556); }
.ct-confirm-text.is-error { color: #c62828; font-weight: 800; }
.ct-confirm-meter { margin-bottom: 16px; }
.ct-confirm-meter small { display: block; margin-top: 5px; font-size: 15px; font-weight: 700; color: var(--b-muted, #556); }
.ct-confirm-bar { position: relative; height: 16px; }
.ct-confirm-bar i { position: absolute; top: 0; bottom: 0; left: 0; border-radius: 999px; }
.ct-confirm-bar i.ct-confirm-used { background: var(--b-blue, #1abcf5); z-index: 1; }
/* Lo que se va a gastar: tramo rosa rayado a continuación de lo ya usado */
.ct-confirm-bar i.ct-confirm-add {
    background: repeating-linear-gradient(-45deg, var(--b-pink, #ff3fa8) 0 6px, #ff8cc8 6px 12px);
    animation: ct-confirm-pulse 1.2s ease-in-out infinite;
    transition: opacity .4s ease;
}
.ct-confirm-bar i.ct-confirm-add.is-done { opacity: 0; animation: none; }
@keyframes ct-confirm-pulse { 50% { opacity: .55; } }
.ct-confirm[data-state="done"] .ct-confirm-bar i.ct-confirm-used { background: linear-gradient(90deg, var(--b-blue, #1abcf5), #2fbf71); }
.ct-confirm-actions { display: flex; gap: 10px; margin-top: 22px; }
.ct-confirm-btn {
    flex: 1 1 0; min-height: 56px; padding: 10px 16px; border: 0; border-radius: 16px;
    font: inherit; font-size: 18px; font-weight: 800; cursor: pointer;
    transition: transform .12s ease, box-shadow .15s ease, opacity .15s ease;
}
.ct-confirm-btn[hidden] { display: none; }
.ct-confirm-btn--ghost { background: var(--b-surface-2, #f1f4f9); color: var(--b-text, #1a1a2e); box-shadow: 0 3px 0 var(--b-line, #d8e2ef); }
.ct-confirm-btn--ok { background: linear-gradient(180deg, #35b7ff 0%, var(--b-blue, #1abcf5) 100%); color: #fff; box-shadow: 0 4px 0 var(--b-blue-dark, #0b7bb5); }
.ct-confirm-btn:active:not(:disabled) { transform: translateY(3px); box-shadow: none; }
.ct-confirm-btn:focus-visible { outline: 3px solid var(--b-pink, #ff3fa8); outline-offset: 2px; }
.ct-confirm-btn:disabled { opacity: .55; cursor: not-allowed; }
.ct-confirm-btn--ok.is-busy { cursor: progress; opacity: .8; }
@media (prefers-reduced-motion: reduce) {
    .ct-confirm-box, .ct-confirm-bar i.ct-confirm-add { animation: none; }
    .ct-meter-bar i.is-growing { transition-duration: .01s; }
}
@media (max-width: 480px) {
    .ct-confirm-box { padding: 22px 18px 18px; }
    .ct-confirm-title { font-size: 21px; }
    .ct-confirm-actions { flex-direction: column-reverse; }
}
