/* PAGE DESIGN ROLL — Flag Bundle (cart)
   Layout: card mosaic line items + sticky summary aside
   Cards: kraft tag rows with clipped tag tab
   Dividers: wavy field line between meter and lines
   Motion: thumb hover lift · trough fill transition
   Signature: irrigation trough free-shipping fill (sap → wheat gradient)
   Isolation class page-a114-flagbundle kept. Not A113 manila · A108 kraft trellis · House Tote
   Scoped: body.page-a114-flagbundle */

.page-a114-flagbundle {
  background:
    radial-gradient(ellipse 44% 30% at 92% 8%, rgba(201, 146, 18, 0.1), transparent 55%),
    var(--bf-wash);
}

.tt-main {
  padding-top: clamp(0.85rem, 2vw, 1.35rem);
  padding-bottom: clamp(2rem, 5vw, 3.4rem);
}

.page-a114-flagbundle.is-filled .tt-main {
  padding-bottom: clamp(2rem, 5vw, 3.4rem);
}

.tt-main > .a114-notice {
  margin-bottom: 1rem;
}

.page-a114-flagbundle .pg-mast {
  margin-bottom: 0.35rem;
}

.page-a114-flagbundle.is-empty .pg-empty {
  margin-top: 0.5rem;
  padding: clamp(2rem, 5vw, 3rem) 1.25rem;
  border: 2px dashed rgba(24, 74, 50, 0.22);
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 14px), calc(100% - 14px) 100%, 0 100%);
}

.page-a114-flagbundle.is-empty .pg-empty::before {
  content: "";
  display: block;
  width: 4.5rem;
  height: 4.5rem;
  margin: 0 auto 1rem;
  border-radius: 50%;
  background:
    radial-gradient(circle at 35% 35%, rgba(201, 146, 18, 0.35), transparent 55%),
    linear-gradient(165deg, var(--bf-forest) 0%, var(--bf-forest-deep) 100%);
  box-shadow: var(--bf-shadow);
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M5 7h14l-1.2 10H7.2L5 7Z'/%3E%3C/svg%3E");
  mask-repeat: no-repeat;
  mask-position: center;
  mask-size: 52%;
}

/* —— Irrigation trough meter (signature) —— */
.page-a114-flagbundle .tt-meter {
  margin: 0.85rem 0 0;
  padding: clamp(0.9rem, 2vw, 1.1rem);
  background: var(--bf-paper);
  border-radius: 0.5rem 0.5rem 1.1rem 1.1rem;
  box-shadow: var(--bf-shadow);
  border: 1px solid var(--bf-line);
}

.page-a114-flagbundle .tt-meter::after {
  content: "";
  display: block;
  height: 12px;
  margin: 0.85rem 0 0;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 120 8'%3E%3Cpath d='M0 4 Q15 0 30 4 T60 4 T90 4 T120 4' fill='none' stroke='%23184A32' stroke-width='1.2' opacity='0.35'/%3E%3C/svg%3E") repeat-x;
  background-size: 120px 8px;
}

.tt-meter h2 {
  margin: 0 0 0.35rem;
  font-size: clamp(1rem, 2.2vw, 1.08rem);
  color: var(--bf-forest);
}

.tt-meter p {
  margin: 0 0 0.65rem;
  color: var(--bf-mute);
  font-size: 0.9rem;
  line-height: 1.45;
}

.tt-vine {
  position: relative;
  height: 0.85rem;
  border-radius: 0.5rem 0.5rem 1rem 1rem;
  background: rgba(24, 74, 50, 0.1);
  overflow: hidden;
  box-shadow: inset 0 3px 8px rgba(14, 44, 30, 0.1);
}

.tt-vine::before {
  content: "";
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    90deg,
    transparent 0,
    transparent 7px,
    rgba(24, 74, 50, 0.06) 7px,
    rgba(24, 74, 50, 0.06) 8px
  );
  pointer-events: none;
}

.tt-vine i {
  display: block;
  position: relative;
  width: 40%;
  height: 100%;
  background: linear-gradient(90deg, var(--bf-sap), var(--bf-wheat));
  border-radius: inherit;
  transition: width 400ms var(--bf-ease);
  box-shadow: inset 0 -2px 4px rgba(14, 44, 30, 0.12);
}

.tt-meter.is-full .tt-vine i {
  width: 100%;
}

.tt-meter.is-full .tt-vine i::after {
  content: "";
  position: absolute;
  right: 0.35rem;
  top: 50%;
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 50%;
  background: var(--bf-pith);
  transform: translateY(-50%);
  box-shadow: 0 0 0 2px var(--bf-wheat);
}

/* —— Card mosaic layout —— */
.tt-layout {
  display: grid;
  gap: clamp(1rem, 2.4vw, 1.35rem);
  margin-top: 1.25rem;
}

.tt-lines {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 18rem), 1fr));
  gap: 0.75rem;
}

/* —— Kraft tag rows —— */
.tt-line {
  display: grid;
  grid-template-columns: 5rem minmax(0, 1fr);
  grid-template-rows: auto auto;
  grid-template-areas:
    "thumb body"
    "thumb total";
  gap: 0.45rem 0.75rem;
  align-items: start;
  padding: 0.75rem 0.75rem 0.75rem 0.55rem;
  background: linear-gradient(175deg, var(--bf-kraft) 0%, var(--bf-paper) 38%);
  border-radius: 0.35rem 0.75rem 0.35rem 0.75rem;
  box-shadow: var(--bf-shadow);
  border: 1px solid rgba(201, 146, 18, 0.28);
  position: relative;
}

.tt-line::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.65rem;
  bottom: 0.65rem;
  width: 0.35rem;
  border-radius: 0 0.25rem 0.25rem 0;
  background: var(--bf-wheat);
}

.tt-thumb {
  grid-area: thumb;
  display: block;
  border-radius: var(--bf-radius-sm);
  overflow: hidden;
  background: #0a1a12;
  line-height: 0;
  margin-left: 0.35rem;
}

.tt-thumb img {
  width: 5rem;
  height: 5rem;
  object-fit: cover;
  transition: transform 240ms var(--bf-ease);
}

.tt-thumb:hover img,
.tt-thumb:focus-visible img {
  transform: scale(1.05);
}

.tt-body {
  grid-area: body;
  display: grid;
  gap: 0.35rem;
  min-width: 0;
}

body.a114-body a.tt-title,
.tt-title {
  color: var(--bf-ink);
  text-decoration: none;
  font-weight: 700;
  line-height: 1.25;
}

.tt-title:hover,
.tt-title:focus-visible {
  color: var(--bf-forest);
}

.tt-title strong {
  font-size: 0.92rem;
  font-weight: 700;
}

.tt-unit {
  margin: 0;
  color: var(--bf-mute);
  font-size: 0.82rem;
}

.tt-qty {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem 0.65rem;
  margin-top: 0.15rem;
}

.tt-qty-label {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--bf-mute);
}

.tt-step {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

.tt-nudge {
  min-width: 40px;
  min-height: 40px;
  border: 1px solid var(--bf-line);
  border-radius: var(--bf-pill);
  background: var(--bf-pith);
  color: var(--bf-forest);
  cursor: pointer;
  font-size: 1.1rem;
  line-height: 1;
  font-weight: 700;
}

.tt-nudge:hover,
.tt-nudge:focus-visible {
  background: var(--bf-wheat);
  border-color: var(--bf-wheat);
  color: var(--bf-ink);
}

.tt-step input {
  width: 3.5rem;
  max-width: 3.5rem;
  flex: 0 0 3.5rem;
  text-align: center;
  font-weight: 700;
  min-height: 40px;
  padding: 0.35rem;
}

.tt-line-total {
  grid-area: total;
  text-align: left;
  padding-left: 0.35rem;
}

.tt-line-total em {
  display: block;
  font-style: normal;
  font-family: var(--bf-display);
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--bf-forest);
  white-space: nowrap;
}

.tt-sum {
  background: var(--bf-forest);
  color: var(--bf-pith);
  border-radius: var(--bf-radius);
  padding: clamp(1rem, 2.4vw, 1.2rem);
  display: grid;
  gap: 0.55rem;
  box-shadow: var(--bf-shadow);
  border: 1px solid rgba(255, 243, 194, 0.1);
}

.tt-sum p {
  margin: 0;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.75rem;
  font-size: 0.92rem;
}

.tt-sum strong {
  font-family: var(--bf-display);
  font-weight: 700;
  color: var(--bf-pith);
}

.tt-sum-total {
  margin-top: 0.25rem;
  padding-top: 0.65rem;
  border-top: 1px solid rgba(255, 243, 194, 0.18);
  font-size: 1.02rem;
}

.tt-sum-total strong {
  font-size: clamp(1.15rem, 2.6vw, 1.35rem);
}

.tt-secure {
  margin: 0.15rem 0 0.35rem;
  font-size: 0.84rem;
  line-height: 1.45;
  color: rgba(255, 243, 194, 0.78);
}

.tt-sum .a114-btn--ghost {
  color: var(--bf-pith);
  border-color: rgba(255, 243, 194, 0.45);
  background: transparent;
}

.tt-sum .a114-btn--ghost:hover,
.tt-sum .a114-btn--ghost:focus-visible {
  background: rgba(255, 243, 194, 0.12);
  color: var(--bf-pith);
  border-color: var(--bf-pith);
}

.tt-actions {
  display: grid;
  gap: 0.55rem;
  margin-top: 0.15rem;
}

.tt-go {
  width: 100%;
  text-align: center;
}

.tt-sticky {
  display: none;
}

.tt-nudge:focus-visible,
.tt-thumb:focus-visible,
.tt-title:focus-visible {
  outline: 2px solid var(--bf-wheat);
  outline-offset: 2px;
}

@media (min-width: 640px) {
  .tt-actions {
    grid-template-columns: 1fr 1fr;
  }

  .tt-line {
    grid-template-columns: 5.5rem minmax(0, 1fr) auto;
    grid-template-rows: auto;
    grid-template-areas: "thumb body total";
    align-items: center;
  }

  .tt-thumb img {
    width: 5.5rem;
    height: 5.5rem;
  }

  .tt-line-total {
    text-align: right;
    align-self: center;
    padding-left: 0;
  }
}

@media (min-width: 840px) {
  .tt-layout {
    grid-template-columns: minmax(0, 1.28fr) minmax(17rem, 0.72fr);
    align-items: start;
  }

  .tt-lines {
    grid-template-columns: 1fr;
  }

  .tt-sum {
    position: relative;
    top: auto;
  }
}

@media (max-width: 839px) {
  .tt-sticky {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.6rem;
    position: relative;
    left: auto;
    right: auto;
    bottom: auto;
    z-index: auto;
    margin-top: 1rem;
    padding: 0.55rem 0.65rem 0.55rem 0.85rem;
    background: var(--bf-forest);
    color: var(--bf-pith);
    border-radius: var(--bf-pill);
    box-shadow: 0 12px 28px rgba(8, 22, 16, 0.32);
    border: 1px solid rgba(255, 243, 194, 0.14);
  }

  .tt-sticky span {
    min-width: 0;
    font-size: 0.82rem;
    font-weight: 700;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .tt-sticky .a114-btn {
    flex-shrink: 0;
    min-height: 44px;
    padding-inline: 1rem;
    font-size: 0.82rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .tt-vine i,
  .tt-thumb img {
    transition: none;
  }

  .tt-thumb:hover img,
  .tt-thumb:focus-visible img {
    transform: none;
  }
}
