/* Tema «Ferretería Tres Clavos» (#116): eficiente, robusta y directa. Lienzo blanco con bandas grises, tipografía
   condensada, búsqueda dominante, categorías de dos niveles y tarjetas compactas. Todo va bajo .theme-tres-clavos y
   consume los colores de la tienda (--brand, --accent, --on-brand, --on-accent); solo redefine tokens neutros. */

@font-face { font-family: "Barlow Condensed"; font-style: normal; font-weight: 600; font-display: swap; src: url("fonts/barlow-condensed-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Barlow Condensed"; font-style: normal; font-weight: 700; font-display: swap; src: url("fonts/barlow-condensed-latin-700-normal.woff2") format("woff2"); }
@font-face { font-family: "Barlow"; font-style: normal; font-weight: 400; font-display: swap; src: url("fonts/barlow-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Barlow"; font-style: normal; font-weight: 600; font-display: swap; src: url("fonts/barlow-latin-600-normal.woff2") format("woff2"); }

.theme-tres-clavos {
  --soft: #f1f1ef;
  --line: #d6d6d2;
  --line-strong: #a9a9a3;
  --radius: 2px;
  --photo: #fff; /* las fotos van sobre blanco, venga lo que venga el lienzo */
  --font-text: "Barlow", var(--font);
  --font-display: "Barlow Condensed", "Arial Narrow", var(--font);
  font-family: var(--font-text);
  font-size: 15px;
}
.theme-tres-clavos .btn,
.theme-tres-clavos input,
.theme-tres-clavos select,
.theme-tres-clavos textarea,
.theme-tres-clavos button { font-family: var(--font-text); }
.theme-tres-clavos h1,
.theme-tres-clavos h2,
.theme-tres-clavos h3 { font-family: var(--font-display); font-weight: 700; text-transform: uppercase; letter-spacing: .01em; line-height: 1.05; }
.theme-tres-clavos h1 { font-size: clamp(28px, 4.5vw, 40px); }
.theme-tres-clavos .section-head h2 { font-size: 26px; }
.theme-tres-clavos .section-head a { display: inline-flex; align-items: center; min-height: 44px; font-weight: 600; color: var(--accent); }

/* Formas: esquinas casi rectas en todo lo que la plataforma redondea */
.theme-tres-clavos .btn,
.theme-tres-clavos .pill span,
.theme-tres-clavos .chip,
.theme-tres-clavos .tag,
.theme-tres-clavos .qty input,
.theme-tres-clavos .head-link,
.theme-tres-clavos .swatch-name,
.theme-tres-clavos .gallery-main,
.theme-tres-clavos .thumbs button,
.theme-tres-clavos .flash li { border-radius: var(--radius); }
.theme-tres-clavos .btn { font-weight: 600; letter-spacing: .02em; }

/* ---------- Encabezado de dos niveles ---------- */
.theme-tres-clavos .tc-head { border-bottom: 0; box-shadow: 0 1px 0 var(--line); }
.tc-head-row { display: flex; align-items: center; gap: 20px; min-height: 76px; }
.theme-tres-clavos .tc-logo .logo-img { height: 48px; max-width: 200px; }
.theme-tres-clavos .tc-logo { font-family: var(--font-display); font-weight: 700; text-transform: uppercase; font-size: 24px; }
.theme-tres-clavos .tc-search { flex: 1; max-width: none; margin-left: 0; display: flex; }
.theme-tres-clavos .tc-search input { flex: 1; min-width: 0; height: 46px; border: 2px solid var(--ink); border-right: 0; border-radius: var(--radius) 0 0 var(--radius); background: var(--bg); padding-left: 42px; font-size: 16px; }
.theme-tres-clavos .tc-search input:focus, .theme-tres-clavos .tc-big-search input:focus { outline: 0; box-shadow: none; }
.theme-tres-clavos .tc-search:focus-within, .theme-tres-clavos .tc-big-search:focus-within { outline: 3px solid var(--brand); outline-offset: 2px; border-radius: var(--radius); }
.theme-tres-clavos .tc-search .icon { color: var(--ink-2); }
.tc-search-btn { flex: none; height: 46px; padding: 0 20px; border: 0; border-radius: 0 var(--radius) var(--radius) 0; background: var(--brand); color: var(--on-brand); font-weight: 600; font-size: 15px; letter-spacing: .03em; text-transform: uppercase; cursor: pointer; }
.tc-search-btn:hover { background: var(--brand-hover); }
.theme-tres-clavos .head-link { min-width: 44px; min-height: 44px; justify-content: center; }
.theme-tres-clavos .head-link:hover { background: var(--soft); }

/* Barra de categorías con subcategorías (escritorio): desplegable con :hover y :focus-within, sin JS */
.tc-cats { background: var(--accent); color: var(--on-accent); }
.tc-cats-row { list-style: none; margin: 0 auto; display: flex; flex-wrap: wrap; gap: 0 4px; }
.tc-cats-row > li { position: relative; }
.tc-cats-row > li > a { display: flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 14px; color: inherit; text-decoration: none; font-family: var(--font-display); font-weight: 600; font-size: 18px; text-transform: uppercase; letter-spacing: .03em; }
.tc-cats-row > li:first-child > a { margin-left: -14px; }
.tc-cat.has-subs > a::after { content: ""; width: 7px; height: 7px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: translateY(-2px) rotate(45deg); opacity: .8; }
/* Hover, página actual y foco por inversión (fondo del lienzo, texto en azul acero: 11,5:1); el naranja no se lee sobre el azul. */
.tc-cats-row > li > a:hover, .tc-cats-row > li > a[aria-current], .tc-cat:focus-within > a { background: var(--bg); color: var(--accent); }
.tc-cats-row > li > a:focus-visible { outline: 3px solid var(--on-accent); outline-offset: -3px; }
.tc-subs { display: none; position: absolute; top: 100%; left: 0; z-index: 40; min-width: 240px; list-style: none; margin: 0; padding: 6px 0; background: var(--bg); color: var(--ink); border: 2px solid var(--ink); border-top: 3px solid var(--brand); }
.tc-cat:hover .tc-subs, .tc-cat:focus-within .tc-subs { display: block; }
.tc-subs a { display: block; padding: 10px 16px; text-decoration: none; font-weight: 600; }
.tc-subs a:hover, .tc-subs a[aria-current] { background: var(--soft); color: var(--accent); }

/* Menú de categorías en celular: cajón con <details> */
.tc-menu { display: none; position: relative; }
.tc-menu summary { list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: center; min-width: 44px; min-height: 44px; padding: 0; border: 1px solid var(--line-strong); border-radius: var(--radius); }
.tc-menu summary::-webkit-details-marker { display: none; }
.tc-menu[open] summary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.tc-menu-panel { position: absolute; top: calc(100% + 8px); left: 0; z-index: 40; width: min(320px, calc(100vw - 32px)); max-height: 70vh; overflow-y: auto; background: var(--bg); border: 2px solid var(--ink); border-top: 3px solid var(--brand); padding: 6px 0; display: flex; flex-direction: column; }
.tc-menu-panel a { display: block; padding: 11px 16px; text-decoration: none; }
.tc-menu-all, .tc-menu-top { font-family: var(--font-display); font-weight: 700; font-size: 18px; text-transform: uppercase; }
.tc-menu-group + .tc-menu-group, .tc-menu-all + .tc-menu-group { border-top: 2px solid var(--ink); }
.tc-menu-sub { padding-left: 32px !important; color: var(--ink-2); font-weight: 600; }
.tc-menu-panel a:hover { background: var(--soft); }

@media (max-width: 860px) {
  .tc-cats { display: none; }
  .tc-menu { display: block; }
  .tc-head-row { flex-wrap: wrap; gap: 8px 10px; min-height: 0; padding-top: 8px; padding-bottom: 10px; }
  .theme-tres-clavos .tc-logo { flex: 1; min-width: 0; }
  .theme-tres-clavos .tc-logo .logo-img { height: 36px; max-width: 100%; }
  .theme-tres-clavos .tc-search { order: 3; flex-basis: 100%; }
  .theme-tres-clavos .tc-search input, .tc-search-btn { height: 44px; }
  .tc-search-btn { padding: 0 14px; }
}

/* ---------- Portada ---------- */
.theme-tres-clavos .tc-home { padding-top: 0; }
.theme-tres-clavos .tc-home > .flash { max-width: 1200px; margin: 16px auto; padding: 0 20px; }
.tc-band { background: var(--soft); border-bottom: 1px solid var(--line); }
.tc-hero { padding: 36px 0 28px; margin-bottom: 36px; }
.tc-hero h1 { font-size: clamp(30px, 5vw, 52px); margin-bottom: 18px; }
.tc-big-search { position: relative; display: flex; max-width: 920px; }
.tc-big-search .icon { position: absolute; left: 18px; top: 50%; transform: translateY(-50%); color: var(--ink-2); }
.theme-tres-clavos .tc-big-search input { flex: 1; min-width: 0; height: 64px; padding: 0 20px 0 54px; border: 3px solid var(--ink); border-right: 0; border-radius: var(--radius) 0 0 var(--radius); font-size: 20px; background: var(--bg); }
.theme-tres-clavos .tc-big-search .btn { height: 64px; min-width: 130px; border-radius: 0 var(--radius) var(--radius) 0; font-size: 18px; text-transform: uppercase; }
.tc-popular { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 14px 0 0; }
.tc-popular span { color: var(--ink-2); font-weight: 600; margin-right: 4px; }
.tc-popular a { display: inline-flex; align-items: center; min-height: 32px; padding: 0 12px; border: 1px solid var(--line-strong); border-radius: var(--radius); background: var(--bg); text-decoration: none; font-weight: 600; font-size: 14px; }
.tc-popular a:hover { border-color: var(--ink); }
/* El buscador del encabezado fijo se queda en la portada de escritorio: al bajar a ofertas o servicios sigue a mano. */
@media (max-width: 860px) {
  .tc-hero { padding: 20px 0 18px; margin-bottom: 24px; }
  .tc-hero .tc-big-search { display: none; }
  .tc-popular { margin-top: 0; }
  .tc-popular a { min-width: 44px; min-height: 44px; justify-content: center; }
}

.tc-section { margin-bottom: 40px; }
.tc-cat-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 10px; align-items: start; }
.tc-cat-tile { display: flex; flex-direction: column; }
.tc-cat-main { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg); text-decoration: none; font-family: var(--font-display); font-weight: 700; font-size: 21px; text-transform: uppercase; letter-spacing: .02em; }
.tc-cat-main img { width: 40px; height: 40px; flex: none; }
.tc-cat-main:hover { border-color: var(--ink); }
.tc-cat-subs { display: flex; flex-wrap: wrap; gap: 0 14px; padding: 2px 4px 0; }
.tc-cat-subs a { display: inline-flex; align-items: center; min-height: 32px; color: var(--ink-2); font-size: 14px; font-weight: 600; white-space: nowrap; }
.tc-cat-subs a:hover { color: var(--ink); }
@media (max-width: 640px) {
  .tc-cat-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .tc-cat-main { flex-direction: column; align-items: flex-start; gap: 6px; padding: 12px; font-size: 18px; }
  .tc-cat-subs { padding: 2px 4px 0; flex-direction: column; }
  .tc-cat-subs a { min-height: 44px; }
}

.tc-services { padding: 28px 0; margin-bottom: 40px; border-top: 1px solid var(--line); }
.tc-services h2 { font-size: 26px; margin-bottom: 16px; }
.tc-service-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px 28px; }
.tc-service-list li { display: flex; gap: 14px; align-items: flex-start; }
.tc-service-list img { width: 36px; height: 36px; flex: none; }
.tc-service-list strong { font-family: var(--font-display); font-size: 20px; text-transform: uppercase; letter-spacing: .02em; }
.tc-service-list p { margin: 2px 0 0; color: var(--ink-2); }

.tc-branches { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.tc-branch { border: 1px solid var(--line); border-top: 4px solid var(--brand); border-radius: var(--radius); padding: 18px 20px; }
.tc-branch h3 { font-size: 22px; margin-bottom: 4px; }
.tc-open { font-weight: 600; display: inline-flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.tc-open::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: currentColor; }
.tc-open.is-open { color: var(--ok); }
.tc-open.is-closed { color: var(--sale); }
.tc-address { color: var(--ink-2); }
.tc-hours { border-collapse: collapse; font-variant-numeric: tabular-nums; }
.tc-hours th, .tc-hours td { text-align: left; padding: 6px 16px 6px 0; border-top: 1px solid var(--line); }
.tc-hours th { font-weight: 600; }

/* ---------- Tarjeta compacta (portada y listado) ---------- */
.theme-tres-clavos .grid { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
@media (max-width: 640px) { .theme-tres-clavos .grid { grid-template-columns: 1fr 1fr; gap: 8px; } }
.tc-card { height: 100%; gap: 8px; padding: 10px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg); }
.tc-card:hover { border-color: var(--ink-3); }
.tc-card .card-link { flex: 1; gap: 8px; }
.tc-card .card-img { background: var(--photo); border-radius: var(--radius); }
.tc-card .card-img img { object-fit: contain; }
.tc-card .no-img { background: var(--soft); }
.tc-card .tag { top: 6px; left: 6px; font-size: 11px; text-transform: uppercase; letter-spacing: .04em; }
.tc-card .card-body { gap: 3px; }
.tc-code { font-size: 12px; font-weight: 600; color: var(--ink-2); letter-spacing: .04em; font-variant-numeric: tabular-nums; }
.tc-card .card-name { font-size: 14px; font-weight: 600; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.6em; }
.tc-card .card-price { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 6px; }
.tc-card .card-price small { font-size: 12px; color: var(--ink-2); font-weight: 600; }
.tc-price { font-family: var(--font-display); font-size: 26px; font-weight: 700; line-height: 1.1; }
.tc-card .swatches { margin: -4px -6px 0; }
/* Naranja solo para lo que agrega (`[data-add]`); «Ver medidas» es de contorno en tinta. Barlow Condensed para que «Agregar al carrito» quepa en una línea. */
.theme-tres-clavos .tc-add { width: 100%; min-height: 44px; padding: 8px; font-family: var(--font-display); font-weight: 700; font-size: 16px; letter-spacing: .03em; line-height: 1.1; white-space: nowrap; text-transform: uppercase; }
.theme-tres-clavos .tc-add--view { background: var(--bg); border: 2px solid var(--ink); color: var(--ink); }
.theme-tres-clavos .tc-add--view:hover { background: var(--ink); color: var(--bg); }
.theme-tres-clavos .card-price .sale, .theme-tres-clavos .price.sale { color: var(--ink); } /* el rojo queda solo en la etiqueta «Oferta» */

@media (max-width: 640px) {
  .tc-card { padding: 8px; }
  .tc-price { font-size: 22px; }
  .theme-tres-clavos .tc-add { font-size: 15px; padding: 8px 4px; }
}

/* ---------- Listado ---------- */
.theme-tres-clavos .page-title h1 { font-size: clamp(28px, 4vw, 38px); }
.theme-tres-clavos .crumbs { text-transform: uppercase; font-weight: 600; letter-spacing: .03em; font-size: 12px; }
.theme-tres-clavos .chip { font-weight: 600; background: var(--soft); border-color: var(--line); }
.theme-tres-clavos .chip:hover { border-color: var(--ink); }
.theme-tres-clavos .list-bar { background: var(--soft); border: 1px solid var(--line); padding: 10px 12px; }

/* ---------- Ficha ---------- */
.theme-tres-clavos .gallery { top: 140px; }
.theme-tres-clavos .gallery-main { border: 1px solid var(--line); background: var(--photo); }
.theme-tres-clavos .gallery-main img { max-height: 560px; }
@media (max-width: 640px) { .theme-tres-clavos .gallery-main img { max-height: 260px; } }
.theme-tres-clavos .buy h1 { font-size: clamp(30px, 4vw, 42px); }
.theme-tres-clavos .price { font-family: var(--font-display); font-size: 40px; font-weight: 700; }
.theme-tres-clavos .opt legend { text-transform: uppercase; letter-spacing: .03em; font-size: 14px; }
.theme-tres-clavos .pill span { min-height: 42px; font-weight: 600; }
.theme-tres-clavos .buy-form .btn { min-height: 48px; text-transform: uppercase; font-size: 16px; }
.theme-tres-clavos .desc { color: var(--ink); }
.theme-tres-clavos .desc h2 { font-size: 22px; }
/* Especificaciones en tabla */
.theme-tres-clavos .specs { grid-template-columns: minmax(110px, max-content) 1fr; gap: 0; border: 1px solid var(--line); border-bottom: 0; }
.theme-tres-clavos .specs dt, .theme-tres-clavos .specs dd { padding: 9px 12px; border-bottom: 1px solid var(--line); }
.theme-tres-clavos .specs dt { background: var(--soft); color: var(--ink); font-weight: 600; }
.theme-tres-clavos .specs + .specs { margin-top: -1px; }
.theme-tres-clavos .specs:empty { display: none; }
.theme-tres-clavos .fine [data-sku] { font-weight: 600; color: var(--ink); }

/* ---------- Pie ---------- */
.theme-tres-clavos .tc-foot { background: var(--accent); color: var(--on-accent); border-top: 4px solid var(--brand); }
.theme-tres-clavos .tc-foot strong { font-family: var(--font-display); font-size: 22px; text-transform: uppercase; }
.theme-tres-clavos .tc-foot .foot-row p,
.theme-tres-clavos .tc-foot .foot-links a,
.theme-tres-clavos .tc-foot .foot-note,
.theme-tres-clavos .tc-foot .foot-note a { color: inherit; }
.theme-tres-clavos .tc-foot .foot-row p, .theme-tres-clavos .tc-foot .foot-note { opacity: .85; }
.theme-tres-clavos .tc-foot .foot-links a { display: inline-flex; align-items: center; min-width: 44px; min-height: 44px; }
.theme-tres-clavos .tc-foot .foot-note a { display: inline-block; padding-block: 11px; }
