html, body {
  font-family: Anonymous Pro, monospace, sans-serif;
}

:root {
  --ink: #000000;
}

.header-grid{
  display:flex;
  width:100%;
 align-items: center;   /* was: flex-end */
  min-height: 70px;   
}
.logo-cell {
  width: 70%;
  height: auto;
  margin-left: 5%;
   align-items: center;
  
}
.logo-img {
  width: 8%;           /* true size = final, small, in-nav size */
  height: auto;
  display: block;
  transform-origin: top left;
  z-index: 100;         /* sit above the grid while displaced over it */
  position: relative;   /* establishes stacking so z-index applies */
}


#page-index {
  --logo-start-x: 1px;
  --logo-start-y: 1px;
  --logo-start-scale: 4;
}

.livroum{
  width: 70%;
  height: auto;
}
.livrodois{
  width: 70%;
  height: auto;
}
.nav-container {
  width: 70%;
  height:auto;  
  display:flex;
 
}

.nav-cell {
  flex:2;
  display: flex;
  text-decoration: none;
  color: #F66B0E;
  font-size: 24px;
}

/* the underline lives on this inner span instead of .nav-cell itself:
   .nav-cell is stretched wide by `flex: 2` for spacing, but this span
   is only as wide as the word, so the underline matches the text */
.nav-label {
  position: relative;
  padding-bottom: 4px;
  width: fit-content;
}

.nav-label::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 2px;
  background: #F66B0E;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.25s ease;
}

.nav-cell:hover .nav-label::after,
.nav-cell.current .nav-label::after {
  transform: scaleX(1);
}

.search-cell {
  grid-column: span 2;
  display: flex;
  border-bottom: 2px solid #F66B0E;
  padding-bottom: 2px;
  max-width: 200px;
  margin-left: auto;
  width: 70%;

}

.search-input {
  border: none;
  outline: none;
  background: transparent;
  width: 100%;
  font-size: 16px;
  color: #000000;
}

  #cestoGrid {
  min-height: 1600px; 
}

button {
  background: none;
  border: none;
  cursor: pointer;
}

search-icon {
  max-width: 100px;
}

/* --- MAIN GRID SECTION ---
   IMPORTANT: every page-specific override below now uses `height`
   (not just `min-height`). With CSS Grid, an implicit "auto" row only
   stretches to fill its container when the container has a *definite*
   height — `min-height` alone doesn't count as definite for that
   purpose. That's why the .column divs were collapsing to ~0px tall:
   only their own decorative border showed near the top of the page,
   while the absolutely-positioned cards below kept rendering in the
   right spot but with no visible grid framing around them, and a big
   gap before the footer. Since these are hand-tuned fixed layouts
   anyway, an explicit `height` (plus `grid-template-rows: 1fr`) fixes
   it reliably. */
.grid {
  position: relative;
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  grid-template-rows: 1fr;
  width: 100%;
  height: 1400px;
  min-height: 1400px;
  border-bottom: 4px solid #000000;
 overflow: visible; 
 
}


/* Base Vertical Columns */
.column {
  height: 100%;
  border-right: 4px solid #0a0a0a;
  border-top: 4px solid #0a0a0a;
  border-left: 4px solid #0a0a0a;
  border-bottom: 4px solid #0a0a0a;
  border-color: #0a0a0a;                 
}

.shortcolumn {
  display: flex;
  position: relative;
  top: 0%;   /* was: 22% — this is now the default/settled state for every page */
}

/* add this new rule so the index page still starts offset before scrolling */
#page-index .shortcolumn {
  top: 22%;
}

.column:nth-child(2) {
  border-right: 4px solid #000000;
}


@keyframes logo-to-nav {
  from {
    transform: translate(var(--logo-start-x), var(--logo-start-y))
               scale(var(--logo-start-scale));
  }
  to {
    transform: translate(0, 0) scale(1);
  }
}

@supports (animation-timeline: scroll()) {
  #page-index .logo-img {
    animation: logo-to-nav ease-in both;
    animation-timeline: scroll(root block);
    animation-range: 200px 200px;
  }
}

@supports not (animation-timeline: scroll()) {
  #page-index .logo-img { transform: translate(0, 0) scale(0.5); }
}

@keyframes shortcol-settle {
  from { top: 22%; }
  to   { top: 0%; }
}

.header-grid {
  position: sticky;
  top: 0;
  z-index: 50;
  background: #fefefe;
}

#page-index .shortcolumn {
    animation: shortcol-settle ease-in both;
    animation-timeline: scroll(root block);
    animation-range: 200px 200px;
}


/* --- OVERLAY CARDS --- */
.card {
  position: absolute;
  background: #fefefe;
  border: 2px solid #000000;
  padding: 20px;
  z-index: 5;
  text-align: center;
  box-sizing: border-box;
}

/* generic page-title card, e.g. "sobre" / "catálogo" / "cesto" */
.card-page-title {
  top: -110px;
  left: 44%;
  width: calc(12% + 4px);
  padding: 16px 20px;
  border: 3px solid #000000;
}

.card-page-title h1 {
  color: #F66B0E;
  font-size: 32px;
  text-align: center;
  letter-spacing: 1.5px;
  font-weight: normal;
  margin: 0;
}

/* Banner box (home) */
.card-banner {
  left: 50.3%;
  top: 100px;
  width: calc(36.9% + 4px);
  text-align: left;
  padding: 30px;
  border-bottom: 4px solid #000000;
  margin-left: -2px;
}

.banner-subtitle {
  color: #F66B0E;
  font-size: 32px;
  letter-spacing: 1.5px;
  margin: 0 0 15px 0;
  text-transform: uppercase;
}

.banner-title {
  color: #000000;
  font-size: 20px;
  font-family: monospace, sans-serif;
  font-weight: normal;
  line-height: 1.4;
  margin: 0;
  text-transform: uppercase;
}

.card-livros {
  top: 400px;
  left: 12.8%;
  width: calc(36.9% + 4px);
  margin-left: -2px;
}

.card-musica {
  top: 880px;
  left: 50%;
  width: calc(36.9% + 4px);
  margin-left: 4px;
}

/* LIVROS / MÚSICA header now doubles as a link into the filtered
   catálogo — keep it looking like plain text, not a link */
.card-header-link {
  display: block;
  color: inherit;
  text-decoration: none;
}

.card-header-link:hover .card-title {
  text-decoration: underline;
  text-underline-offset: 4px;
}

.card-subtitle {
  display: block;
  letter-spacing: 2px;
  font-size: 12px;
  color: #000000;
}

.card-title {
  color: #F66B0E;
  font-size: 32px;
  margin: 8px 0 20px 0;
  font-weight: normal;
}

.card-items {
  display: flex;
  justify-content: space-around;
  gap: 20px;
}

.discoum {
  width: 70%;
  height: auto;
}

.discodois {
  width: 70%;
  height: auto;
}

.price {
  color: #000000;
  margin-top: 10px;
  font-size: 14px;
}

/* =========================================================
   PAGE-SPECIFIC GRID HEIGHTS
   Each value = bottom edge of that page's lowest element + ~120px buffer.
   Using `height` here (see note above the base .grid rule) so the
   column borders actually stretch to match.
   ========================================================= */

#page-home .grid {
  height: 1350px; /* card-musica ends ~1230px */
  min-height: 1350px;
}

#page-catalogo .grid {
  height: 1400px; /* row 2 products end ~960 + ~380 card height; grown further via JS as more rows load */
  min-height: 1400px;
}

#page-sobre .grid {
  height: 1400px; /* card-sobre-text-bottom ends ~920 + text block height */
  min-height: 1400px;
}

#page-item .grid {
  height: 1280px; /* card-item-add-btn ends ~1000 + button height */
  min-height: 1280px;
}
/* --- FOOTER --- */
.footer-grid {
  position: relative;
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  width: 100%;
  padding: 20px 0 40px 0;
  border-bottom: 2px solid #000000;
}

.footer-col.contact {
  grid-column: 1 / span 4;
  padding-right: 15px;
}

.footer-col.address {
  grid-column: 6 / span 4;
  padding-left: 45px;
}

.footer-col {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-family: monospace, sans-serif;
  font-size: 24px;
}

.footer-label {
  color: #000000;
}

.footer-value {
  color: #000000;
  text-decoration: none;
}

.footer-nav {
  grid-column: 8 / span 1;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  font-size: 18px;
}

.footer-nav a {
  position: relative;
  margin-top: 12px;
  color: #F66B0E;
  display: inline-block;
  width: fit-content;
}

.footer-nav a::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -2px;
  width: 100%;
  height: 2px;
  background: #F66B0E;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.25s ease;
}

.footer-nav a:hover::after,
.footer-nav a.current::after {
  transform: scaleX(1);
}

/* =========================================================
   SOBRE PAGE
   ========================================================= */
.card-sobre-image {
  top: 380px;
  left: 12.5%;
  width: calc(25% + 4px);
  margin-left: -2px;
  height: 480px;
  padding: 0;
  background: #a2544c;
  border: none;
}

.card-sobre-text-top {
  top: 480px;
  left: 50%;
  width: calc(37.5% + 4px);
  margin-left: -2px;
  text-align: left;
  font-size: 15px;
  line-height: 1.6;
  color: #000000;
}

.card-sobre-text-bottom {
  top: 920px;
  left: 12.5%;
  width: calc(37.5% + 4px);
  margin-left: -2px;
  text-align: left;
  font-size: 15px;
  line-height: 1.6;
  color: #000000;
}

/* =========================================================
   CATÁLOGO PAGE
   ========================================================= */

.filter-select {
  position: relative;
}

.filter-select-btn {
  width: 100%;
  text-align: left;
  border: 2px solid #000000;
  background: transparent;
  font-family: monospace, sans-serif;
  font-size: 14px;
  color: #000000;
  padding: 8px 10px;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.card-filtros {
  top: 100px;
  left: 0;
  width: calc(24.8% + 4px);
  margin-left: -1px;
  text-align: left;
  border: #000000 4px solid;
}


.filtros-toggle {
  background: none;
  border: none;
  font-family: monospace, sans-serif;
  font-size: 22px;
  color: #000000;
  cursor: pointer;
  padding: 0;
}

.card-filter-fields {
  top: 175px;
  left: 0;
  width: calc(100% + 4px);
  margin-left: -2px;
  display: none;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  text-align: left;
  border-bottom: 4px solid #000000;
}

.card-filter-fields.open {
  display: grid;
}

.filter-field label {
  display: block;
  font-size: 13px;
  color: #000000;
  margin-bottom: 6px;
}

.filter-field input {
  width: 100%;
  border: 2px solid #000000;
  background: transparent;
  font-family: monospace, sans-serif;
  font-size: 14px;
  color: #000000;
  padding: 8px 10px;
}


.filter-select-btn::after {
  content: '\2304';
  color: #F66B0E;
  font-size: 14px;
  margin-left: 8px;
}

.filter-select.open .filter-select-btn::after {
  content: '\2303';
}

.filter-select.open .filter-select-btn {
  border-color: #F66B0E;
  color: #F66B0E;
}

.filter-select-options {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  width: 100%;
  max-height: 160px;
  overflow-y: auto;
  list-style: none;
  margin: 0;
  padding: 0;
  background: #fefefe;
  border: 2px solid #000000;
  z-index: 20;
  display: none;
}

.filter-select.open .filter-select-options {
  display: block;
}

.filter-select-options li {
  padding: 8px 10px;
  font-size: 14px;
  color: #000000;
  cursor: pointer;
  border-bottom: 1px solid #e2e2e2;
}

.filter-select-options li:last-child {
  border-bottom: none;
}

.filter-select-options li:hover,
.filter-select-options li.selected {
  background: #F66B0E;
  color: #fefefe;
}

.filter-select-options::-webkit-scrollbar {
  width: 6px;
}
.filter-select-options::-webkit-scrollbar-thumb {
  background: #000000;
}
.filter-select-options::-webkit-scrollbar-track {
  background: transparent;
}
.card-product {
  padding: 20px;
  text-align: center;
  
}

.product-price {
  text-align: right;
  color: #000000;
  font-size: 16px;
  margin: 0 0 12px 0;
}

.product-cover {
  width: 130px;
  aspect-ratio: 2/3;
  object-fit: cover;
  border: 1px solid #ddd;
  margin-bottom: 18px;
}

.product-title {
  color: #000000;
  font-size: 14px;
  line-height: 1.5;
  margin: 0;
}

a {
  text-decoration: none;
}

/* Loading indicator shown at the bottom of the catálogo grid while more products load */
.catalogo-loading {
  position: absolute;
  left: 0;
  width: 100%;
  text-align: center;
  font-size: 14px;
  color: #F66B0E;
  letter-spacing: 1px;
}


/* =========================================================
   ITEM PAGE
   ========================================================= */

.card-item-title {
  top: 100px;
  left: 25%;
  width: calc(50% + 4px);
  margin-left: -2px;
  text-align: center;
}

.card-item-title h1 {
  color: var(--ink);
  font-size: 32px;
  font-weight: normal;
  margin: 0 0 8px 0;
}

.card-item-title p {
  color: var(--ink);
  font-size: 16px;
  margin: 0;
}

.card-item-cover {
  top: 340px;
  left: 6.25%;
  width: calc(25% + 4px);
  margin-left: -2px;
  padding: 0;
}

.card-item-cover img {
  width: 100%;
  aspect-ratio: 2 / 3;
  object-fit: cover;
  display: block;
}

.card-item-description-top {
  top: 340px;
  left: 38%;
  width: calc(49% + 4px);
  margin-left: -2px;
  text-align: left;
  font-size: 15px;
  line-height: 1.6;
  color: var(--ink);
}

.card-item-description-bottom {
  top: 760px;
  left: 6.25%;
  width: calc(56.5% + 4px);
  margin-left: -2px;
  text-align: left;
  font-size: 15px;
  line-height: 1.6;
  color: var(--ink);
}

.card-item-specs {
  top: 760px;
  left: 68%;
  width: calc(25.75% + 4px);
  margin-left: -2px;
  text-align: left;
  padding: 0;
}

.spec-row {
  display: flex;
  justify-content: space-between;
  padding: 12px 20px;
  border-bottom: 2px solid var(--ink);
  font-size: 14px;
  color: var(--ink);
}

.spec-row:first-child {
  border-top: 2px solid var(--ink);
}

/* Add-to-cart button: positioned like the other absolute cards, and
   now visually styled like the checkout button so it reads as a real
   button instead of bare text. `.card-item-add-btn.checkout-btn`
   cancels the margin-top that class carries in its normal context
   (stacked under the cart summary) so it sits right where
   `top: 1000px` puts it. */
.card-item-add-btn {
  position: absolute;
  top: 1000px;
  left: 68%;
  width: calc(25.75% + 4px);
  margin-left: -2px;
}

/* Compound selector = higher specificity than plain .checkout-btn,
   so these values win over checkout-btn's `width: 100%` (meant for
   the drawer, where it should fill the sidebar) regardless of the
   order the rules appear in the file. */
.card-item-add-btn.checkout-btn {
  position: absolute;
  top: 1000px;
  left: 68%;
  width: calc(25.75% + 4px);
  margin-left: -2px;
  margin-top: 0;
}

/* =========================================================
   CART DRAWER
   ========================================================= */

body.cesto-open {
  overflow: hidden;
}


/* BACKDROP */

.cesto-backdrop {
  position: fixed;
  inset: 0;

  background: rgba(0, 0, 0, 0.35);

  opacity: 0;
  visibility: hidden;

  transition:
    opacity 0.3s ease,
    visibility 0.3s ease;

  z-index: 9998;
}

.cesto-backdrop.open {
  opacity: 1;
  visibility: visible;
}


/* DRAWER */

.cesto-drawer {
  position: fixed;

  top: 0;
  right: 0;
  bottom: 0;

  width: min(420px, 92vw);

  background: #fff;

  border-left: 1px solid #000;

  transform: translateX(100%);

  transition: transform 0.35s ease;

  z-index: 9999;

  display: flex;
  flex-direction: column;

  overflow: hidden;
}

.cesto-drawer.open {
  transform: translateX(0);
}


/* HEADER */

.cesto-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;

  padding: 20px;

  border-bottom: 1px solid #000;
}

.cesto-drawer-header h2 {
  margin: 0;

  font-size: 28px;
  font-weight: 400;
}

.cesto-drawer-close {
  appearance: none;

  border: 0;
  background: none;

  font-size: 32px;
  line-height: 1;

  cursor: pointer;

  padding: 0;
}


/* BODY */

.cesto-drawer-body {
  flex: 1;

  overflow-y: auto;

  padding: 20px;
}


/* EMPTY CART */

.cesto-empty {
  text-align: center;

  padding: 60px 20px;
}

.cesto-empty p {
  margin-bottom: 30px;

  line-height: 1.5;
}

.cesto-empty a {
  display: inline-block;

  padding: 12px 20px;

  border: 1px solid #000;

  color: #000;

  text-decoration: none;
}


/* CART ITEM */

.cesto-item {
  display: flex;

  gap: 15px;

  padding: 18px 0;

  border-bottom: 1px solid #000;
}

.cesto-item-image {
  width: 80px;
  min-width: 80px;
  height: 110px;

  overflow: hidden;

  background: #eee;
}

.cesto-item-image img {
  width: 100%;
  height: 100%;

  object-fit: cover;
}

.cesto-item-info {
  flex: 1;
}

.cesto-item-info h3 {
  margin: 0 0 5px;

  font-size: 15px;
  font-weight: 500;

  line-height: 1.3;
}

.cesto-item-author {
  margin: 0 0 8px;

  font-size: 13px;
}

.cesto-item-price {
  margin: 0 0 12px;

  font-size: 14px;
}


/* QUANTITY */

.cesto-quantity {
  display: flex;

  align-items: center;

  gap: 10px;

  margin-bottom: 10px;
}

.quantity-btn {
  width: 28px;
  height: 28px;

  border: 1px solid #000;

  background: #fff;

  cursor: pointer;

  font-size: 18px;

  display: flex;
  align-items: center;
  justify-content: center;
}

.quantity-btn:hover {
  background: #000;
  color: #fff;
}


/* REMOVE */

.remove-item {
  border: 0;

  padding: 0;

  background: none;

  text-decoration: underline;

  cursor: pointer;

  font-size: 12px;
}


/* FOOTER */

.cesto-drawer-footer {
  padding: 20px;

  border-top: 1px solid #000;

  background: #fff;
}

.summary-line {
  display: flex;

  justify-content: space-between;

  margin-bottom: 10px;

  font-size: 14px;
}

.summary-line.total {
  margin-top: 15px;
  margin-bottom: 20px;

  padding-top: 15px;

  border-top: 1px solid #000;

  font-size: 18px;
}

.summary-line .amount {
  font-weight: 600;
}


/* CHECKOUT BUTTON */

.checkout-btn {
  width: 100%;

  padding: 15px;

  border: 1px solid #000;

  background: #000;

  color: #fff;

  cursor: pointer;

  font-family: inherit;

  font-size: 15px;
}

.checkout-btn:hover {
  background: #fff;
  color: #000;
}

.checkout-btn:disabled {
  opacity: 0.4;

  cursor: not-allowed;
}


/* MOBILE */

@media (max-width: 600px) {

  .cesto-drawer {
    width: 100%;
  }

  .cesto-drawer-header {
    padding: 16px;
  }

  .cesto-drawer-body {
    padding: 16px;
  }

  .cesto-drawer-footer {
    padding: 16px;
  }

}

/* =========================================================
   MOBILE LAYOUT
   The desktop layout art-directs every card with
   `position: absolute; top: Npx; left: N%` inside a fixed-height
   `.grid`. That can't reflow on its own, so on mobile `.grid`
   drops out of CSS Grid entirely (`display: block`) and `.card`
   goes back to normal document flow (`position: relative` — not
   `static`, so z-index still applies) so everything stacks
   top-to-bottom in source order, full width. The decorative
   `.column` divs are kept as 4 full-height background stripes
   behind the stack, instead of 8 grid tracks.
   Every rule here is `!important`: `.grid`/`.card` are targeted by
   several higher-specificity, non-mobile rules elsewhere in this
   file (id-scoped heights, inline `style="top:...px"` on product
   cards, etc.), so without `!important` this block loses those
   cascade fights silently.
   ========================================================= */

@media (max-width: 768px) {

  html, body {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
  }

  /* ---------- HEADER ---------- */

  .header-grid {
    flex-direction: column;
    align-items: center;
    min-height: auto;
    padding: 24px 0 14px;
    gap: 10px;
  }

  .logo-cell {
    width: auto;
    margin: 0;
  }

  .logo-img,
  #page-index .logo-img {
    width: 130px !important;
    transform: none !important;
    animation: none !important;
  }

  #page-index .shortcolumn {
    top: 0 !important;
    animation: none !important;
  }

  .nav-container {
    width: 100%;
    justify-content: space-around;
    padding: 0 16px;
  }

  .nav-cell {
    flex: none;
    font-size: 15px;
  }

  .search-cell {
    width: auto;
    max-width: none;
    margin-left: 0;
    border-bottom: none;
    padding-bottom: 0;
  }

  .search-input {
    display: none; /* icon-only search trigger on mobile */
  }


  /* ---------- GRID → SINGLE STACK ---------- */

  .grid {
    display: block !important;
    position: relative;
    height: auto !important;
    min-height: 0 !important;
    border-bottom: none;
    padding: 28px 16px 40px;
  }

  /* decorative vertical lines: only 4 of the 8 shown, as full-height
     background stripes behind the stacked cards instead of grid
     tracks */
  .grid > .column,
  .grid > .shortcolumn {
    position: absolute !important;
    top: 0 !important;
    bottom: 0 !important;
    height: auto !important;
    z-index: 0 !important;
  }
  .grid > .column:nth-child(2),
  .grid > .column:nth-child(4),
  .grid > .column:nth-child(6),
  .grid > .column:nth-child(8) {
    display: none !important;
  }
  .grid > .column:nth-child(1) { left: 0%  !important; width: 25% !important; }
  .grid > .column:nth-child(3) { left: 25% !important; width: 25% !important; }
  .grid > .column:nth-child(5) { left: 50% !important; width: 25% !important; }
  .grid > .column:nth-child(7) { left: 75% !important; width: 25% !important; }


  /* ---------- CARDS: back to normal flow, full width, stacked, above the columns ---------- */

  .card {
    position: relative !important;
    top: auto !important;
    left: auto !important;
    right: auto !important;
    width: 100% !important;
    margin: 0 0 24px 0 !important;
    z-index: 2 !important;
  }

  .card-page-title {
    width: fit-content !important;
    margin: 0 auto 24px !important;
  }

  .card-items {
    flex-wrap: wrap;
  }

  /* catálogo: filters collapse to 2 columns, product grid to 1 column */
  .card-filter-fields {
    grid-template-columns: repeat(2, 1fr);
  }

  .card-product {
    width: 100% !important;
  }


  /* ---------- FOOTER ---------- */

  .footer-grid {
    display: block;
    padding: 30px 16px 40px;
  }

  .footer-col.contact,
  .footer-col.address {
    padding: 0;
    margin-bottom: 24px;
  }

  .footer-nav {
    align-items: flex;

  }

  .footer-nav a {
    margin-top: 0;
    margin-left: 5%;
  }

}


/* =========================================================
   SMALL PHONES
   ========================================================= */

@media (max-width: 480px) {

  .logo-img,
  #page-index .logo-img {
    width: 100px !important;
  }

  .nav-cell {
    font-size: 16px;
  }

  .grid {
    padding: 20px 12px 32px;
  }

  .card-page-title h1 {
    font-size: 26px;
  }

  .card-filter-fields {
    grid-template-columns: 1fr;
  }

}