@font-face {
    font-family: Montserrat;
    src: url("../media/admin/montserrat-2.ttf") format("truetype");
    font-weight: 600;
    font-display: swap;
}
@font-face {
    font-family: Montserrat;
    src: url("../media/admin/montserrat-3.ttf") format("truetype");
    font-weight: 700;
    font-display: swap;
}

:root {
    color-scheme: light;
    --ink: #0b1929;
    --muted: #4a5968;
    --line: #dce4ec;
    --frame: #f4f6f8;
    --nav: #0b1929;
    --nav-hover: #172b40;
    --nav-selected: #1b3550;
    --nav-text: #d9e5ef;
    --blue: #006c9e;
    --accent: #0086c4;
    --paper: #fff;
    --headings: Montserrat, system-ui, sans-serif;
    font: 13px/1.5 system-ui, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
body { margin: 0; color: var(--ink); background: var(--frame); }
h1, h2, p { margin: 0; }
h1 { font: 700 24px/1.18 var(--headings); letter-spacing: -.035em; }
h2 { font: 700 15px/1.3 var(--headings); margin: 20px 0 10px; }
a { color: inherit; text-decoration: none; }
small, .muted { color: var(--muted); font-size: 12px; }
small { display: block; }
button, input, textarea, select { font: inherit; color: inherit; }
button, .button {
    display: inline-flex; align-items: center; justify-content: center;
    min-height: 34px; padding: 6px 12px; border: 1px solid #c9d5df;
    border-radius: 7px; background: var(--paper); font-size: 12px; font-weight: 650; cursor: pointer;
}
button:hover, .button:hover { background: #eaf1f4; }
.primary { color: var(--paper); background: var(--blue); border-color: var(--blue); }
.primary:hover { background: #005474; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
[hidden] { display: none !important; }
.sr-only {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0;
}
.skip-link { position: fixed; z-index: 10; left: 12px; top: 12px; background: white; padding: 8px 12px; transform: translateY(-160%); }
.skip-link:focus { transform: none; }
.logo { display: block; object-fit: cover; object-position: center; }
label { display: grid; align-content: start; gap: 5px; font-weight: 600; }
input:not([type=checkbox]), textarea, select {
    min-width: 0; width: 100%; min-height: 36px; padding: 6px 9px;
    border: 1px solid #c6d3de; border-radius: 7px; background: var(--paper); font-weight: 400;
}
textarea { resize: vertical; }
input[readonly] { background: var(--frame); }
.login {
    width: min(440px, calc(100% - 32px)); margin: min(14vh, 120px) auto 36px;
    background: var(--paper); border: 1px solid var(--line); border-radius: 16px; padding: 34px;
}
.login h1 { margin: 25px 0 6px; }
.login-intro { margin-bottom: 20px; color: #b9cad8; }
.login-page { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: #071321; }
.login-shell {
    width: min(860px, 100%); min-height: 400px; display: grid; grid-template-columns: 1.15fr 1fr;
    background: var(--nav); border: 1px solid #2e4458; border-radius: 18px; overflow: hidden;
}
.login-image { background: var(--nav) url("../media/admin/portada.jpg") 55% center / cover no-repeat; }
.login-shell .login { margin: auto; width: 100%; border: 0; padding: 35px; background: transparent; color: var(--paper); }
.login input { background: #14263a; color: white; border-color: #486078; }
.login button { margin-top: 5px; min-height: 38px; }
.stack { display: grid; gap: 13px; }
.frame {
    display: grid; grid-template-columns: 206px minmax(0, 1fr); grid-template-rows: auto 1fr;
    grid-template-areas: "nav header" "nav content"; min-height: 100vh;
}
.top {
    grid-area: header; display: flex; align-items: center; gap: 15px; padding: 8px 24px;
    min-height: 50px; background: var(--paper); border-bottom: 1px solid var(--line);
}
.workspace-title { font: 700 12px/1.3 var(--headings); }
.top .signed-in { margin-left: auto; color: var(--muted); font-size: 12px; }
.mobile-logo, .nav-toggle { display: none; }
.logout { min-height: 30px; }
.sidebar {
    grid-area: nav; display: grid; align-content: start; gap: 17px; padding: 15px 12px;
    background: var(--nav); color: var(--nav-text);
}
.sidebar-brand { padding: 1px 8px 13px; border-bottom: 1px solid #2b4055; }
.nav-group p { color: #a8bdcf; font: 600 11px/1.4 var(--headings); margin: 0 0 5px 9px; }
.nav-links { display: grid; gap: 2px; }
.sidebar a { display: flex; align-items: center; gap: 9px; min-height: 32px; padding: 6px 9px; border-radius: 7px; }
.sidebar a:hover { background: var(--nav-hover); }
.sidebar a[aria-current] { background: var(--nav-selected); color: white; font-weight: 650; }
.sidebar a[aria-current] .nav-icon { color: #69c9f7; }
.nav-icon, .nav-toggle svg, .filter-disclosure svg, .catalog-search svg, .table-delete svg {
    fill: none; stroke: currentColor; stroke-width: 1.65; stroke-linecap: round; stroke-linejoin: round;
    width: 16px; height: 16px; flex-shrink: 0;
}
.sheet {
    grid-area: content; min-width: 0; margin: 14px;
    padding: clamp(15px, 1.8vw, 25px);
    border: 1px solid var(--line); border-radius: 12px; background: var(--paper);
}
.page-description { margin-top: 5px; }
.title, .toolbar, .pager { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; }
.title { justify-content: space-between; margin-bottom: 17px; }
.toolbar { align-items: end; }
.toolbar label { flex: 1 1 140px; min-width: 0; }
.toolbar label:first-of-type { flex-grow: 1.65; }
.catalog-filters {
    grid-template-columns: minmax(220px, 1fr) minmax(320px, 1.45fr);
    gap: 8px 12px; background: var(--frame); border: 1px solid var(--line); border-radius: 9px; padding: 10px;
}
.catalog-search { align-self: end; min-width: 0; }
.search-input { position: relative; }
.search-input svg { position: absolute; left: 9px; top: calc(50% - 8px); color: var(--muted); pointer-events: none; }
.catalog-search input { padding-left: 31px; }
.catalog-filters input, .catalog-filters select { font-size: 12px; min-height: 32px; }
.catalog-filters label { font-size: 11px; gap: 3px; }
.quick-filter-fields { gap: 8px; }
.quick-filter-fields label { flex: 1 1 90px; }
.filter-secondary { grid-column: 1 / -1; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: start; gap: 7px 10px; }
.filter-disclosure { min-width: 0; }
.filter-disclosure summary {
    list-style: none; display: flex; align-items: center; gap: 6px; width: fit-content;
    min-height: 30px; padding: 4px 6px; cursor: pointer; color: var(--ink); font-weight: 650;
}
.filter-disclosure summary::-webkit-details-marker { display: none; }
.filter-disclosure summary::after { content: ""; width: 6px; height: 6px; margin: 0 2px 3px 5px; border: solid currentColor; border-width: 0 1.5px 1.5px 0; transform: rotate(45deg); }
.filter-disclosure[open] summary::after { transform: rotate(225deg); margin-bottom: -3px; }
.filter-disclosure summary:hover { color: var(--blue); }
.quick-filters > summary { display: none; }
.feature-fields { gap: 8px; margin: 5px 0 0 5px; }
.feature-fields label { flex: 1 1 115px; }
.filter-count { color: var(--blue); font-variant-numeric: tabular-nums; }
.filter-actions { justify-content: flex-end; }
.filter-actions .button, .filter-actions button { min-height: 30px; padding-block: 3px; }
.filter-reset { color: var(--muted); border-color: transparent; background: transparent; }
.result-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 15px 0 6px; }
.result-heading h2 { margin: 0; }
.result-count { color: var(--blue); margin-left: 6px; font: 650 12px/1.4 system-ui, sans-serif; font-variant-numeric: tabular-nums; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; text-align: left; }
th, td { padding: 7px 10px; border-bottom: 1px solid var(--line); }
th { color: var(--muted); font-size: 11px; font-weight: 650; background: #f4f6f8; }
tbody tr:hover { background: #f8fbfc; }
td:last-child, th:last-child { text-align: right; }
.identity { display: flex; align-items: center; gap: 9px; }
.identity img { width: 40px; height: 48px; flex-shrink: 0; }
.model-link { color: var(--ink); font-weight: 700; }
.model-link:hover { color: var(--blue); text-decoration: underline; }
.mobile-category { display: none; }
.identity img, .photo-row img { background: var(--frame); object-fit: contain; border-radius: 4px; }
.state { font-size: 11px; padding: 2px 6px; background: var(--frame); border-radius: 5px; white-space: nowrap; }
.published { background: #e8f3ed; color: #20583c; }
.draft { background: #f7efda; color: #684a14; }
.pager { justify-content: flex-end; margin-top: 12px; font-size: 12px; }
.form-panel { padding: 14px; border: 1px solid var(--line); border-radius: 9px; }
.account { max-width: 620px; }
.fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.site-settings h2 { margin: 0; }
.site-settings .fields label:has(textarea, [name="mercadolibre"]) { grid-column: 1 / -1; }
.feature-filters .toolbar label:first-of-type { flex-grow: 1; }
.feature-filters select:disabled { color: var(--muted); background: var(--frame); }
.checks, .check, .checks label { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.photo-row { display: grid; grid-template-columns: 60px minmax(0, 1fr) 100px auto; gap: 12px; align-items: center; }
.photo-row img { width: 60px; height: 75px; }
.brand-identity { display: flex; align-items: center; gap: 10px; }
.brand-logo-tile {
    display: grid; place-items: center; flex: 0 0 auto; width: 86px; height: 35px; padding: 4px 6px;
    border-radius: 6px; background: var(--nav); color: var(--nav-text);
}
.brand-logo-tile img { width: 100%; height: 26px; object-fit: contain; }
.brand-logo-empty { background: var(--frame); color: var(--muted); font-size: 11px; }
.brand-logo-preview { width: 154px; height: 64px; padding: 10px; }
.brand-logo-preview img { height: 44px; }
.notice, .error { border-radius: 6px; padding: 10px 12px; margin-bottom: 16px; background: #e8f1f5; }
.error { color: #891b23; background: #fce8e9; }
.row-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
td .row-actions { justify-content: flex-end; }
.danger { color: #891b23; }
.danger:hover { background: #fce8e9; }
.products-table .row-actions .button { min-height: 29px; padding: 3px 8px; }
.product-site-link { gap: 5px; }
.product-site-link svg {
    width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.7;
    stroke-linecap: round; stroke-linejoin: round;
}
.table-delete { color: var(--muted); }
.table-delete:hover { color: #891b23; }
.table-delete svg { width: 14px; height: 14px; }
.table-delete span { display: none; }
.danger-solid { background: #95252c; border-color: #95252c; color: var(--paper); }
.danger-solid:hover { background: #781c22; }
.category-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 190px), 1fr)); gap: 12px; }
.category-card { overflow: hidden; border: 1px solid var(--line); border-radius: 9px; }
.category-cover { display: block; width: 100%; height: 145px; object-fit: cover; background: var(--nav); }
.category-placeholder { display: grid; place-content: center; color: white; }
.category-card-content { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px; }
.category-card h2 { margin: 0 0 2px; }
.taxonomy-media-fields { min-width: 0; margin: 0; padding: 10px; border: 1px solid var(--line); border-radius: 8px; }
.taxonomy-media-fields legend { padding: 0 4px; font-weight: 650; }
.category-preview { width: 128px; aspect-ratio: 12 / 13; object-fit: cover; border-radius: 5px; }
.directory-search { max-width: 360px; margin-bottom: 16px; }
.directory-group { margin: 0 0 20px; }
.directory-group h2 { margin: 0 0 8px; }
.directory-group h2 span { margin-left: 8px; }
.directory-table th:nth-child(2), .directory-table td:nth-child(2) { text-align: right; font-variant-numeric: tabular-nums; }
.option-maintenance { margin-block: 18px 10px; }
.editor-nav { display: flex; gap: 15px; border-bottom: 1px solid var(--line); }
.editor-nav a { padding: 0 4px 8px; color: var(--blue); font-weight: 650; }
.editor-nav a:hover { text-decoration: underline; }
.editor-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(240px, 29%); gap: 16px; }
.editor-main, .editor-aside { align-content: start; min-width: 0; }
.editor-main section { scroll-margin-top: 14px; }
.section-intro h2 { margin: 0 0 4px; }
.picker { border: 1px solid var(--line); border-radius: 9px; }
.picker summary { padding: 9px 12px; cursor: pointer; font-weight: 650; }
.picker[open] summary { background: #f4f8fa; }
.selection-count { float: right; font-weight: 500; }
.picker-selection {
    margin: 0; padding: 7px 9px; overflow-wrap: anywhere; border-radius: 5px; background: var(--frame);
}
.picker-body { padding: 12px; }
.picker-tools { display: flex; align-items: end; flex-wrap: wrap; gap: 12px; }
.picker-tools label:not(.check) { flex: 1 1 160px; min-width: 0; }
.picker-tools a, .picker-selected-only { padding-block: 8px; font-size: 12px; }
.picker-tools a { color: var(--blue); text-decoration: underline; }
.picker-selected-only { cursor: pointer; gap: 6px; }
.picker-groups { display: grid; gap: 9px; }
.picker-group { min-width: 0; margin: 0; padding: 4px 6px 6px; border: 1px solid var(--line); border-radius: 6px; }
.picker-group legend { padding: 0 5px; color: var(--muted); font-size: 11px; font-weight: 650; }
.picker-options {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 176px), 1fr));
    gap: 3px 6px;
}
.picker-option {
    align-self: stretch; display: grid; grid-template-columns: 14px minmax(0, 1fr); align-content: start;
    gap: 6px; padding: 6px; min-height: 29px; border-radius: 5px; cursor: pointer;
    font-size: 12px; font-weight: 500; line-height: 1.4; overflow-wrap: anywhere;
}
.directory-group[hidden], [data-directory-row][hidden] { display: none; }
.picker-option:has(input:checked) { background: #dcecf1; color: #164d65; }
.picker-option input, .picker-selected-only input { accent-color: var(--blue); margin: 2px 0 0; }
.picker-option input { align-self: start; }
.editor-save {
    position: sticky; bottom: 0; z-index: 2; padding: 9px 0; justify-content: space-between;
    background: var(--paper); border-top: 1px solid var(--line);
}

@media (max-width: 1030px) {
    .editor-layout { grid-template-columns: minmax(0, 1fr); }
    .catalog-filters { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 760px) {
    h1 { font-size: 21px; }
    .frame { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto auto 1fr; grid-template-areas: "header" "nav" "content"; }
    .top { padding: 5px 11px; gap: 8px; background: var(--nav); border: 0; color: white; }
    .mobile-logo { display: block; }
    .top .workspace-title, .top .signed-in { display: none; }
    .top form { margin-left: auto; flex: 0 0 auto; }
    .top button { min-height: 40px; }
    .nav-toggle { display: inline-flex; gap: 5px; background: transparent; color: white; border-color: #49647b; padding-inline: 7px; }
    .logout { background: var(--nav-hover); color: white; border-color: #49647b; padding-inline: 8px; }
    .top button:hover { background: var(--nav-selected); }
    .sidebar { padding: 4px 10px 12px; gap: 10px; }
    .sidebar.is-collapsed, .sidebar-brand { display: none; }
    .nav-group p { margin: 0 0 2px 6px; }
    .nav-links { display: flex; flex-wrap: wrap; }
    .sidebar a { padding: 6px 8px; min-height: 42px; }
    .sheet { margin: 9px; padding: 13px; }
    .title { margin-bottom: 11px; }
    .title .button { min-height: 40px; }
    .sheet:has(.catalog-filters) .page-description { display: none; }
    .fields { grid-template-columns: minmax(0, 1fr); }
    .catalog-filters { padding: 8px; }
    .catalog-filters input, .catalog-filters select { min-height: 38px; }
    .catalog-filters .quick-filters:not([open]) + .filter-secondary:not(:has(details[open])) {
        grid-template-columns: minmax(0, 1fr) auto;
        align-items: center;
    }
    .catalog-filters .quick-filters:not([open]) + .filter-secondary:not(:has(details[open])) .filter-actions {
        justify-content: flex-end;
    }
    .quick-filters > summary { display: flex; }
    .quick-filter-fields { padding: 4px; }
    .filter-secondary { grid-template-columns: minmax(0, 1fr); }
    .filter-actions { justify-content: flex-start; }
    .quick-filter-fields, .feature-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .quick-filter-fields label:first-child { grid-column: 1 / -1; }
    .filter-actions .button, .filter-actions button { min-height: 38px; }
    .filter-disclosure summary { min-height: 40px; }
    th, td { padding: 6px 5px; }
    .identity { gap: 6px; }
    .identity img { width: 30px; height: 42px; }
    .products-table .category-cell, .products-table .state-cell, .products-table thead th:nth-child(3) { display: none; }
    .products-table .mobile-category { display: block; }
    .products-table .row-actions .button { min-height: 42px; padding-inline: 7px; }
    .products-table .row-actions .table-delete { min-width: 38px; }
    .products-table .product-site-link span { display: none; }
    .products-table .row-actions .product-site-link { min-width: 38px; }
    .products-table .row-actions { gap: 4px; }
    .picker-tools { gap: 4px 12px; }
    .picker-tools label:not(.check) { flex-basis: 100%; }
    .picker-options { grid-template-columns: repeat(auto-fit, minmax(min(100%, 125px), 1fr)); }
    .picker-option { min-height: 36px; }
    .category-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .category-cover { height: 104px; }
    .category-card-content { flex-wrap: wrap; }
    .category-card-content .button { min-height: 40px; }
    .photo-row { grid-template-columns: 56px minmax(0, 1fr); }
    .login-shell { display: block; min-height: 0; max-width: 430px; }
    .login-image { height: 120px; }
    .login-shell .login { padding: 24px; }
    .directory-table .row-actions { gap: 4px; }
    .directory-table .button { padding-inline: 8px; }
    .brand-identity { gap: 7px; }
    .brand-identity .brand-logo-tile { width: 64px; }
}

/* Testimonios: misma estructura de formularios y acciones del panel. */
.testimonial-editor { max-width: 850px; }
.testimonial-editor .check { display: flex; align-items: center; gap: 8px; }
.testimonial-list-toolbar { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; margin-bottom: 18px; }
.testimonial-admin-list { display: grid; gap: 12px; }
.testimonial-admin-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 24px; padding: 20px; background: var(--paper); border: 1px solid var(--line); border-radius: 10px; }
.testimonial-admin-row h2 { margin: 0 0 4px; overflow-wrap: anywhere; }
.testimonial-admin-excerpt { margin: 12px 0 8px; max-width: 75ch; overflow-wrap: anywhere; }
.testimonial-admin-actions { display: flex; flex-direction: column; gap: 16px; align-items: flex-end; }
.testimonial-source { display: inline-flex; align-items: center; min-height: 36px; color: var(--blue); text-decoration: underline; text-underline-offset: 3px; }
@media (max-width: 640px) {
  .testimonial-admin-row { grid-template-columns: minmax(0, 1fr); gap: 16px; padding: 16px; }
  .testimonial-admin-actions { flex-direction: row; justify-content: space-between; align-items: center; flex-wrap: wrap; }
  .testimonial-editor .fields { grid-template-columns: minmax(0, 1fr); }
}
