/* TechMarleys seasonal layers. The base design remains unchanged when inactive. */
:root {
  --tm-theme-red: #d21034;
  --tm-theme-blue: #0050a4;
  --tm-theme-navy: #073b75;
  --tm-theme-white: #ffffff;
  --tm-theme-glow: #e8f3ff;
  --tm-theme-bg-desktop: none;
  --tm-theme-bg-mobile: var(--tm-theme-bg-desktop);
}

html[data-theme="patria-pa"] body { overflow-x: clip; }
html[data-theme="patria-pa"] body.tm-home-page > main {
  background-color: #f8f8f9;
  background-image: var(--tm-theme-bg-desktop);
  background-position: center top;
  background-repeat: no-repeat;
  background-size: 100% auto;
}

/* Original white header, with only a precise patriotic edge. */
html[data-theme="patria-pa"] .tm-utility-bar {
  position: relative;
  background: #292a2f;
}
html[data-theme="patria-pa"] .tm-utility-bar::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 2px;
  background: linear-gradient(90deg, var(--tm-theme-blue) 0 33.333%, #fff 33.333% 66.666%, var(--tm-theme-red) 66.666%);
}
html[data-theme="patria-pa"] .tm-store-header,
html[data-theme="patria-pa"] body > header {
  border-bottom-color: #e3e7ed !important;
  box-shadow: 0 10px 24px -27px rgba(7, 59, 117, .65);
}
html[data-theme="patria-pa"] .tm-desktop-links a { position: relative; }
html[data-theme="patria-pa"] .tm-desktop-links a::after {
  content: "";
  position: absolute;
  left: 50%;
  right: 50%;
  bottom: -9px;
  height: 2px;
  background: linear-gradient(90deg, var(--tm-theme-blue), var(--tm-theme-red));
  transition: left .2s ease, right .2s ease;
}
html[data-theme="patria-pa"] .tm-desktop-links a:hover { color: var(--tm-theme-navy); }
html[data-theme="patria-pa"] .tm-desktop-links a:hover::after { left: 0; right: 0; }
html[data-theme="patria-pa"] .tm-search-box:focus-within { border-color: rgba(0, 80, 164, .58); box-shadow: 0 0 0 3px rgba(0, 80, 164, .08); }
html[data-theme="patria-pa"] .tm-search-box .material-symbols-outlined { color: var(--tm-theme-blue); }

/* Light garland inspired by the original brief—no campaign masthead or skyline. */
.tm-patriotic-garland-bar {
  position: relative;
  z-index: 5;
  height: 32px;
  overflow: hidden;
  background:
    radial-gradient(circle at 10% 0, rgba(0, 80, 164, .055), transparent 24%),
    radial-gradient(circle at 90% 0, rgba(210, 16, 52, .05), transparent 24%),
    rgba(255, 255, 255, .98);
  border-bottom: 1px solid #e8ebef;
  pointer-events: none;
}
.tm-patriotic-garland-bar::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 2px;
  background: linear-gradient(90deg, var(--tm-theme-blue) 0 31%, #e7ebf0 31% 69%, var(--tm-theme-red) 69%);
  opacity: .82;
}
.tm-theme-garland { position: absolute; inset: 0; }
.tm-garland-wire {
  position: absolute;
  top: 2px;
  left: -1%;
  width: 102%;
  height: 1px;
  background: #aeb8c4;
  box-shadow: 0 1px 2px rgba(7, 59, 117, .12);
}
.tm-garland-pieces {
  position: absolute;
  inset: 2px 2.4% auto;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: clamp(4px, 1vw, 15px);
}
.tm-pennant {
  display: grid;
  place-items: start center;
  width: clamp(12px, 1.5vw, 21px);
  height: clamp(17px, 2vw, 28px);
  padding-top: 3px;
  clip-path: polygon(0 0, 100% 0, 50% 100%);
  color: var(--tm-theme-blue);
  font: 700 7px/1 sans-serif;
  filter: drop-shadow(0 2px 1px rgba(5, 35, 65, .14));
  transform-origin: 50% 0;
  animation: tmPatriaPennant 5.5s ease-in-out infinite alternate;
}
.tm-pennant:nth-child(3n) { animation-delay: -.8s; }
.tm-pennant:nth-child(4n) { animation-delay: -1.5s; }
.tm-pennant.is-red { background: var(--tm-theme-red); }
.tm-pennant.is-blue { background: var(--tm-theme-blue); }
.tm-pennant.is-white { background: #fff; border: 1px solid #d9dee5; }

.tm-panama-flag {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  width: 36px;
  height: 24px;
  overflow: hidden;
  border: 1px solid #d2d9e1;
  border-radius: 2px;
  background: #fff;
  box-shadow: 0 5px 12px -9px rgba(5, 35, 65, .75);
}
.tm-panama-flag > i:nth-child(1), .tm-panama-flag > i:nth-child(4) { background: #fff; }
.tm-panama-flag > i:nth-child(2) { background: var(--tm-theme-red); }
.tm-panama-flag > i:nth-child(3) { background: var(--tm-theme-blue); }
.tm-panama-flag > b { position: absolute; font: 700 8px/1 sans-serif; }
.tm-flag-star-blue { color: var(--tm-theme-blue); top: 2px; left: 5px; }
.tm-flag-star-red { color: var(--tm-theme-red); right: 5px; bottom: 2px; }
.tm-garland-flag { width: clamp(23px, 2.6vw, 35px); height: clamp(15px, 1.75vw, 23px); transform-origin: 50% 0; animation: tmPatriaFlag 5s ease-in-out infinite alternate; }

/* Existing editorial block remains intact, with a quiet campaign signature. */
html[data-theme="patria-pa"] .tm-editorial-head { position: relative; }
html[data-theme="patria-pa"] .tm-editorial-head::before,
html[data-theme="patria-pa"] .tm-editorial-head::after {
  content: "";
  position: absolute;
  width: 34px;
  height: 34px;
  pointer-events: none;
  opacity: .28;
}
html[data-theme="patria-pa"] .tm-editorial-head::before { top: 17px; left: -9px; border-top: 2px solid var(--tm-theme-blue); border-left: 2px solid var(--tm-theme-blue); }
html[data-theme="patria-pa"] .tm-editorial-head::after { right: -9px; bottom: 11px; border-right: 2px solid var(--tm-theme-red); border-bottom: 2px solid var(--tm-theme-red); }
html[data-theme="patria-pa"] .tm-editorial-intro { position: relative; }
html[data-theme="patria-pa"] .tm-editorial-intro .tm-eyebrow { display: inline-flex; margin-right: 9px; color: var(--tm-heading); }
html[data-theme="patria-pa"] .tm-editorial-intro h1 { color: var(--tm-heading); background: none; -webkit-text-fill-color: initial; }
.tm-patriotic-kicker {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  width: max-content;
  margin: 0 0 11px;
  padding: 5px 9px 5px 7px;
  border: 1px solid #dce3eb;
  border-radius: 999px;
  background: #fff;
  color: var(--tm-theme-navy);
  box-shadow: 0 8px 18px -18px rgba(0, 80, 164, .8);
  font: 700 9px/1 Inter, sans-serif;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.tm-patriotic-kicker > i { width: 17px; height: 4px; border-radius: 999px; background: linear-gradient(90deg, var(--tm-theme-blue) 0 33%, #e8edf3 33% 66%, var(--tm-theme-red) 66%); }
.tm-patriotic-kicker > b { color: var(--tm-theme-red); font-size: 8px; }

/* One elegant frame around the existing banner, with opposing national-color corners. */
html[data-theme="patria-pa"] #bannerWrap {
  position: relative;
  outline: 0;
  border: 1px solid #dce2e9;
  box-shadow: 0 20px 44px -35px rgba(7, 59, 117, .62);
}
html[data-theme="patria-pa"] #bannerWrap::before,
html[data-theme="patria-pa"] #bannerWrap::after {
  content: "";
  position: absolute;
  z-index: 3;
  width: 44px;
  height: 44px;
  pointer-events: none;
}
html[data-theme="patria-pa"] #bannerWrap::before { top: 10px; left: 10px; border-top: 3px solid var(--tm-theme-blue); border-left: 3px solid var(--tm-theme-blue); }
html[data-theme="patria-pa"] #bannerWrap::after { right: 10px; bottom: 10px; border-right: 3px solid var(--tm-theme-red); border-bottom: 3px solid var(--tm-theme-red); }
html[data-theme="patria-pa"] #bannerWrap .tm-hero-cta { background: var(--tm-theme-red); border-color: var(--tm-theme-red); box-shadow: 0 12px 24px -18px rgba(210, 16, 52, .9); }
html[data-theme="patria-pa"] #bannerWrap .tm-hero-cta:hover { background: #b50d2b; border-color: #b50d2b; }

html[data-theme="patria-pa"] .tm-section-title::after { content: ""; display: inline-block; width: 32px; height: 3px; margin-left: 10px; vertical-align: middle; border-radius: 3px; background: linear-gradient(90deg, var(--tm-theme-blue) 0 43%, #e1e6ec 43% 57%, var(--tm-theme-red) 57%); }
html[data-theme="patria-pa"] .tm-filter-chip.active { color: var(--tm-theme-navy) !important; border-bottom-color: var(--tm-theme-blue) !important; }
html[data-theme="patria-pa"] .tm-product-card:hover { border-color: rgba(0, 80, 164, .25); box-shadow: 0 14px 30px -24px rgba(7, 59, 117, .42); }
html[data-theme="patria-pa"] .tm-site-footer { position: relative; border-top: 5px solid transparent; border-image: linear-gradient(90deg, var(--tm-theme-blue) 0 33%, #fff 33% 66%, var(--tm-theme-red) 66%) 1; }
html[data-theme="patria-pa"] .tm-nav-item.is-active { color: var(--tm-theme-blue) !important; }

html.tm-theme-preview[data-theme="patria-pa"] body::after {
  content: "VISTA PREVIA · PATRIA PA";
  position: fixed;
  z-index: 1000;
  right: 12px;
  bottom: 84px;
  padding: 7px 11px;
  border-radius: 999px;
  background: #111827;
  color: #fff;
  font: 800 10px/1.2 Inter, sans-serif;
  letter-spacing: .08em;
  pointer-events: none;
  box-shadow: 0 8px 24px -15px #000;
}

@keyframes tmPatriaPennant { from { transform: rotate(-1deg); } to { transform: rotate(1.5deg); } }
@keyframes tmPatriaFlag { from { transform: skewY(-.8deg) rotate(-.5deg); } to { transform: skewY(.8deg) rotate(.5deg); } }

@media (max-width: 700px) {
  html[data-theme="patria-pa"] body.tm-home-page > main { background-image: var(--tm-theme-bg-mobile); }
  .tm-patriotic-garland-bar { height: 24px; }
  .tm-garland-pieces { left: 1%; right: 1%; gap: 2px; }
  .tm-garland-pieces > :nth-child(2n) { display: none; }
  .tm-pennant { width: 14px; height: 19px; }
  .tm-garland-flag { display: grid !important; width: 25px; height: 17px; }
  html[data-theme="patria-pa"] .tm-editorial-head::before,
  html[data-theme="patria-pa"] .tm-editorial-head::after { display: none; }
  html[data-theme="patria-pa"] .tm-editorial-intro .tm-eyebrow { display: none; }
  .tm-patriotic-kicker { padding: 5px 8px 5px 6px; margin-bottom: 8px; font-size: 8px; }
  html[data-theme="patria-pa"] #bannerWrap::before,
  html[data-theme="patria-pa"] #bannerWrap::after { width: 28px; height: 28px; border-width: 2px; }
  html[data-theme="patria-pa"] #bannerWrap::before { top: 7px; left: 7px; }
  html[data-theme="patria-pa"] #bannerWrap::after { right: 7px; bottom: 7px; }
}

@media (prefers-reduced-motion: reduce) {
  .tm-pennant, .tm-garland-flag { animation: none !important; }
}
