/* Grail brand layer. Every color and font comes from the theme tokens set in
   layouts/theme.liquid (config/settings_data.json). Section-specific rules live
   in each section's scoped style block; this file holds the shared vocabulary:
   display type, buttons, tags, stars, the shared product card and helpers. */

html { scroll-behavior: smooth; }
body {
  background-color: var(--page-bg, var(--clr-light));
  color: var(--clr-body);
  font-family: var(--ff-body), system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.55;
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; }
[hidden] { display: none !important; }
/* base global.css makes body a flex column; keep sections (and the footer, which clips its giant wordmark) from shrinking */
body > *, [data-fluid-template], [data-fluid-section] { flex-shrink: 0; }
.g-foot { flex-shrink: 0; }

/* Fraunces, soft optical settings, light weight, italic accents */
h1, h2, h3, h4, h5, h6,
.g-d {
  font-family: var(--ff-heading), Georgia, serif;
  font-weight: 340;
  letter-spacing: -0.015em;
  line-height: 1.04;
  font-variation-settings: "SOFT" 100, "opsz" 72;
  color: inherit;
}
h1 em, h2 em, h3 em, h4 em, .g-d em, .rte h1 em, .rte h2 em, .rte h3 em {
  font-family: var(--ff-italic), var(--ff-heading), Georgia, serif;
  font-style: italic;
}
.rte p { margin: 0; }
.rte p + p { margin-top: 0.8em; }

/* Small uppercase label */
.g-eyebrow, .rte .g-eyebrow {
  font: 500 12px/1.4 var(--ff-body), sans-serif;
  text-transform: uppercase;
  letter-spacing: .08em;
}

/* Buttons */
.g-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 46px; padding: 0 24px; border-radius: 6px; border: 0;
  background: var(--clr-primary); color: var(--clr-light);
  font: 600 13px/1 var(--ff-body), sans-serif; letter-spacing: .06em; text-transform: uppercase;
  text-decoration: none; cursor: pointer; transition: opacity .2s ease, transform .2s ease;
}
.g-btn:hover { opacity: .9; }
.g-btn:active { transform: translateY(1px); }
.g-btn--blush { background: var(--clr-accent); color: var(--clr-primary); }
.g-btn--outline { background: transparent; color: var(--clr-primary); border: 1px solid var(--clr-primary); }
.g-btn s { opacity: .6; font-weight: 400; }
.g-btn[disabled], .g-btn.is-loading { opacity: .6; pointer-events: none; }
.g-link {
  font: 500 13px/1.3 var(--ff-body), sans-serif; text-transform: uppercase; letter-spacing: .06em;
  text-decoration: underline; text-underline-offset: 3px; color: inherit;
}

/* Tags */
.g-tag {
  display: inline-block; padding: 4px 9px; border-radius: 4px;
  background: var(--clr-accent); color: var(--clr-primary);
  font: 600 11px/1.3 var(--ff-body), sans-serif; letter-spacing: .06em; text-transform: uppercase;
}
.g-tag--wine { background: var(--clr-primary); color: var(--clr-light); }
.g-tag--olive { background: var(--clr-success); color: var(--clr-white); }

/* Stars: gradient-filled glyphs, --r sets the filled share */
.g-stars {
  --r: 96%;
  display: inline-block; letter-spacing: 2px; font-size: 13px; line-height: 1;
  background: linear-gradient(90deg, currentColor var(--r), var(--clr-gray) var(--r));
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
  color: var(--clr-primary);
  font-family: system-ui, sans-serif;
}
.g-rate { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: inherit; text-decoration: none; }
.g-rate a, a.g-rate { text-decoration: underline; text-underline-offset: 3px; }
.g-rate__n { color: var(--clr-muted); }

/* Section header row: heading left, link right */
.g-sh { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; margin-bottom: 26px; }
.g-sh .rte h2 { font-size: 44px; }
@media (max-width: 767px) { .g-sh .rte h2 { font-size: 32px; } .g-sh { margin-bottom: 18px; } }

/* Shared product card (components/grail_card) */
.gcard { display: flex; flex-direction: column; min-width: 0; color: var(--clr-primary); }
.gcard__ph {
  position: relative; display: block; aspect-ratio: 4 / 5; border-radius: 10px; overflow: hidden;
  background: var(--clr-cream);
}
.gcard__ph img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .5s ease; }
.gcard:hover .gcard__ph img { transform: scale(1.03); }
.gcard__ph .g-tag { position: absolute; left: 12px; top: 12px; z-index: 1; }
.gcard__ph img.gcard__alt { position: absolute; inset: 0; opacity: 0; transition: opacity .35s ease; }
.gcard:hover .gcard__ph img.gcard__alt { opacity: 1; }
.gcard__body { display: flex; flex-direction: column; flex: 1; }
.gcard__rate { margin-top: 12px; font-size: 12px; }
.gcard__rate .g-stars { font-size: 12px; }
.gcard__title {
  font: 400 21px/1.15 var(--ff-heading), Georgia, serif; font-variation-settings: "SOFT" 100;
  margin: 6px 0 0; color: inherit; text-decoration: none;
}
.gcard__title a { color: inherit; text-decoration: none; }
.gcard__sub { font-size: 14px; line-height: 1.4; color: var(--clr-muted); margin: 3px 0 12px; }
.gcard__sub p { margin: 0; }
.gcard__spacer { flex: 1; }
.gcard__btn {
  width: 100%; height: 40px; border: 0; border-radius: 5px; margin-top: 4px;
  background: var(--clr-primary); color: var(--clr-light); cursor: pointer;
  font: 600 12px/1 var(--ff-body), sans-serif; letter-spacing: .06em; text-transform: uppercase;
  display: flex; justify-content: space-between; align-items: center; padding: 0 14px; text-decoration: none;
  transition: opacity .2s ease;
}
.gcard__btn:hover { opacity: .9; }
.gcard__btn s { opacity: .6; margin-right: 6px; font-weight: 400; }
.gcard__btn > span { white-space: nowrap; }
@media (max-width: 767px) {
  .gcard__btn { height: 44px; padding: 0 10px; font-size: 11px; letter-spacing: .04em; gap: 6px; }
  .gcard__btn s { margin-right: 4px; }
  .gcard__title { font-size: 18px; }
  .gcard__sub { font-size: 13px; }
}
@media (max-width: 380px) { .gcard__btn s { display: none; } }
.gcard__btn.is-added { background: var(--clr-success); }

/* Generic image fill */
.g-fill { width: 100%; height: 100%; object-fit: cover; display: block; }

/* Horizontal scroll rail (UGC, related) */
.g-rail { display: grid; grid-auto-flow: column; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; -ms-overflow-style: none; }
.g-rail::-webkit-scrollbar { display: none; }
.g-rail > * { scroll-snap-align: start; }
.g-arrow {
  width: 42px; height: 42px; border-radius: 50%; border: 1px solid var(--clr-primary); background: transparent;
  color: var(--clr-primary); display: inline-grid; place-items: center; cursor: pointer; transition: background .2s, color .2s;
}
.g-arrow:hover { background: var(--clr-primary); color: var(--clr-light); }
.g-arrow svg { width: 16px; height: 16px; }

/* Editor placeholders */
.g-ph-empty { width: 100%; height: 100%; min-height: 120px; display: grid; place-items: center; background: var(--clr-cream); color: var(--clr-muted); font-size: 12px; }

/* Cart page (Fluid's main_cart markup, restyled with brand tokens only) */
body .cart-content-section { color: var(--clr-primary); padding: 56px 0 40px; }
body .cart-content-section .container { max-width: 1280px; margin: 0 auto; padding: 0 40px; }
body .cart-content-section .page-title, body .cart-content-section .page-title p, body .cart-content-section .page-title h1 {
  font-family: var(--ff-heading), Georgia, serif; font-weight: 340; font-variation-settings: "SOFT" 100, "opsz" 72;
  font-size: 48px; line-height: 1.05; letter-spacing: -0.015em; color: var(--clr-primary);
}
body .cart-content-section #cart-items:empty { min-height: 220px; display: grid; place-items: center; border: 1px dashed var(--clr-gray); border-radius: 12px; background: var(--clr-cream); }
body .cart-content-section #cart-items:empty::before { content: "Your bag is empty. Start with The Grail Kit or a canister of Youth Powder."; color: var(--clr-muted); font-size: 15px; padding: 0 24px; text-align: center; }
body .cart-content-section .product-item { border-bottom: 1px solid var(--clr-gray); padding-bottom: 20px; }
body .cart-content-section .product-image { border-radius: 10px; background: var(--clr-cream); }
body .cart-content-section .product-name { color: var(--clr-primary); font-family: var(--ff-heading), Georgia, serif; font-weight: 400; font-size: 20px; }
body .cart-content-section .product-weight, body .cart-content-section .variant { color: var(--clr-muted); }
body .cart-content-section .product-price { color: var(--clr-primary); }
body .cart-content-section .order-summary { background: var(--clr-cream); border-radius: 12px; padding: 26px; color: var(--clr-primary); }
body .cart-content-section .order-summary .heading, body .cart-content-section .summary-heading, body .cart-content-section .order-summary .caption { color: var(--clr-primary); }
body .cart-content-section .summary-heading, body .cart-content-section .summary-heading p { font-family: var(--ff-heading), Georgia, serif; font-size: 24px; font-weight: 400; }
body .cart-content-section .order-summary .price { color: var(--clr-primary); }
body .cart-content-section .order-summary .icon svg, body .cart-content-section .order-summary .icon { color: var(--clr-muted); }
body .cart-content-section .order-summary a, body .cart-content-section .order-summary button, body .cart-content-section .btn {
  background: var(--clr-primary) !important; color: var(--clr-light) !important; border: 0 !important; border-radius: 6px !important; min-height: 52px;
  font: 600 13.5px var(--ff-body), sans-serif !important; letter-spacing: .08em; text-transform: uppercase;
}
@media (max-width: 767px) {
  body .cart-content-section { padding: 32px 0 24px; }
  body .cart-content-section .container { padding: 0 16px; }
  body .cart-content-section .page-title, body .cart-content-section .page-title p, body .cart-content-section .page-title h1 { font-size: 34px; }
}

/* Footer seals a little larger, tap targets on small links */
@media (max-width: 767px) {
  .g-foot__col li a { display: inline-block; padding: 6px 0; }
}

/* Mobile tap targets for shared controls */
@media (max-width: 767px) {
  .g-link, .g-btn--text, .featured-products .btn--text, .feature-grid__intro-link .g-btn, .feature-card .btn { display: inline-flex; align-items: center; min-height: 44px; }
  .g-btn { min-height: 48px; }
  .ugc-carousel__arrow { width: 44px; height: 44px; }
  .gcard__title a { display: inline-block; padding: 4px 0; }
  .nav__announce a { display: inline-block; padding: 6px 0; }
  .ph__crumbs a, .relp__nav-btn { display: inline-flex; align-items: center; min-height: 44px; min-width: 44px; justify-content: center; }
}
@media (max-width: 767px) {
  #main-navbar .site-logo { min-height: 44px; min-width: 44px; padding: 7px 0; }
  .gcard__title a, .ph__up-name { display: inline-block; padding: 12px 0; margin: -12px 0; }
  .g-foot__col li a, .g-foot__legal a { min-width: 44px; }
  .feature-grid__intro-link .g-btn, .g-sh .g-btn--text, .featured-products__intro-buttons .btn { min-height: 44px !important; display: inline-flex !important; align-items: center; }
  .ph__up .gcard__btn { height: 44px !important; }
  .prev__bar { padding: 13px 0 !important; min-height: 44px; }
  .prev__toolbar select { min-height: 44px; }
  .ph__qty input { width: 44px; }
  .ph__qty input { height: 100%; min-height: 44px; }
  .shopshow__sort select, .shopshow__search { min-height: 44px; }
  .shopshow__search input { min-height: 42px; }
}
