/*
Theme Name: Carlos Tienda Base
Description: Tema independiente y adaptable para páginas de empresa y catálogo de productos.
Version: 0.2.0
Requires at least: 6.4
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: carlos-tienda-base
Tags: custom-logo, custom-menu, featured-images, full-width-template, e-commerce
*/

:root {
  --ctb-ink: #17212b;
  --ctb-accent: #2563eb;
  --ctb-paper: #ffffff;
  --ctb-muted: #526171;
  --ctb-soft: #f4f7fb;
  --ctb-line: #dbe3ed;
  --ctb-width: 1200px;
  --ctb-radius: 12px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; color: var(--ctb-ink); background: var(--ctb-paper); font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; font-size: 17px; line-height: 1.65; overflow-wrap: break-word; }
a { color: var(--ctb-accent); text-underline-offset: .18em; }
a:hover { text-decoration-thickness: 2px; }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, summary:focus-visible { outline: 3px solid var(--ctb-accent); outline-offset: 4px; }
img { max-width: 100%; height: auto; }
iframe, video { max-width: 100%; }
button, input, select, textarea { font: inherit; }
button, input[type="submit"] { cursor: pointer; }
input:not([type="checkbox"]):not([type="radio"]), textarea, select { max-width: 100%; border: 1px solid var(--ctb-line); border-radius: 7px; padding: .65em .8em; background: #fff; color: var(--ctb-ink); }
button, input[type="submit"] { border: 1px solid transparent; border-radius: 7px; padding: .65em 1em; background: var(--ctb-accent); color: #fff; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: .65em; border: 1px solid var(--ctb-line); text-align: left; }
pre { max-width: 100%; padding: 1em; background: var(--ctb-soft); overflow: auto; }
h1, h2, h3, h4, h5, h6 { line-height: 1.2; letter-spacing: -.025em; }
h1 { font-size: clamp(2rem, 4vw, 3.4rem); }
h2 { font-size: clamp(1.6rem, 3vw, 2.35rem); }
.screen-reader-text { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.screen-reader-text:focus { clip: auto; width: auto; height: auto; margin: 0; overflow: visible; white-space: normal; z-index: 100000; }
.ctb-skip-link:focus { top: 12px; left: 12px; padding: 12px 18px; background: var(--ctb-paper); border: 2px solid var(--ctb-accent); border-radius: 8px; }
.ctb-wrap { width: min(var(--ctb-width), calc(100% - 40px)); margin-inline: auto; }
.ctb-header { border-bottom: 1px solid var(--ctb-line); background: var(--ctb-paper); }
.ctb-header-inner { display: flex; align-items: center; justify-content: space-between; gap: 24px; min-height: 90px; padding-block: 18px; }
.ctb-brand { flex: 0 1 340px; min-width: 0; }
.ctb-brand .custom-logo-link { display: inline-flex; align-items: center; }
.ctb-brand .custom-logo { display: block; width: auto; max-width: 260px; max-height: 66px; }
.ctb-site-name { color: var(--ctb-ink); font-size: clamp(1.25rem, 2.2vw, 1.75rem); font-weight: 750; line-height: 1.2; text-decoration: none; display: inline-block; }
.ctb-tagline { margin: .25em 0 0; color: var(--ctb-muted); font-size: .85rem; }
.ctb-nav { min-width: 0; }
.ctb-menu, .ctb-footer-menu { list-style: none; margin: 0; padding: 0; }
.ctb-menu { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; }
.ctb-menu li { position: relative; }
.ctb-menu a { display: block; padding: 9px 4px; color: var(--ctb-ink); text-decoration: none; font-weight: 600; }
.ctb-menu a:hover, .ctb-menu .current-menu-item > a { color: var(--ctb-accent); text-decoration: underline; }
.ctb-menu :is(.sub-menu, .children) { list-style: none; margin: 0; padding: 8px; position: absolute; left: 0; top: 100%; min-width: 220px; background: var(--ctb-paper); border: 1px solid var(--ctb-line); border-radius: 8px; box-shadow: 0 12px 30px #17212b12; z-index: 50; display: none; }
.ctb-menu li:hover > :is(.sub-menu, .children), .ctb-menu li:focus-within > :is(.sub-menu, .children) { display: block; }
.ctb-menu :is(.sub-menu, .children) :is(.sub-menu, .children) { left: 100%; top: 0; }
.ctb-nav-toggle { display: none; background: var(--ctb-paper); border-color: var(--ctb-line); color: var(--ctb-ink); align-items: center; gap: 9px; }
.ctb-main { min-height: 55vh; padding-block: clamp(32px, 5vw, 72px); }
.ctb-page-heading { margin: 0 0 30px; }
.ctb-prose { max-width: 860px; margin-inline: auto; }
.ctb-prose > :first-child { margin-top: 0; }
.ctb-prose > :last-child { margin-bottom: 0; }
.ctb-featured { display: block; margin-bottom: 28px; border-radius: var(--ctb-radius); }
.ctb-post-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 26px; }
.ctb-post-card { min-width: 0; padding: 24px; border: 1px solid var(--ctb-line); border-radius: var(--ctb-radius); }
.ctb-post-card h2 { margin-top: 0; font-size: 1.45rem; }
.ctb-post-card h2 a { color: var(--ctb-ink); text-decoration: none; }
.ctb-post-card img { border-radius: 8px; aspect-ratio: 16 / 10; width: 100%; object-fit: cover; margin-bottom: 16px; }
.ctb-meta { font-size: .85rem; color: var(--ctb-muted); }
.ctb-pagination { margin-top: 32px; }
.ctb-pagination .nav-links { display: flex; flex-wrap: wrap; gap: 10px; }
.ctb-pagination .page-numbers { padding: .4em .8em; border: 1px solid var(--ctb-line); border-radius: 5px; }
.ctb-footer { border-top: 1px solid var(--ctb-line); background: var(--ctb-soft); padding-block: 34px; margin-top: 24px; }
.ctb-footer-inner { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 20px; }
.ctb-footer p { margin: 0; font-size: .9rem; color: var(--ctb-muted); }
.ctb-footer-menu { display: flex; flex-wrap: wrap; gap: 10px 20px; font-size: .9rem; }
.ctb-footer-menu a { color: var(--ctb-ink); }
.ctb-fullwidth { padding: 0; min-height: 55vh; }
.ctb-fullwidth .cc-home { width: min(var(--ctb-width), calc(100% - 40px)); margin-inline: auto; }
.ctb-fullwidth .entry-content > .alignwide { width: min(var(--ctb-width), calc(100% - 40px)); margin-inline: auto; }
.ctb-fullwidth .entry-content > .alignfull { width: 100%; margin-inline: 0; }
.ctb-search { display: flex; flex-wrap: wrap; align-items: stretch; gap: 10px; }
.ctb-search label { flex: 1 1 220px; }
.ctb-search input { width: 100%; }
.ctb-shop .woocommerce-breadcrumb { margin-bottom: 28px; }
.ctb-shop .woocommerce-products-header__title { margin-top: 0; }
.woocommerce div.product div.images img { object-fit: contain; }
.woocommerce ul.products li.product a img { aspect-ratio: 1; object-fit: contain; background: var(--ctb-soft); border-radius: 8px; }
.woocommerce a.button, .woocommerce button.button, .woocommerce input.button, .woocommerce #respond input#submit { border-radius: 7px; }
.woocommerce a.button.alt, .woocommerce button.button.alt, .woocommerce input.button.alt { background: var(--ctb-accent); color: #fff; }
.woocommerce a.button.alt:hover, .woocommerce button.button.alt:hover, .woocommerce input.button.alt:hover { background: var(--ctb-ink); color: #fff; }
.woocommerce form .form-row input.input-text, .woocommerce form .form-row textarea { padding: .7em; }
.woocommerce .woocommerce-message, .woocommerce .woocommerce-info { border-top-color: var(--ctb-accent); }
.woocommerce table.shop_table { overflow-wrap: anywhere; }
.comment-list { padding-left: 20px; }
.comment-body { padding-block: 20px; border-bottom: 1px solid var(--ctb-line); }
.comment-respond { margin-top: 32px; }

@media (max-width: 900px) {
  .ctb-post-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .ctb-header-inner { flex-wrap: wrap; }
  .ctb-brand { flex: 1 1 200px; }
  .ctb-nav { flex: 1 1 100%; }
  .ctb-menu { align-items: stretch; flex-direction: column; gap: 0; }
  .ctb-menu :is(.sub-menu, .children), .ctb-menu :is(.sub-menu, .children) :is(.sub-menu, .children) { display: block; position: static; min-width: 0; margin-left: 12px; border: 0; border-left: 2px solid var(--ctb-line); border-radius: 0; box-shadow: none; }
  html.ctb-js .ctb-nav-toggle { display: inline-flex; }
  html.ctb-js .ctb-nav[data-expanded="false"] { display: none; }
  .ctb-nav-toggle[aria-expanded="true"] { background: var(--ctb-soft); }
}
@media (max-width: 600px) {
  body { font-size: 16px; }
  .ctb-wrap { width: calc(100% - 32px); }
  .ctb-header-inner { gap: 16px; min-height: 76px; }
  .ctb-brand .custom-logo { max-width: 190px; max-height: 54px; }
  .ctb-tagline { font-size: .8rem; }
  .ctb-post-grid { grid-template-columns: minmax(0,1fr); }
  .ctb-post-card { padding: 20px; }
  .ctb-footer-inner { align-items: flex-start; flex-direction: column; }
  .ctb-prose table { display: block; overflow-x: auto; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
