/* marcas.html and marcas-panel.html (WP-F2). Tokens from css/tokens.css so light
   ([data-theme="light"]) and dark both work; the preview frames reuse the live card CSS
   (css/styles.css .product-card, css/ads.css units). Mobile first (390 px). */

.marcas-page {
    min-height: 100vh;
    background: var(--surface-app);
    color: var(--text-primary);
}

.marcas-container {
    width: 100%;                       /* body is a flex column in styles.css: never size to content */
    box-sizing: border-box;
    max-width: 820px;
    margin: 0 auto;
    padding: 1rem 16px 2rem;
    text-align: left;
}

.marcas-top {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.marcas-back {
    color: var(--text-link, #60a5fa);
    font-weight: 600;
    text-decoration: none;
}

.marcas-top-title {
    flex: 1 1 auto;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.marcas-theme {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid var(--border-medium);
    background: transparent;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.marcas-main {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.marcas-main h1,
.marcas-main h2,
.marcas-main h3 {
    color: var(--text-heading);
    text-align: left;
}

.marcas-hero h1 {
    margin: 0.25rem 0 0.75rem;
    font-size: 1.65rem;
    line-height: 1.2;
}

.marcas-lead {
    margin: 0 0 1rem;
    color: var(--text-secondary);
    line-height: 1.55;
}

.marcas-card {
    padding: 1.1rem 1rem;
    border-radius: var(--radius-lg, 20px);
    background: var(--surface-card-inverse);
    border: 1px solid var(--border-subtle);
    line-height: 1.5;
}

.marcas-card h2 {
    margin: 0 0 0.5rem;
    font-size: 1.2rem;
}

.marcas-card h3 {
    margin: 1.25rem 0 0.5rem;
    font-size: 1rem;
}

.marcas-muted {
    margin: 0 0 0.5rem;
    color: var(--text-secondary);
}

.marcas-small {
    font-size: 0.8rem;
}

.marcas-note {
    color: var(--warning-primary, #f59e0b);
}

.marcas-sr {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

.marcas-main a {
    color: var(--text-link, #60a5fa);
}

.marcas-preview,
.marcas-report {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.marcas-preview[hidden],
.marcas-report[hidden] {
    display: none;
}

.marcas-teaser .marcas-btn,
.marcas-card > .marcas-btn {
    margin: 0.25rem 0 0.75rem;
}

/* overview numbers */
.marcas-overview {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.marcas-stat {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    padding: 0.75rem 0.9rem;
    border-radius: var(--radius-md, 12px);
    background: var(--surface-control);
    border: 1px solid var(--border-subtle);
}

.marcas-stat-value {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--text-heading);
}

.marcas-stat-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.marcas-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.marcas-chip,
.marcas-tag {
    display: inline-flex;
    padding: 0.15rem 0.55rem;
    border-radius: var(--radius-full, 9999px);
    border: 1px solid var(--border-medium);
    font-size: 0.78rem;
    color: var(--text-primary);
}

.marcas-tag {
    font-size: 0.7rem;
    color: var(--danger-text, #f43f5e);
    border-color: currentColor;
}

/* picker */
.marcas-search input {
    width: 100%;
    box-sizing: border-box;
    min-height: 48px;
    padding: 0.7rem 1rem;
    border-radius: var(--radius-full, 9999px);
    border: 1px solid var(--border-medium);
    background: var(--surface-control);
    color: var(--text-primary);
    font-size: 1rem;
}

.marcas-search input:focus-visible {
    outline: 2px solid var(--brand-primary, #2563eb);
    outline-offset: 2px;
}

.marcas-results {
    list-style: none;
    margin: 0.5rem 0 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.marcas-result {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.15rem;
    padding: 0.65rem 0.9rem;
    border-radius: var(--radius-md, 12px);
    border: 1px solid var(--border-subtle);
    background: var(--surface-control);
    color: var(--text-primary);
    text-align: left;
    cursor: pointer;
}

.marcas-result:hover,
.marcas-result:focus-visible {
    border-color: var(--brand-primary, #2563eb);
}

.marcas-result-name {
    font-weight: 700;
}

.marcas-result-meta {
    font-size: 0.8rem;
    color: var(--text-secondary);
    overflow-wrap: anywhere;
}

/* brand + products */
.marcas-brand-name {
    font-size: 1.4rem !important;
    overflow-wrap: anywhere;
}

.marcas-cat {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0.25rem 0 0.75rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.marcas-cat select {
    flex: 1 1 auto;
    min-width: 0;
    min-height: 40px;
    padding: 0 0.6rem;
    border-radius: var(--radius-md, 12px);
    border: 1px solid var(--border-medium);
    background: var(--surface-control);
    color: var(--text-primary);
}

.marcas-details summary {
    cursor: pointer;
    font-weight: 600;
    min-height: 32px;
}

.marcas-products {
    list-style: none;
    margin: 0.5rem 0;
    padding: 0;
}

.marcas-products li {
    display: flex;
    flex-direction: column;
    padding: 0.45rem 0;
    border-bottom: 1px solid var(--border-subtle);
}

.marcas-product-name {
    overflow-wrap: anywhere;
}

.marcas-product-meta {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.marcas-position {
    margin: 0.75rem 0;
    padding: 0.75rem 0.9rem;
    border-radius: var(--radius-md, 12px);
    border-left: 4px solid var(--brand-primary, #2563eb);
    background: var(--surface-control);
}

.marcas-position p {
    margin: 0 0 0.35rem;
}

.marcas-measuring,
.marcas-demo-banner {
    padding: 0.8rem 1rem;
    border-radius: var(--radius-md, 12px);
    border: 1px solid var(--warning-primary, #f59e0b);
    background: rgba(245, 158, 11, 0.1);
    color: var(--text-primary);
    line-height: 1.45;
}

.marcas-demo-banner {
    margin-bottom: 1rem;
}

.marcas-demo-banner[hidden] {
    display: none;
}

/* placement tabs + phone frame */
.marcas-tabs {
    display: flex;
    gap: 0.4rem;
    overflow-x: auto;
    padding: 0.35rem 0.35rem 0.6rem;
    margin: 0.5rem -0.35rem;
    scroll-padding-inline: 0.35rem;
    scrollbar-width: thin;
}

.marcas-tab {
    flex: 0 0 auto;
    min-height: 40px;
    padding: 0 0.9rem;
    border-radius: var(--radius-full, 9999px);
    border: 1px solid var(--border-medium);
    background: transparent;
    color: var(--text-primary);
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    white-space: nowrap;
}

.marcas-tab.is-active {
    background: var(--brand-primary, #2563eb);
    border-color: var(--brand-primary, #2563eb);
    color: #fff;
}

.marcas-placement-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.5rem;
}

.marcas-placement-head h3 {
    margin: 0.5rem 0 0.25rem;
}

.marcas-placement-key {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.marcas-price {
    margin: 0 0 0.6rem;
    font-size: 0.92rem;
    font-weight: 700;
    color: var(--success-text, #10b981);
}

.marcas-phone {
    position: relative;
    max-width: 360px;
    margin: 0 auto 0.75rem;
    border-radius: 28px;
    border: 6px solid var(--color-slate-700, #334155);
    background: var(--surface-app);
    overflow: hidden;
}

.marcas-phone-bar {
    padding: 0.5rem 0.9rem;
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-subtle);
}

.marcas-screen {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 0.6rem;
    min-height: 180px;
}

/* nothing inside the mock screen is interactive, except "¿Por qué veo esto?" */
.marcas-screen * {
    pointer-events: none;
}

.marcas-screen [data-ad-why] {
    pointer-events: auto;
}

/* The live site's card rules are injected by js/app.js (not loaded here): the same values,
   scoped to the preview screen, so the sponsored card looks exactly like on the site. */
.marcas-screen .product-card {
    display: flex;
    flex-direction: column;
    padding: 0.5rem 1rem;
    margin: 0 0 0.2rem;
    background: var(--surface-card-inverse);
    border-radius: 8px;
    box-shadow: 0 2px 4px var(--shadow-subtle);
    animation: none;
    opacity: 1;
    transform: none;
}

.marcas-screen .product-card-main {
    display: flex;
    align-items: center;
    width: 100%;
}

.marcas-screen .product-image {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 6px;
    margin-right: 1rem;
    flex-shrink: 0;
    background: var(--surface-card-muted);
}

.marcas-screen .product-details {
    flex: 1;
    min-width: 0;
}

.marcas-screen .product-name {
    font-weight: 600;
    color: var(--text-strong);
    margin-bottom: 0.25rem;
    font-size: 0.9rem;
    overflow-wrap: anywhere;
}

.marcas-screen .product-price-center {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 4px;
    margin-top: 0.25rem;
}

.marcas-screen .product-price {
    color: var(--success-primary);
    font-weight: 500;
    font-size: 0.75rem;
}

.marcas-screen .product-price-chain {
    color: var(--text-secondary);
    font-weight: 500;
}

.marcas-screen .product-price-multibuy {
    color: var(--warning-primary, #ca8a04);
    font-weight: 600;
    white-space: nowrap;
}

.marcas-screen .ver-mas-btn {
    background: var(--brand-primary) !important;
    color: #fff !important;
    border: 1px solid var(--border-subtle);
    padding: 4px 6px;
    border-radius: 4px;
    font-size: 0.7rem;
    line-height: 1.1;
    white-space: nowrap;
}

.marcas-screen .product-actions {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    background: var(--surface-card-muted);
    padding: 0.25rem;
    border-radius: 6px;
    margin-left: 0.5rem;
}

.marcas-screen .add-btn {
    background: var(--brand-primary);
    color: var(--text-on-inverse);
    border: none;
    width: 28px;
    height: 28px;
    border-radius: 4px;
    font-weight: 600;
    font-size: 1rem;
}

.marcas-screen .product-details-expanded {
    display: none !important;
}

.marcas-mock-search {
    min-height: 40px;
    padding: 0.55rem 1rem;
    border-radius: var(--radius-full, 9999px);
    border: 1px solid var(--brand-primary, #2563eb);
    background: var(--surface-control);
    color: var(--text-primary);
    font-size: 0.95rem;
}

.marcas-mock-title {
    font-weight: 700;
    color: var(--text-heading);
    font-size: 0.95rem;
    overflow-wrap: anywhere;
}

.marcas-mock-results,
.marcas-mock-cart {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.marcas-mock-cart .cart-item {
    padding: 0.55rem 0.7rem;
    border-radius: var(--radius-md, 12px);
    border: 1px solid var(--border-subtle);
    background: var(--surface-card);
}

.marcas-mock-deal {
    display: flex;
    flex-direction: column;
    padding: 0.55rem 0.7rem;
    border-radius: var(--radius-md, 12px);
    border: 1px solid var(--border-subtle);
    background: var(--surface-card);
    font-size: 0.85rem;
}

.marcas-mock-deal span + span {
    color: var(--success-text, #10b981);
    font-weight: 700;
}

.marcas-mock-round {
    padding: 1.4rem 0.8rem;
    border-radius: var(--radius-md, 12px);
    border: 1px dashed var(--border-medium);
    text-align: center;
    color: var(--text-secondary);
}

.marcas-mock-grid {
    min-height: 90px;
    border-radius: var(--radius-md, 12px);
    background: repeating-linear-gradient(90deg, var(--surface-control) 0 30%, transparent 30% 34%);
}

.marcas-frame-empty {
    margin: auto 0;
    padding: 1rem;
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.marcas-watermark {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0.5rem;
    text-align: center;
    pointer-events: none;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--warning-primary, #f59e0b);
    opacity: 0.85;
}

.marcas-phone .marcas-screen {
    padding-bottom: 2rem;              /* room for the watermark */
}

.marcas-status {
    margin: 0 0 0.5rem;
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius-md, 12px);
    background: var(--surface-control);
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.marcas-numbers {
    margin: 0;
    padding-left: 1.1rem;
    font-size: 0.88rem;
    color: var(--text-secondary);
}

.marcas-numbers li {
    margin-bottom: 0.35rem;
}

.marcas-numbers strong {
    color: var(--text-heading);
}

.marcas-live {
    margin-top: 1rem;
    text-align: center;
}

/* buttons */
.marcas-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 0 1.2rem;
    border-radius: var(--radius-full, 9999px);
    border: 1px solid var(--brand-primary, #2563eb);
    background: var(--brand-primary, #2563eb);
    color: #fff !important;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
    font-size: 0.95rem;
}

.marcas-btn:hover {
    background: var(--brand-primary-hover, #3b82f6);
}

.marcas-btn[disabled] {
    opacity: 0.6;
    cursor: default;
}

.marcas-btn-ghost {
    background: transparent;
    color: var(--text-link, #60a5fa) !important;
}

.marcas-btn-danger {
    border-color: var(--danger-primary, #e11d48);
    background: transparent;
    color: var(--danger-text, #f43f5e) !important;
}

.marcas-cta-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 0.75rem 0;
}

.marcas-rules ul,
.marcas-teaser-list {
    padding-left: 1.1rem;
    margin: 0 0 0.75rem;
    color: var(--text-secondary);
}

.marcas-rules li,
.marcas-teaser-list li {
    margin-bottom: 0.4rem;
}

.marcas-teaser-list strong {
    color: var(--text-heading);
}

/* report */
.marcas-report-head {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
}

.marcas-report-head h2 {
    margin: 0 0 0.25rem;
    font-size: 1.4rem;
}

.marcas-kicker {
    margin: 0;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-secondary);
}

.marcas-table-wrap {
    overflow-x: auto;
    margin: 0 -0.25rem 0.5rem;
}

.marcas-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8rem;
}

.marcas-table th,
.marcas-table td {
    padding: 0.4rem 0.35rem;
    border-bottom: 1px solid var(--border-subtle);
    text-align: left;
    vertical-align: top;
    color: var(--text-primary);
}

.marcas-table th {
    color: var(--text-secondary);
    font-weight: 700;
}

.marcas-table .num {
    text-align: right;
    white-space: nowrap;
}

.marcas-report-doc ul {
    padding-left: 1.1rem;
}

.marcas-report-doc h4 {
    margin: 1rem 0 0.35rem;
    font-size: 0.9rem;
    color: var(--text-heading);
    overflow-wrap: anywhere;
}

.marcas-cell-note {
    display: block;
    font-size: 0.7rem;
    color: var(--text-secondary);
    white-space: normal;
}

.marcas-table td .marcas-cell-note {
    text-align: inherit;
}

.marcas-table .marcas-row-main td {
    border-bottom: none;
    padding-bottom: 0.1rem;
}

.marcas-table .marcas-subrow td {
    padding-top: 0;
    font-size: 0.72rem;
    color: var(--text-secondary);
}

/* light theme: styles.css paints some text for the dark hero */
[data-theme="light"] .marcas-main h1,
[data-theme="light"] .marcas-main h2,
[data-theme="light"] .marcas-main h3 {
    color: var(--color-slate-900, #0f172a) !important;
}

[data-theme="light"] .marcas-main a:not(.marcas-btn),
[data-theme="light"] .marcas-back {
    color: var(--color-blue-700, #1d4ed8);
}

[data-theme="light"] .marcas-btn-ghost {
    color: var(--color-blue-700, #1d4ed8) !important;
}

[data-theme="light"] .marcas-phone {
    border-color: var(--color-slate-300, #cbd5e1);
}

[data-theme="light"] .marcas-price,
[data-theme="light"] .marcas-mock-deal span + span {
    color: #047857;
}

[data-theme="light"] .marcas-note,
[data-theme="light"] .marcas-watermark {
    color: #b45309;
    opacity: 1;              /* 5.0:1 on the white mock; at 0.85 it was 3.9:1 */
}

/* "llevando N" is the disclosure a multi-buy price needs: js/app.js darkens it on the live
   site, but app.js does not run on marcas.html, so the preview carries the same override
   (#92400e on white: 7.1:1; the amber token was 2.2:1). */
[data-theme="light"] .marcas-screen .product-price-multibuy {
    color: #92400e;
}

@media (min-width: 768px) {
    .marcas-hero h1 {
        font-size: 2.1rem;
    }

    .marcas-card {
        padding: 1.5rem 1.75rem;
    }

    .marcas-overview {
        flex-direction: row;
    }

    .marcas-overview .marcas-stat {
        flex: 1 1 0;
    }
}

/* marcas-panel.html */
.panel-state {
    text-align: center;
    padding: 2rem 1rem;
}

.panel-tabs {
    display: flex;
    gap: 0.4rem;
    overflow-x: auto;
    /* room for the focus ring: an overflow container clips anything outside its padding box */
    padding: 0.35rem 0.35rem 0.5rem;
    margin-inline: -0.35rem;
    scroll-padding-inline: 0.35rem;
}

/* more tabs than fit (the admin's seven): fade the right edge until it is scrolled to the end */
.panel-tabs.is-scrollable:not(.is-at-end) {
    -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 2.5rem), transparent);
    mask-image: linear-gradient(to right, #000 calc(100% - 2.5rem), transparent);
}

.panel-form input[readonly] {
    opacity: 0.7;
    cursor: not-allowed;
    border-style: dashed;
}

.panel-owed {
    margin: 0.35rem 0;
    padding-left: 1.1rem;
    color: var(--warning-primary, #ca8a04);
}

.panel-form {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.panel-form label {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    font-size: 0.88rem;
    color: var(--text-secondary);
}

.panel-form input,
.panel-form select,
.panel-form textarea {
    min-height: 44px;
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius-md, 12px);
    border: 1px solid var(--border-medium);
    background: var(--surface-control);
    color: var(--text-primary);
    font-size: 1rem;
    box-sizing: border-box;
    width: 100%;
}

.panel-form input:focus-visible,
.panel-form select:focus-visible {
    outline: 2px solid var(--brand-primary, #2563eb);
    outline-offset: 1px;
}

.panel-error {
    margin: 0;
    color: var(--danger-text, #f43f5e);
    font-size: 0.88rem;
}

.panel-ok {
    margin: 0;
    color: var(--success-text, #10b981);
    font-size: 0.88rem;
}

.panel-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.panel-item {
    padding: 0.8rem 0.9rem;
    border-radius: var(--radius-md, 12px);
    border: 1px solid var(--border-subtle);
    background: var(--surface-control);
}

.panel-item-head {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.4rem;
}

.panel-item-head strong {
    overflow-wrap: anywhere;
}

.panel-status {
    display: inline-flex;
    padding: 0.1rem 0.55rem;
    border-radius: var(--radius-full, 9999px);
    border: 1px solid var(--border-medium);
    font-size: 0.75rem;
    font-weight: 700;
    white-space: nowrap;
}

.panel-status-scheduled,
.panel-status-active {
    border-color: var(--success-text, #10b981);
    color: var(--success-text, #10b981);
}

.panel-status-pending_payment,
.panel-status-pending_review {
    border-color: var(--warning-primary, #f59e0b);
    color: var(--warning-primary, #f59e0b);
}

.panel-status-rejected,
.panel-status-ended {
    color: var(--text-secondary);
}

.panel-checks {
    list-style: none;
    margin: 0.5rem 0;
    padding: 0;
    font-size: 0.82rem;
}

.panel-checks li::before {
    content: "✓ ";
    color: var(--success-text, #10b981);
}

.panel-checks li.is-fail::before {
    content: "✗ ";
    color: var(--danger-text, #f43f5e);
}

.panel-checks li.is-warn::before {
    content: "! ";
    color: var(--warning-primary, #f59e0b);
}

.panel-weeks {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(92px, 1fr));
    gap: 0.4rem;
}

.panel-week {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.1rem;
    min-height: 52px;
    padding: 0.35rem;
    border-radius: var(--radius-md, 12px);
    border: 1px solid var(--border-medium);
    background: transparent;
    color: var(--text-primary);
    font-size: 0.8rem;
    cursor: pointer;
}

.panel-week small {
    color: var(--text-secondary);
}

.panel-week.is-selected {
    border-color: var(--brand-primary, #2563eb);
    background: var(--brand-overlay-medium, rgba(59, 130, 246, 0.2));
}

.panel-week[disabled] {
    opacity: 0.45;
    cursor: not-allowed;
    text-decoration: line-through;
}

.panel-products {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    max-height: 260px;
    overflow-y: auto;
}

.panel-products label {
    flex-direction: row;
    align-items: flex-start;
    gap: 0.5rem;
    color: var(--text-primary);
}

.panel-products input {
    width: auto;
    min-height: 0;
    margin-top: 0.2rem;
}

/* a product the selected space cannot show (P9 and food/drinks): listed, not selectable */
.panel-products label.is-disabled {
    color: var(--text-secondary);
    cursor: not-allowed;
}

.panel-products label.is-disabled .marcas-tag {
    margin-left: 0.25rem;
    vertical-align: 0.05em;
}

.panel-summary {
    padding: 0.8rem 0.9rem;
    border-radius: var(--radius-md, 12px);
    border: 1px solid var(--border-medium);
}

.panel-summary p {
    margin: 0 0 0.3rem;
}

.panel-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}

@media print {
    .marcas-top,
    .marcas-hero,
    .marcas-picker,
    .marcas-preview,
    .marcas-cta,
    .marcas-rules,
    .marcas-demo-banner,
    .footer,
    #marcas-print {
        display: none !important;
    }

    .marcas-page,
    .marcas-card,
    .marcas-report-doc {
        background: #fff !important;
        color: #000 !important;
        border: none !important;
    }

    /* every text in the report prints black: in the dark theme <strong>, h4 and the muted
       notes keep light theme colours otherwise and vanish on paper */
    .marcas-report-doc,
    .marcas-report-doc *,
    .marcas-table th,
    .marcas-table td {
        color: #000 !important;
    }

    .marcas-table th,
    .marcas-table td {
        border-bottom: 1px solid #999;
    }

    .marcas-table-wrap {
        overflow: visible;
    }

    .marcas-report {
        display: block !important;
    }

    /* marcas-panel.html: print only the open report */
    #panel-tabs,
    #panel-flash,
    .panel-report-back,
    [data-section]:not([data-section="informe"]) {
        display: none !important;
    }
}

/* P4 frame: the substitutes panel styles live in shopping-list.html (not loaded here) */
.marcas-screen .substitute-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    padding: 0.55rem 0.7rem;
    border-radius: 8px;
    background: var(--surface-card-inverse);
}

.marcas-screen .substitute-name {
    font-weight: 600;
    color: var(--text-strong);
    overflow-wrap: anywhere;
}

.marcas-screen .substitute-price {
    color: var(--success-primary);
    font-weight: 600;
}

.marcas-table th.num {
    white-space: normal;
}

.panel-form fieldset,
fieldset.panel-form {
    margin: 0;
    padding: 0.75rem;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md, 12px);
    min-width: 0;
}

fieldset.panel-form legend {
    padding: 0 0.35rem;
    font-size: 0.88rem;
    color: var(--text-secondary);
}

.panel-form label.panel-check,
.panel-check {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    gap: 0.5rem;
    color: var(--text-primary);
    font-size: 0.88rem;
}

.panel-check input {
    width: auto !important;
    min-height: 0 !important;
    margin-top: 0.2rem;
}

.panel-item ul {
    margin: 0.35rem 0;
    padding-left: 1.1rem;
}

.panel-note {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    margin: 0.5rem 0;
    font-size: 0.82rem;
    color: var(--text-secondary);
}

.panel-note input,
.panel-item input[type="text"],
.panel-item input[type="number"],
[data-link-out] input {
    min-height: 40px;
    padding: 0.4rem 0.7rem;
    border-radius: var(--radius-md, 12px);
    border: 1px solid var(--border-medium);
    background: var(--surface-control);
    color: var(--text-primary);
    font-size: 0.95rem;
    box-sizing: border-box;
    width: 100%;
}

.panel-weeks {
    margin-bottom: 0.75rem;
}

.panel-row {
    margin-top: 0.5rem;
}

.panel-item .panel-checks {
    padding-left: 0;
}

.marcas-main .panel-state h1 {
    text-align: center;
    font-size: 1.6rem;
}

/* Prices in the mock screens (re-verification of nit n9): --success-primary (#059669) is 3.8:1 on
   the mock cards in both themes at these small sizes. The live site's price colours live in
   styles.css and ads.css (coordinator follow-up); the preview uses green-400 in dark (7.6:1 on
   #1e293b) and green-700 in light (5.5:1 on white, 5.0:1 on #f1f5f9). */
.marcas-screen .product-price,
.marcas-screen .substitute-price,
.marcas-screen .ad-deal-price,
.marcas-screen .ad-cart-price {
    color: #34d399;
}

[data-theme="light"] .marcas-screen .product-price,
[data-theme="light"] .marcas-screen .substitute-price,
[data-theme="light"] .marcas-screen .ad-deal-price,
[data-theme="light"] .marcas-screen .ad-cart-price {
    color: #047857;
}
