/* UltraBandera Setup: estilos de la marca */

@font-face {
  font-family: "Bricolage Grotesque";
  src: url("fonts/bricolage-grotesque.woff") format("woff");
  font-weight: 700 800;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Hanken Grotesk";
  src: url("fonts/hanken-grotesk.woff") format("woff");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --ub-navy: #0C1A3D;
  --ub-red: #E4202E;
  --ub-red-dark: #c41a27;
  --ub-yellow: #FFC72C;
  --ub-grey: #EEF2F8;
  --ub-ink: #44516F;
  --ub-line: #E3E8F1;
  --ub-display: "Bricolage Grotesque", system-ui, sans-serif;
  --ub-body: "Hanken Grotesk", system-ui, sans-serif;
  --ast-global-color-0: #E4202E;
  --ast-global-color-1: #c41a27;
  --ast-global-color-2: #0C1A3D;
  --ast-global-color-3: #44516F;
  --ast-global-color-4: #EEF2F8;
}

/* ---------- Tipografía ---------- */
html body,
html body button,
html body input,
html body select,
html body textarea {
  font-family: var(--ub-body);
}
html body h1,
html body h2,
html body h3,
html body h4,
html body h5,
html body h6,
html body .wp-block-post-title,
html body .wp-block-heading,
html body .product_title {
  font-family: var(--ub-display);
  letter-spacing: -0.02em;
}
html body h1,
html body h2,
html body h3,
html body .wp-block-post-title,
html body .product_title {
  font-weight: 800;
  color: var(--ub-navy);
}
html, html body { overflow-x: clip; }

/* ---------- Ocultar cabecera y pie del tema ---------- */
body.ub-shell .wp-site-blocks > header,
body.ub-shell .wp-site-blocks > footer,
body.ub-shell #masthead,
body.ub-shell #colophon,
body.ub-shell header.site-header,
body.ub-shell footer.site-footer {
  display: none !important;
}

/* ---------- Barra superior ---------- */
.ub-topbar {
  background: var(--ub-navy);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  padding: 10px 24px;
  text-align: center;
  line-height: 1.3;
}

/* ---------- Cabecera ---------- */
.ub-header {
  position: sticky;
  top: 0;
  z-index: 999;
  background: #fff;
  border-bottom: 1px solid var(--ub-line);
}
body.admin-bar .ub-header { top: 32px; }
@media (max-width: 782px) { body.admin-bar .ub-header { top: 46px; } }

.ub-header-in {
  max-width: 1200px;
  margin: 0 auto;
  padding: 16px 24px;
  display: flex;
  align-items: center;
  gap: 28px;
  box-sizing: border-box;
}
.ub-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--ub-navy);
  flex: none;
}
.ub-logo {
  display: flex;
  flex-direction: column;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--ub-line);
  box-sizing: border-box;
}
.ub-logo i { display: block; flex: 1; }
.ub-logo i:nth-child(1) { background: #E4202E; }
.ub-logo i:nth-child(2) { background: #fff; }
.ub-logo i:nth-child(3) { background: #0C1A3D; }
.ub-word {
  font-family: var(--ub-display);
  font-weight: 800;
  font-size: 25px;
  letter-spacing: -0.5px;
  line-height: 1;
  color: var(--ub-navy);
}
.ub-word b { color: var(--ub-red); font-weight: 800; }

.ub-nav {
  display: flex;
  align-items: center;
  gap: 28px;
  flex: 1;
  margin-left: 12px;
}
.ub-nav a {
  color: var(--ub-navy);
  font-weight: 600;
  font-size: 15px;
  text-decoration: none;
  padding: 6px 0;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
}
.ub-nav a:hover { border-bottom-color: var(--ub-red); color: var(--ub-navy); }

.ub-actions { display: flex; align-items: center; gap: 12px; margin-left: auto; }
.ub-search {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--ub-grey);
  border-radius: 999px;
  padding: 0 18px;
  height: 44px;
  box-sizing: border-box;
  color: #5A6784;
  margin: 0;
}
.ub-search input[type="search"] {
  border: 0;
  background: transparent;
  outline: 0;
  box-shadow: none;
  font-size: 15px;
  width: 170px;
  padding: 0;
  height: 42px;
  color: var(--ub-navy);
}
.ub-search-m { display: none; }
.ub-cart {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 999px;
  background: var(--ub-navy);
  color: #fff;
  text-decoration: none;
}
.ub-cart:hover { background: var(--ub-red); color: #fff; }
.ub-count {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  box-sizing: border-box;
  border-radius: 999px;
  background: var(--ub-red);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}
.ub-count[data-n="0"] { display: none; }
.ub-burger {
  display: none;
  width: 44px;
  height: 44px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--ub-line);
  border-radius: 999px;
  background: #fff;
  color: var(--ub-navy);
  padding: 0;
  cursor: pointer;
}

@media (max-width: 900px) {
  .ub-header-in { padding: 12px 16px; gap: 12px; }
  .ub-word { font-size: 22px; }
  .ub-nav {
    display: none;
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    margin: 0;
    padding: 8px 16px 20px;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: #fff;
    border-bottom: 1px solid var(--ub-line);
    box-shadow: 0 18px 30px rgba(12, 26, 61, .08);
  }
  .ub-open .ub-nav { display: flex; }
  .ub-nav a { padding: 14px 0; font-size: 17px; border-bottom: 1px solid var(--ub-line); }
  .ub-search-d { display: none; }
  .ub-search-m { display: flex; margin-top: 16px; }
  .ub-search-m input[type="search"] { width: 100%; }
  .ub-burger { display: flex; }
}

/* ---------- Pie ---------- */
.ub-footer {
  background: #091431;
  color: #B8C4DE;
  margin-top: 72px;
}
.ub-foot-in {
  max-width: 1200px;
  margin: 0 auto;
  padding: 56px 24px 28px;
  box-sizing: border-box;
}
.ub-foot-grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr 1fr;
  gap: 40px;
}
.ub-foot-word {
  font-family: var(--ub-display);
  font-weight: 800;
  font-size: 28px;
  letter-spacing: -0.5px;
  color: #fff;
  line-height: 1;
}
.ub-foot-word b { color: var(--ub-red); font-weight: 800; }
.ub-foot-brand p { font-size: 15px; line-height: 1.55; max-width: 340px; margin: 16px 0 0; color: #B8C4DE; }
.ub-foot-col { display: flex; flex-direction: column; gap: 12px; font-size: 15px; }
.ub-foot-col h3 {
  font-family: var(--ub-display);
  font-weight: 700;
  font-size: 16px;
  color: #fff;
  margin: 0 0 4px;
}
.ub-foot-col a { color: #B8C4DE; text-decoration: none; }
.ub-foot-col a:hover { color: #fff; text-decoration: underline; }
.ub-foot-bottom {
  border-top: 1px solid #1B2C5C;
  margin-top: 40px;
  padding-top: 22px;
  font-size: 14px;
}
@media (max-width: 800px) {
  .ub-foot-grid { grid-template-columns: 1fr 1fr; gap: 32px; }
  .ub-foot-brand { grid-column: 1 / -1; }
}

/* ---------- Portada ---------- */
.home main { margin-top: 0 !important; }
.home main > .wp-block-group.alignfull { padding-top: 0 !important; padding-bottom: 0 !important; }
.home .ub-footer { margin-top: 24px; }
.home .wp-block-post-title,
.home .entry-header { display: none; }
.home .site-content .ast-container { max-width: 100%; padding-left: 0; padding-right: 0; display: block; }
.home .wp-block-post-content,
.home .entry-content { padding-top: 0 !important; margin-top: 0 !important; }

.ub-wrap { max-width: 1200px; margin: 0 auto; padding: 0 24px; box-sizing: border-box; }
.ub-hero {
  width: 100vw;
  max-width: 100vw;
  margin-left: calc(50% - 50vw) !important;
  margin-right: calc(50% - 50vw) !important;
  background: linear-gradient(180deg, #F2F6FC 0%, #FFFFFF 100%);
  padding: 56px 0 64px;
  box-sizing: border-box;
}
.ub-hero-grid { display: flex; flex-wrap: wrap; align-items: center; gap: 48px; }
.ub-hero-text { flex: 1 1 420px; min-width: 0; }
.ub-pill {
  display: inline-block;
  background: #FFF3CC;
  color: #6B4A00;
  font-weight: 700;
  font-size: 14px;
  padding: 8px 16px;
  border-radius: 999px;
  margin-bottom: 20px;
}
html body .ub-hero h1 {
  font-size: clamp(40px, 6vw, 68px);
  line-height: 1;
  letter-spacing: -2px;
  margin: 0 0 20px;
  color: var(--ub-navy);
}
.ub-hero p { font-size: 19px; line-height: 1.5; color: var(--ub-ink); margin: 0 0 28px; max-width: 520px; }
.ub-btns { display: flex; gap: 12px; flex-wrap: wrap; }
a.ub-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 56px;
  padding: 0 32px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 17px;
  text-decoration: none;
  box-sizing: border-box;
}
a.ub-btn.ub-btn-red { background: var(--ub-red); color: #fff; box-shadow: 0 10px 24px rgba(228, 32, 46, .3); }
a.ub-btn.ub-btn-red:hover { background: var(--ub-red-dark); color: #fff; }
a.ub-btn.ub-btn-line { border: 2px solid var(--ub-navy); color: var(--ub-navy); }
a.ub-btn.ub-btn-line:hover { background: var(--ub-navy); color: #fff; }
.ub-art {
  flex: 1 1 400px;
  min-width: 0;
  max-width: 560px;
  margin-left: auto;
  border-radius: 32px;
  overflow: hidden;
  box-shadow: 0 30px 60px rgba(12, 26, 61, .22);
}
.ub-art-svg { display: block; width: 100%; height: auto; }

.ub-perks {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  padding: 44px 0 56px;
}
.ub-perk { border: 1px solid var(--ub-line); border-radius: 18px; padding: 20px 22px; background: #fff; }
.ub-perk b { display: block; font-size: 16px; color: var(--ub-navy); margin-bottom: 4px; }
.ub-perk span { font-size: 14px; color: #5A6784; }
html body .ub-h2 { font-size: clamp(28px, 4vw, 40px); letter-spacing: -1px; margin: 0 0 24px; color: var(--ub-navy); }
.ub-cats { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 18px; padding-bottom: 64px; }
a.ub-cat {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  min-height: 190px;
  border-radius: 22px;
  padding: 24px;
  text-decoration: none;
  color: #fff;
  font-family: var(--ub-display);
  font-weight: 800;
  font-size: 26px;
  letter-spacing: -0.5px;
  box-sizing: border-box;
  transition: transform .15s ease;
}
a.ub-cat:hover { color: #fff; transform: translateY(-3px); }
a.ub-cat small { display: block; font-family: var(--ub-body); font-weight: 500; font-size: 14px; letter-spacing: 0; opacity: .85; margin-top: 2px; }
.ub-blogtitle { padding-top: 56px; }

.home .woocommerce { max-width: 1200px; margin: 0 auto; padding: 0 24px; box-sizing: border-box; }
.home .wp-block-latest-posts {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px 24px;
  box-sizing: border-box;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
  list-style: none;
}
.home .wp-block-latest-posts li { background: #F7F9FC; border-radius: 20px; padding: 24px; margin: 0; }
.home .wp-block-latest-posts__post-title {
  font-family: var(--ub-display);
  font-weight: 800;
  font-size: 21px;
  line-height: 1.15;
  color: var(--ub-navy);
  text-decoration: none;
}
.home .wp-block-latest-posts__post-title:hover { color: var(--ub-red); }
.home .wp-block-latest-posts__post-date { display: block; margin: 8px 0; font-size: 13px; color: #5A6784; }
.home .wp-block-latest-posts__post-excerpt { font-size: 15px; color: var(--ub-ink); }

/* ---------- Encuadre del resto de páginas ---------- */
body.ub-shell:not(.home) main {
  max-width: 1200px;
  margin-left: auto !important;
  margin-right: auto !important;
  padding-left: 24px !important;
  padding-right: 24px !important;
  box-sizing: border-box;
}
body.ub-shell:not(.home) main > .wp-block-group { padding-left: 0 !important; padding-right: 0 !important; }
body.ub-shell:not(.home) main .alignwide,
body.ub-shell:not(.home) main .wp-block-woocommerce-single-product { max-width: 100% !important; }

/* ---------- Botones ---------- */
.ast-button,
.button,
button,
input[type="submit"],
.wp-block-button__link,
.woocommerce a.button,
.woocommerce button.button,
.woocommerce input.button,
.woocommerce #respond input#submit {
  border-radius: 999px;
  font-weight: 700;
}

/* ---------- Catálogo ---------- */
.woocommerce ul.products {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 24px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.woocommerce ul.products::before,
.woocommerce ul.products::after { display: none; }
.woocommerce ul.products li.product,
.wc-block-product {
  display: flex;
  flex-direction: column;
  float: none;
  width: auto;
  margin: 0;
  box-sizing: border-box;
  background: #fff;
  border-radius: 24px;
  padding: 16px;
  box-shadow: 0 1px 0 var(--ub-line), 0 8px 24px rgba(12, 26, 61, .06);
}
.woocommerce ul.products li.product a img,
.wc-block-product img {
  border-radius: 16px;
  background: var(--ub-grey);
  width: 100%;
  height: auto;
}
.woocommerce ul.products li.product .woocommerce-loop-product__title,
.wc-block-product .wp-block-post-title {
  font-family: var(--ub-display);
  font-weight: 700;
  font-size: 18px;
  color: var(--ub-navy);
  padding: 8px 4px 0;
}
.woocommerce ul.products li.product .price { color: var(--ub-navy); font-weight: 800; padding: 0 4px; }
.woocommerce ul.products li.product .button {
  margin-top: auto;
  box-sizing: border-box;
  width: 100%;
  text-align: center;
  background: var(--ub-navy);
  color: #fff;
  padding: 14px 20px;
}
.woocommerce ul.products li.product .button:hover { background: var(--ub-red); color: #fff; }
.woocommerce span.onsale {
  background: var(--ub-red);
  border-radius: 999px;
  min-height: auto;
  line-height: 1;
  padding: 8px 14px;
}

/* ---------- Ficha de producto ---------- */
.single-product h1,
.single-product .wp-block-post-title,
.single-product .product_title {
  font-size: clamp(30px, 4vw, 46px);
  line-height: 1.05;
}
.woocommerce div.product p.price,
.woocommerce div.product span.price,
.woocommerce div.product .woocommerce-variation-price .price {
  color: var(--ub-navy);
  font-weight: 800;
  font-size: 30px;
}
.woocommerce div.product form.cart .variations select {
  border: 2px solid #D5DCEA;
  border-radius: 999px;
  height: 48px;
  padding: 0 20px;
  background-color: #fff;
  color: var(--ub-navy);
}
.woocommerce div.product form.cart,
.woocommerce div.product form.cart .woocommerce-variation-add-to-cart {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 12px;
}
.woocommerce div.product form.variations_form { display: block; }
.woocommerce div.product form.cart .woocommerce-variation-add-to-cart { width: 100%; }
.woocommerce div.product form.cart .quantity .qty {
  height: 56px;
  width: 92px;
  border: 2px solid #D5DCEA;
  border-radius: 999px;
  text-align: center;
  font-weight: 700;
}
.woocommerce div.product form.cart .single_add_to_cart_button {
  flex: 1 1 220px;
  background: var(--ub-red);
  color: #fff;
  min-height: 56px;
  padding: 0 34px;
  font-size: 17px;
  margin: 0;
  border: 0;
  box-shadow: none;
}
.woocommerce div.product form.cart .single_add_to_cart_button:hover { background: var(--ub-red-dark); color: #fff; }
.woocommerce div.product form.cart .ub-buy-now {
  flex: 1 1 100%;
  background: var(--ub-navy);
  color: #fff;
  min-height: 60px;
  font-size: 18px;
  font-weight: 800;
  margin: 0;
  border: 0;
  box-shadow: none;
}
.woocommerce div.product form.cart .ub-buy-now:hover { background: #16295c; color: #fff; }
.woocommerce div.product form.cart .ub-buy-now.disabled { opacity: .5; }

/* ---------- Blog ---------- */
.single-post .wp-block-post-title { font-size: clamp(30px, 4.5vw, 48px); line-height: 1.05; }
.entry-content h2,
.wp-block-post-content h2 { color: var(--ub-navy); margin-top: 1.6em; }
.single-post .entry-content a,
.single-post .wp-block-post-content a { color: var(--ub-red); }
.ast-article-post { border-radius: 20px; }

/* Botones de las tarjetas en el catálogo por bloques */
.wc-block-product .wp-block-button__link,
.wc-block-product .wc-block-components-product-button__button {
  background: var(--ub-navy);
  color: #fff;
  border-radius: 999px;
  font-weight: 700;
}
.wc-block-product .wp-block-button__link:hover { background: var(--ub-red); color: #fff; }
