/* Alberdi Materials & Supply brand colors. Loaded only on store pages. */
.store {
  --black: #17191C;
  --forest: #14291F;
  --evergreen: #244B36;
  --sage: #A6B8A9;
  --equipment: #737B84;
  --concrete: #F4F5F1;
  --red-dirt: var(--evergreen);
  --red-dirt-dark: var(--forest);
  --muted: rgba(23, 25, 28, .78);
  --muted-on-dark: var(--sage);
  --line: rgba(115, 123, 132, .35);
}
/* Dark surfaces are forest green on store pages. --black is kept for text. */
.store .hero, .store .hero-black, .store .dark, .store .site-footer, .store .store-bar, .store .order-number, .store .site-header:has(.nav.open) { background: var(--forest); }
.store .ridge-top { color: var(--forest); }
.store .footer-bottom { border-top-color: rgba(166, 184, 169, .35); }
@media (max-width: 1280px) {
  .store .nav { background: var(--forest); }
  .store .nav a:not(.btn), .store .nav a:not(.btn):hover, .store .nav a[aria-current="page"] { border-bottom-color: rgba(166, 184, 169, .35); }
}
.store .btn { border-radius: 4px; transition: background-color .2s ease, border-color .2s ease, color .2s ease, transform .2s ease; }
.store .btn:not(.btn-outline):not(.btn-white) { color: var(--white); }
.store .btn:not(.btn-outline):not(.btn-white):hover { background: var(--sage); border-color: var(--sage); color: var(--black); }
/* Evergreen barely separates from forest, so buttons on dark surfaces get a sage edge. */
.store .on-dark .btn:not(.btn-outline):not(.btn-white), .store .site-header .btn:not(.btn-outline):not(.btn-white) { border-color: var(--sage); }
.store .btn-outline:hover { background: var(--sage); border-color: var(--sage); color: var(--black); }
.store .btn-outline.on-light:hover, .store .light-btn .btn-outline:hover { background: var(--evergreen); border-color: var(--evergreen); color: var(--white); }
.store .btn-white:hover { background: var(--sage); border-color: var(--sage); color: var(--black); }
.store .btn[disabled] { opacity: .5; cursor: not-allowed; }
.store .hero-tagline { margin-top: 1rem; font-size: clamp(1.25rem, 1rem + 1.2vw, 2rem); font-weight: 700; font-stretch: 110%; line-height: 1.2; color: var(--white); max-width: 34ch; }
.store [hidden] { display: none !important; }

/* Store navigation */
.store-bar { color: var(--white); border-bottom: 3px solid var(--sage); position: sticky; top: 0; z-index: 15; }
.store-bar ul { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 26px; padding-block: 6px; }
.store-bar a { display: block; padding: 10px 0; font-weight: 700; font-stretch: 108%; font-size: .9375rem; text-decoration: none; }
.store-bar a:hover, .store-bar a[aria-current="page"] { text-decoration: underline; text-underline-offset: 5px; text-decoration-color: var(--sage); text-decoration-thickness: 3px; }
.store-bar .cart-link { margin-left: auto; }
.store-brand a { padding-right: 8px; color: var(--sage); font-weight: 800; font-stretch: 112%; }
.cart-link a { display: inline-flex; align-items: center; gap: 8px; }
.cart-count { display: inline-flex; align-items: center; justify-content: center; min-width: 26px; height: 26px; padding-inline: 6px; border-radius: 13px; background: var(--sage); color: var(--black); font-size: .875rem; font-variant-numeric: tabular-nums; }
[id] { scroll-margin-top: 80px; }

/* Search and categories */
.catalog-tools { display: flex; flex-wrap: wrap; align-items: end; gap: 16px 24px; margin-bottom: 12px; }
.catalog-tools .field { flex: 1 1 280px; margin: 0; max-width: 480px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { min-height: 48px; padding: 8px 18px; border: 2px solid var(--evergreen); border-radius: 4px; background: var(--white); color: var(--black); font: inherit; font-weight: 700; cursor: pointer; transition: background-color .2s ease, color .2s ease; }
.chip:hover { background: var(--sage); }
.chip[aria-pressed="true"] { background: var(--evergreen); color: var(--white); }
.catalog-count { margin: 0 0 clamp(24px, 3vw, 40px); color: var(--muted); }
.category-block + .category-block { margin-top: clamp(48px, 6vw, 80px); }
.category-title { margin-bottom: 20px; padding-bottom: 10px; border-bottom: 4px solid var(--black); font-size: clamp(1.25rem, 1rem + 1vw, 1.75rem); text-transform: uppercase; font-stretch: 120%; }

/* Product cards read like a yard's spec sheet */
.product-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(20px, 2.4vw, 32px); }
.product { display: flex; flex-direction: column; overflow: hidden; border: 2px solid var(--line); border-radius: 6px; background: var(--white); box-shadow: 0 6px 18px rgba(20, 41, 31, .1); transition: transform .25s ease, border-color .25s ease, box-shadow .25s ease; }
.product:hover, .product:focus-within { border-color: var(--sage); box-shadow: 0 14px 30px rgba(20, 41, 31, .2); }
.product:hover { transform: translateY(-4px); }
.product-img { display: block; width: 100%; height: auto; aspect-ratio: 4 / 3; object-fit: cover; background: var(--concrete); }
.detail-img { display: block; width: 100%; height: auto; aspect-ratio: 4 / 3; object-fit: cover; background: var(--concrete); }
.no-photo { display: flex; align-items: center; justify-content: center; background: var(--concrete); color: var(--muted); font-weight: 600; }
.price-band { padding: 10px 16px; background: var(--evergreen); color: var(--white); font-size: 1.125rem; font-weight: 800; font-stretch: 110%; font-variant-numeric: tabular-nums; }
.product-body { display: flex; flex: 1; flex-direction: column; padding: 16px; }
.product-body h3 { margin-bottom: 8px; }
.product-body h3 a { text-decoration: none; }
.product-body h3 a:hover { text-decoration: underline; }
.spec { margin: auto 0 16px; }
.spec > div { display: grid; grid-template-columns: 84px minmax(0, 1fr); gap: 8px; padding-block: 7px; border-top: 1px solid var(--line); }
.spec dt { color: var(--muted); font-size: .9375rem; }
.spec dd { margin: 0; font-weight: 600; font-size: .9375rem; line-height: 1.35; }
.buy label { display: block; margin-bottom: 6px; font-weight: 700; }
.buy input { display: block; width: 100%; min-height: 52px; padding: 10px 12px; border: 0; font: inherit; }
.buy-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 10px; }
.buy-actions .btn { padding-inline: 8px; font-size: .9375rem; }
.buy-actions .btn:only-child { grid-column: 1 / -1; }
.add-status { min-height: 1.6em; margin: 8px 0 0; font-weight: 600; font-size: .9375rem; }
.unavailable { font-weight: 700; }
.store-error { padding: 12px 14px; margin: 0 0 10px; border: 2px solid var(--error); border-radius: 3px; color: var(--error); font-weight: 600; max-width: none; }

.product-detail { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(24px, 4vw, 56px); align-items: start; }
.product-detail .spec { margin: 20px 0; }
.product-detail .price-band { margin-bottom: 18px; }
.detail-category { margin-bottom: 8px; color: var(--muted); font-weight: 600; }

/* Info blocks */
.info-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(32px, 5vw, 72px); }
.info-grid h3 { margin-bottom: 8px; }
.inquiry-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(40px, 6vw, 88px); }
.inquiry-grid h2 { margin-bottom: 12px; font-size: clamp(1.5rem, 1.1rem + 1.4vw, 2.25rem); }
.inquiry-grid form { margin-top: 20px; }
.dark .field input, .dark .field textarea { border-color: var(--white); }
.dark .field .error { color: #ffb4b4; }

/* Cart */
.cart-layout { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: clamp(32px, 4vw, 64px); align-items: start; }
.cart-line { display: grid; grid-template-columns: minmax(0, 1fr) 150px 120px auto; gap: 12px 20px; align-items: center; padding-block: 18px; border-top: 2px solid var(--black); }
.cart-line-name h3 { margin-bottom: 4px; }
.cart-line-name p { margin: 0; color: var(--muted); font-size: .9375rem; }
.cart-line-qty label { display: block; margin-bottom: 4px; font-size: .9375rem; font-weight: 600; }
.cart-line-qty input { width: 100%; min-height: 52px; padding: 8px 10px; border: 0; font: inherit; }
.cart-line-total { font-weight: 800; font-variant-numeric: tabular-nums; text-align: right; }
.link-button { min-height: 44px; padding: 4px 6px; border: 0; background: none; color: inherit; font: inherit; text-decoration: underline; cursor: pointer; }
.panel { padding: clamp(18px, 2.2vw, 28px); border: 2px solid var(--black); }
.panel h2 { margin-bottom: 16px; font-size: 1.375rem; font-stretch: 112%; text-transform: none; }
.radio-row { display: flex; align-items: center; gap: 10px; min-height: 44px; font-weight: 600; cursor: pointer; }
.radio-row input { width: 22px; height: 22px; accent-color: var(--evergreen); }
.radio-row input[disabled] + span { color: var(--muted); }
.totals { margin: 16px 0 10px; }
.totals > div { display: flex; justify-content: space-between; gap: 16px; padding-block: 9px; border-top: 1px solid var(--line); }
.totals dd { margin: 0; font-weight: 700; font-variant-numeric: tabular-nums; text-align: right; }
.total-row { border-top: 3px solid var(--black) !important; font-size: 1.25rem; font-weight: 800; }
.delivery-note { padding: 10px 12px; margin-bottom: 8px; border-left: 6px solid var(--evergreen); background: var(--concrete); font-size: .9375rem; max-width: none; }

/* Checkout */
.checkout-layout { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: clamp(32px, 4vw, 64px); align-items: start; }
.checkout-layout fieldset { margin: 0 0 32px; padding: 0; border: 0; }
.checkout-layout legend { margin-bottom: 14px; padding: 0; font-size: 1.375rem; font-weight: 800; font-stretch: 112%; }
.review-sticky { position: sticky; top: 76px; }
.order-lines { width: 100%; border-collapse: collapse; margin-bottom: 12px; font-size: .9375rem; }
.order-lines th, .order-lines td { padding: 9px 6px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.order-lines thead th { border-bottom: 2px solid var(--black); }
.order-lines tbody th { font-weight: 700; }
.order-number { display: inline-flex; flex-direction: column; margin-bottom: 20px; padding: 16px 22px; color: var(--white); }
.order-number strong { color: var(--sage); font-size: clamp(1.5rem, 1.1rem + 1.5vw, 2.25rem); font-stretch: 112%; font-variant-numeric: tabular-nums; }
.confirmation .actions { margin-top: 24px; }
.confirmation .order-lines, .confirmation .totals, .confirmation .delivery-note { max-width: 720px; }

@media (max-width: 1100px) {
  .product-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cart-layout, .checkout-layout { grid-template-columns: minmax(0, 1fr); }
  .review-sticky { position: static; }
}
@media (max-width: 800px) {
  .product-detail, .info-grid, .inquiry-grid { grid-template-columns: minmax(0, 1fr); }
  .store-bar { position: static; }
}
@media (max-width: 640px) {
  .product-grid { grid-template-columns: minmax(0, 1fr); }
  .store-bar ul { gap: 0 16px; }
  .store-bar .cart-link { margin-left: 0; }
  .cart-line { grid-template-columns: minmax(0, 1fr) auto; }
  .cart-line-name { grid-column: 1 / -1; }
  .cart-line-total { grid-column: 1; text-align: left; }
  .order-lines thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .order-lines, .order-lines tbody, .order-lines tr, .order-lines th, .order-lines td { display: block; width: 100%; }
  .order-lines th, .order-lines td { border: 0; padding: 3px 0; }
  .order-lines tr { padding-block: 10px; border-bottom: 1px solid var(--line); }
  .order-lines td::before { content: attr(data-label) ": "; color: var(--muted); }
}

/* Short banner on cart, checkout and product pages so the work stays above the fold */
.store .hero-page.hero-black { min-height: clamp(260px, 36vh, 360px); }
.store .hero-page.hero-black .hero-body { padding-block: 104px clamp(60px, 8vw, 110px); }
.product > a { text-decoration: none; color: inherit; }
.product > a .no-photo span { text-decoration: none; }

/* Delivery breakdown lines under the mileage */
.totals .detail-row { border-top: 0; padding-block: 2px 8px; padding-left: 12px; color: var(--muted); font-size: .9375rem; }
.totals .detail-row dd { font-weight: 500; }

/* Tandem load ordering */
.load-price { display: block; color: var(--white); font-size: .875rem; font-weight: 600; }
.estimate { margin: 10px 0 0; font-size: .9375rem; }
.estimate > div { display: flex; justify-content: space-between; gap: 12px; padding-block: 4px; }
.estimate dt { color: var(--muted); }
.estimate dd { margin: 0; font-weight: 700; text-align: right; }
.estimate-cost { margin: 8px 0 0; padding-top: 8px; border-top: 2px solid var(--black); font-weight: 800; font-variant-numeric: tabular-nums; }
.cart-line { grid-template-columns: minmax(0, 1fr) minmax(220px, 300px) 100px auto; align-items: start; }
@media (max-width: 760px) {
  .cart-line { grid-template-columns: minmax(0, 1fr) auto; }
  .cart-line-name, .cart-line-qty { grid-column: 1 / -1; }
  .cart-line-total { grid-column: 1; text-align: left; }
}

/* Material quantity calculator */
.calculator { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(24px, 4vw, 56px); padding: clamp(18px, 3vw, 36px); border-top: 6px solid var(--evergreen); border-radius: 6px; background: var(--white); box-shadow: 0 10px 28px rgba(20, 41, 31, .14); }
.calc-inputs .field:last-child { margin-bottom: 0; }
.calc-prompt { color: var(--muted); font-weight: 600; }
.calc-list { margin: 0 0 12px; }
.calc-list > div { display: flex; justify-content: space-between; gap: 16px; padding-block: 9px; border-top: 1px solid var(--line); }
.calc-list dt { color: var(--muted); }
.calc-list dd { margin: 0; font-weight: 700; text-align: right; }
.calc-confirm:not(:empty) { margin-top: 20px; padding-top: 18px; border-top: 3px solid var(--black); }
.calc-confirm h4 { margin: 0 0 8px; font-size: 1.25rem; font-weight: 800; font-stretch: 112%; }
.calc-confirm h5 { margin: 0 0 6px; font-size: 1.0625rem; font-weight: 800; }
.calc-option { margin-top: 14px; padding: 16px; border: 1px solid var(--line); border-radius: 6px; }
.estimate-note { display: block; margin-top: 4px; color: var(--muted); font-size: .875rem; font-weight: 400; }
.product-calculator { margin-top: clamp(40px, 6vw, 72px); }
.product-calculator h2 { margin-bottom: 8px; }
.product-calculator > p { margin-bottom: 20px; }
@media (max-width: 900px) {
  .calculator { grid-template-columns: minmax(0, 1fr); }
}

/* Store banner photo: darker behind the text, so it stays readable over the white truck */
.store .hero-page:not(.hero-black)::before { background: linear-gradient(90deg, rgba(20, 41, 31, .95), rgba(20, 41, 31, .82) 48%, rgba(20, 41, 31, .25) 82%); }
@media (max-width: 800px) {
  .store .hero-page:not(.hero-black)::before { background: linear-gradient(rgba(20, 41, 31, .9), rgba(20, 41, 31, .82)); }
}

/* Softer, friendlier details across the store */
.store .field input, .store .field select, .store .field textarea { border-radius: 4px; }
.store .panel { border-radius: 6px; border: 1px solid var(--line); box-shadow: 0 6px 18px rgba(20, 41, 31, .1); }
.store .category-title { border-bottom-color: var(--evergreen); }
.store .estimate-cost { border-top-color: var(--line); }
.product-img, .detail-img { transition: transform .25s ease; }
.product > a:hover .product-img { transform: scale(1.03); }
.detail-img { border-radius: 6px; }
.order-number { border-radius: 6px; }
@media (prefers-reduced-motion: reduce) {
  .product-img, .detail-img { transition: none; }
  .product > a:hover .product-img { transform: none; }
}
.store .hero-black::before { display: none; }

/* Product page */
.product-hero { min-height: clamp(460px, 62vh, 640px); }
.store .hero-img { animation: slow-zoom 26s ease-out both; transform-origin: 60% 50%; }
@keyframes slow-zoom { from { transform: scale(1); } to { transform: scale(1.08); } }
.breadcrumb { margin-bottom: 14px; font-weight: 700; }
.breadcrumb a { color: var(--sage); text-underline-offset: 4px; }
.product-hero .lead { max-width: 52ch; }
.availability { display: inline-block; margin-top: 16px; padding: 6px 12px; border: 2px solid var(--sage); border-radius: 4px; color: var(--sage); font-weight: 700; }
.availability.off { border-color: var(--white); color: var(--white); }
.buy-panel { padding: clamp(18px, 2.4vw, 28px); border: 1px solid var(--line); border-top: 6px solid var(--forest); border-radius: 6px; background: var(--concrete); }
.buy-panel .estimate-cost { font-size: 1.25rem; color: var(--evergreen); }
.buy-panel .form-note { margin: 14px 0 0; }
.price-block { display: flex; flex-direction: column; gap: 2px; margin-bottom: 20px; }
.price-block strong { color: var(--evergreen); font-size: clamp(2.5rem, 2rem + 2.2vw, 3.75rem); font-weight: 800; font-stretch: 112%; line-height: 1; font-variant-numeric: tabular-nums; }
.price-block span { font-weight: 700; }
.price-block .price-per-ton { color: var(--muted); font-weight: 500; }
.store .product-purchase .product-detail { align-items: start; }
.product-purchase .detail-img { box-shadow: 0 14px 30px rgba(20, 41, 31, .2); }
.product-info { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(32px, 4vw, 56px); }
.product-info h2, .product-calculator h2 { font-size: clamp(1.375rem, 1.1rem + 1vw, 1.875rem); }
.product-info h2 { margin-bottom: 14px; padding-bottom: 10px; border-bottom: 3px solid var(--evergreen); }
.detail-spec { margin: 0; }
.related { color: inherit; text-decoration: none; }
.related-body { display: flex; flex-direction: column; gap: 4px; padding: 16px; }
.related-body strong { font-size: 1.3125rem; font-stretch: 112%; line-height: 1.2; }
.related-body span { font-weight: 700; text-decoration: underline; text-underline-offset: 4px; text-decoration-color: var(--evergreen); text-decoration-thickness: 2px; }
.product-calculator { margin-top: 0; }
.product-calculator .wrap > h2 { margin-bottom: 8px; }
.product-calculator .wrap > p { margin-bottom: 20px; }

/* Load quantity */
.stepper { display: grid; grid-template-columns: 56px minmax(0, 1fr) 56px; overflow: hidden; border: 2px solid var(--evergreen); border-radius: 4px; background: var(--white); color: var(--black); }
.stepper button { min-height: 52px; border: 0; background: var(--concrete); color: var(--black); font: inherit; font-size: 1.5rem; font-weight: 800; line-height: 1; cursor: pointer; touch-action: manipulation; transition: background-color .18s ease; }
.stepper button:hover { background: var(--sage); }
.stepper input { min-width: 0; text-align: center; font-weight: 800; font-size: 1.125rem; background: var(--white); color: var(--black); -moz-appearance: textfield; appearance: textfield; }
.stepper input::-webkit-outer-spin-button, .stepper input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.stepper :focus-visible { outline: 3px solid var(--black); outline-offset: -3px; box-shadow: none; }

/* Add to cart confirmation */
.store .add-button.added { background: var(--forest) !important; border-color: var(--sage) !important; color: var(--white) !important; animation: added-pop .35s ease-out; }
.add-button.added [data-label]::before { content: "\2713\00a0"; }
@keyframes added-pop { 40% { transform: scale(1.04); } }
.cart-count.bump { animation: count-bump .45s ease-out; }
@keyframes count-bump { 40% { transform: scale(1.35); } }

/* Sections fade in as they enter the viewport */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .55s ease-out, transform .55s ease-out; }
.reveal.in { opacity: 1; transform: none; }

@media (max-width: 1000px) {
  .product-info { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 800px) {
  .store-brand { flex-basis: 100%; }
}
@media (max-width: 760px) {
  .cart-line-qty .stepper { max-width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  .store .hero-img, .store .add-button.added, .cart-count.bump { animation: none; }
  .product, .product:hover { transition: none; transform: none; }
  .reveal { opacity: 1; transform: none; transition: none; }
}
