/* ============================================================
   SARVNIPUN — COMMERCE-ONLY additive styles (Option A)
   Loaded AFTER style.css + animations.css.
   RULES: ADD classes only. Never override brand tokens or
   existing selectors. All values reference :root tokens from
   style.css. Landing/content pages never load this file.
   Author: AURUM (Frontend, Yink360)
   ============================================================ */

/* ---- Header cart badge (only shared-header addition) ---- */
.cart-badge {
  position: absolute;
  top: -4px;
  right: -6px;
  background: var(--ochre);
  color: #fff;
  border-radius: 50px;
  font-family: var(--sans);
  font-size: .6rem;
  font-weight: 700;
  line-height: 1;
  min-width: 16px;
  padding: 2px 5px;
  text-align: center;
}
#cartLink { position: relative; }

/* ---- Size chips (shop + detail) ---- */
.size-chips {
  display: flex;
  gap: 8px;
  margin: 10px 0 4px;
  flex-wrap: wrap;
}
.chip-size {
  font-family: var(--sans);
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .04em;
  padding: 9px 14px;
  min-height: 40px;
  border-radius: 50px;
  border: 1.5px solid var(--line);
  background: var(--paper);
  color: var(--green-800);
  cursor: pointer;
  transition: all .25s ease;
}
.chip-size:hover { border-color: var(--green-600); }
.chip-size.is-active {
  background: var(--sage-soft);
  border-color: var(--green-600);
  color: var(--green-700);
}
.chip-size:disabled {
  opacity: .4;
  cursor: not-allowed;
  text-decoration: line-through;
}

/* ---- Quantity stepper ---- */
.qty-stepper {
  display: inline-flex;
  align-items: center;
  border: 1.5px solid var(--line);
  border-radius: 50px;
  overflow: hidden;
  margin: 14px 0;
  width: max-content;
  max-width: 160px;
}
.qty-stepper button {
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  border: none;
  background: var(--paper);
  font-size: 1.2rem;
  color: var(--green-700);
  cursor: pointer;
  transition: background .2s ease;
}
.qty-stepper button:hover { background: var(--sage-soft); }
.qty-stepper button:disabled { opacity: .4; cursor: not-allowed; }
.qty-stepper input {
  width: 46px;
  flex: 0 0 46px;
  height: 44px;
  text-align: center;
  border: none;
  background: transparent;
  font-family: var(--sans);
  font-weight: 700;
  font-size: 1rem;
  color: var(--ink);
}

/* ---- Two-column detail / cart / checkout grid ---- */
.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 44px;
  align-items: start;
}
@media (max-width: 860px) {
  .detail-grid { grid-template-columns: 1fr; gap: 28px; }
}

/* ---- Product-detail gallery ---- */
.gallery { position: sticky; top: 96px; }
.gallery img.main {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: contain;
  padding: 18px;
  border-radius: var(--radius);
  border: 8px solid var(--white);
  box-shadow: var(--shadow-lg);
  background: var(--paper);
}
.gallery-thumbs { display: flex; gap: 10px; margin-top: 14px; flex-wrap: wrap; }
.gallery-thumbs button {
  width: 64px;
  height: 64px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 2px solid var(--line);
  background: var(--sage-tint);
  cursor: pointer;
  padding: 0;
}
.gallery-thumbs button img { width: 100%; height: 100%; object-fit: contain; padding: 4px; display: block; background: var(--paper); }
.gallery-thumbs button.is-active { border-color: var(--ochre); }

/* ---- Buy panel ---- */
.detail-buy { display: grid; gap: 6px; }
.detail-buy .price { font-family: var(--serif); font-size: 2rem; color: var(--green-800); }
.detail-buy .price .mrp {
  font-family: var(--sans);
  font-size: 1rem;
  color: var(--muted);
  text-decoration: line-through;
  margin-left: 10px;
}
.badge-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }
.disclaimer-box {
  background: var(--sage-tint);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  font-size: .8rem;
  color: var(--muted);
  line-height: 1.55;
  margin-top: 20px;
}
.ship-note { font-size: .85rem; color: var(--green-600); margin-top: 6px; }

/* ---- Cart ---- */
.cart-table { display: grid; gap: 14px; }
.cart-row {
  display: grid;
  grid-template-columns: 72px 1fr auto auto auto;
  gap: 16px;
  align-items: center;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 16px;
  box-shadow: var(--shadow);
}
.cart-row img {
  width: 72px;
  height: 72px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  background: var(--sage-tint);
}
.cart-row .c-name { font-family: var(--serif); color: var(--green-800); font-size: 1.15rem; }
.cart-row .c-meta { color: var(--muted); font-size: .85rem; }
.cart-row .c-line { font-weight: 700; color: var(--ink); white-space: nowrap; }
.cart-row .c-remove {
  border: none;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 1.1rem;
  line-height: 1;
  padding: 6px;
}
.cart-row .c-remove:hover { color: var(--berry); }
.cart-row.is-error { border-color: var(--berry); }
.cart-row .c-error { grid-column: 2 / -1; color: var(--berry); font-size: .8rem; }
@media (max-width: 560px) {
  .cart-row { grid-template-columns: 60px 1fr auto; grid-auto-rows: auto; }
  .cart-row img { width: 60px; height: 60px; }
  .cart-row .qty-stepper { grid-column: 2 / 4; margin: 6px 0; }
  .cart-row .c-line { grid-column: 2; }
  .cart-row .c-remove { grid-column: 3; grid-row: 1; align-self: start; }
}

/* ---- Order summary card (cart + checkout) ---- */
.order-summary {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px;
  box-shadow: var(--shadow);
  position: sticky;
  top: 96px;
}
.order-summary h3 { font-family: var(--serif); color: var(--green-800); margin: 0 0 14px; }
.order-summary .row {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  font-size: .95rem;
  color: var(--ink);
}
.order-summary .row.muted { color: var(--muted); font-size: .85rem; }
.order-summary .row.total {
  border-top: 1px solid var(--line);
  margin-top: 8px;
  padding-top: 14px;
}
.order-summary .row.total b {
  font-family: var(--serif);
  font-size: 1.5rem;
  color: var(--green-800);
}
.order-summary .ship-note { margin: 4px 0 14px; }
@media (max-width: 860px) {
  .gallery, .order-summary { position: static; }
}

/* ---- Checkout method cards ---- */
.method-card {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  background: var(--white);
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 20px;
  cursor: pointer;
  transition: border-color .25s ease, box-shadow .25s ease;
  margin-bottom: 12px;
}
.method-card:hover { border-color: var(--green-600); }
.method-card.is-selected { border-color: var(--ochre); box-shadow: var(--shadow); }
.method-card input { margin-top: 4px; accent-color: var(--green-700); width: 18px; height: 18px; }
.method-card .m-body { display: grid; gap: 2px; }
.method-card b { font-family: var(--serif); color: var(--green-800); font-size: 1.15rem; }
.method-card small { color: var(--muted); font-size: .85rem; }

/* ---- Orders history cards ---- */
.order-card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px 22px;
  box-shadow: var(--shadow);
  margin-bottom: 16px;
}
.order-card .oc-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.order-card .oc-num { font-family: var(--serif); color: var(--green-800); font-size: 1.2rem; }
.order-card .oc-date { color: var(--muted); font-size: .85rem; }
.order-card .oc-items { color: var(--ink); font-size: .9rem; margin: 10px 0; }
.order-card .oc-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  border-top: 1px solid var(--line);
  padding-top: 12px;
}
.order-card .oc-total { font-family: var(--serif); font-size: 1.25rem; color: var(--green-800); }

/* status pills */
.status-pill {
  display: inline-block;
  font-family: var(--sans);
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  padding: 4px 12px;
  border-radius: 50px;
  background: var(--sage-soft);
  color: var(--green-700);
}
.status-pill.is-pending { background: #f6ecd4; color: var(--ochre-dark); }
.status-pill.is-cancelled { background: #f2dfe3; color: var(--berry); }
.status-pill.is-confirmed,
.status-pill.is-paid,
.status-pill.is-delivered { background: var(--sage-soft); color: var(--green-700); }

/* ---- Login / OTP ---- */
.otp-box { display: grid; gap: 4px; }
.otp-box[hidden] { display: none !important; }
.otp-box .form-note { margin-top: 6px; }

/* ---- Empty state ---- */
.empty-state {
  text-align: center;
  padding: 60px 20px;
}
.empty-state .glyph { font-size: 3rem; display: block; margin-bottom: 14px; }
.empty-state h2 { font-family: var(--serif); color: var(--green-800); margin: 0 0 8px; }
.empty-state p { color: var(--muted); margin: 0 0 22px; }

/* ---- Loading skeletons ---- */
.skeleton {
  background: linear-gradient(90deg, var(--sage-tint), var(--cream), var(--sage-tint));
  background-size: 200% 100%;
  animation: sk 1.2s infinite;
  border-radius: var(--radius-sm);
}
@keyframes sk { to { background-position: -200% 0; } }
.sk-card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  box-shadow: var(--shadow);
}
.sk-card .sk-thumb { width: 100%; aspect-ratio: 1/1; border-radius: var(--radius-sm); }
.sk-card .sk-line { height: 12px; margin-top: 12px; }
.sk-card .sk-line.short { width: 55%; }
@media (prefers-reduced-motion: reduce) {
  .skeleton { animation: none; }
}

/* ---- Inline error/retry card ---- */
.retry-card {
  text-align: center;
  padding: 40px 20px;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  color: var(--muted);
}
.retry-card b { color: var(--green-800); font-family: var(--serif); display: block; margin-bottom: 8px; }

/* ---- Mobile sticky buy-bar (detail + checkout) ---- */
@media (max-width: 860px) {
  .buy-bar {
    position: fixed;
    left: 0; right: 0; bottom: 0;
    z-index: 200;
    display: flex;
    gap: 12px;
    align-items: center;
    padding: 12px 16px;
    background: var(--paper);
    border-top: 1px solid var(--line);
    box-shadow: 0 -6px 24px rgba(45, 74, 40, .08);
  }
  .buy-bar .price { font-family: var(--serif); color: var(--green-800); font-size: 1.3rem; }
  .buy-bar .btn { flex: 1; }
  body.has-buy-bar { padding-bottom: 76px; }
}
.buy-bar { display: none; }
@media (max-width: 860px) { .buy-bar.show { display: flex; } }

/* ---- Profile name nudge (logged-in users without a name) ---- */
.profile-nudge {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  background: var(--sage-tint); border-bottom: 1px solid var(--line);
  color: var(--green-900); padding: 10px 16px; font-size: .92rem;
}
.profile-nudge span { font-weight: 600; }
.profile-nudge input {
  flex: 1 1 180px; max-width: 260px; padding: 7px 10px;
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  font-family: var(--sans); font-size: .9rem; background: var(--white);
}
.profile-nudge .btn--sm { padding: 7px 14px; font-size: .82rem; }
.profile-nudge .nudge-x {
  margin-left: auto; background: none; border: none; cursor: pointer;
  font-size: 1.3rem; line-height: 1; color: var(--muted);
}
.profile-nudge .nudge-x:hover { color: var(--green-800); }

/* ---- Shop-by-category filter tabs ---- */
.shop-filters {
  display: flex; flex-wrap: wrap; gap: 10px; justify-content: center;
  margin: 0 0 32px;
}
.cat-tab {
  font-family: var(--sans); font-weight: 700; font-size: .8rem;
  letter-spacing: .04em; text-transform: uppercase;
  padding: 10px 22px; border-radius: 50px; cursor: pointer;
  background: var(--white); color: var(--green-800);
  border: 1.5px solid var(--line); transition: all .2s ease;
}
.cat-tab:hover { border-color: var(--green-600); color: var(--green-700); }
.cat-tab.is-active { background: var(--green-700); color: var(--cream); border-color: var(--green-700); }
@media (max-width: 560px) {
  .shop-filters { gap: 8px; margin-bottom: 22px; }
  .cat-tab { padding: 8px 16px; font-size: .72rem; }
}

/* ---- Login: +91 phone prefix + compact, no horizontal scroll ---- */
.phone-input { display: flex; align-items: stretch; }
.phone-input .phone-prefix {
  display: flex; align-items: center; padding: 0 12px;
  background: var(--sage-tint); border: 1px solid var(--line); border-right: none;
  border-radius: var(--radius-sm) 0 0 var(--radius-sm);
  font-weight: 700; color: var(--green-800); font-family: var(--sans);
}
.phone-input input {
  flex: 1; min-width: 0;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0 !important;
}
#loginRoot .info-card { box-sizing: border-box; }
#loginRoot input { box-sizing: border-box; }

/* ---- Compact login layout ---- */
#loginRoot.section { padding: 40px 0; }
#loginRoot .login-wrap { max-width: 380px; }
.login-card { padding: 22px 20px; }
.login-card .form-field { margin-bottom: 11px; }
.login-card .form-field input { padding: 9px 12px; }
.login-card .form-field label { font-size: .82rem; margin-bottom: 4px; }
.login-card h2 { font-size: 1.4rem; }
.login-card .form-note { font-size: .85rem; }
.login-card .eyebrow { margin-bottom: 4px; }
@media (max-width: 560px) {
  #loginRoot.section { padding: 24px 0; }
  #loginRoot .login-wrap { max-width: 100%; padding-inline: 20px; }
  .login-card { padding: 20px 16px; }
}

/* ---- Header account: login button + profile dropdown ---- */
.acct-wrap { position: relative; display: inline-flex; align-items: center; }
.btn--login {
  padding: 9px 22px; font-size: .8rem; letter-spacing: .04em; text-transform: uppercase;
  background: var(--green-700); color: var(--cream); border-radius: 50px;
  font-weight: 700; border: 1.5px solid var(--green-700); font-family: var(--sans);
  transition: background .2s ease, transform .2s ease;
}
.btn--login:hover { background: var(--green-800); transform: translateY(-1px); color: var(--cream); }
.acct-btn {
  width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center;
  background: var(--sage-tint); border: 1.5px solid var(--line); color: var(--green-800);
  cursor: pointer; transition: background .2s ease, border-color .2s ease;
}
.acct-btn:hover { background: var(--sage-soft); border-color: var(--green-600); }
.acct-btn svg { pointer-events: none; }
.acct-menu {
  position: absolute; top: calc(100% + 10px); right: 0; z-index: 200;
  min-width: 176px; background: var(--white); border: 1px solid var(--line);
  border-radius: var(--radius-sm); box-shadow: var(--shadow-lg); overflow: hidden;
  display: flex; flex-direction: column;
}
.acct-menu[hidden] { display: none !important; }
.acct-menu a, .acct-menu button {
  text-align: left; padding: 12px 16px; font-size: .9rem; font-family: var(--sans);
  color: var(--ink); background: none; border: none; cursor: pointer; width: 100%;
  border-bottom: 1px solid var(--line); transition: background .15s ease;
}
.acct-menu a:last-child, .acct-menu button:last-child { border-bottom: none; }
.acct-menu a:hover, .acct-menu button:hover { background: var(--sage-tint); }
.acct-menu #logoutBtn { color: var(--berry); font-weight: 700; }

/* ---- Redesigned cart button (circular, matches profile) ---- */
.cart-btn {
  position: relative; width: 40px; height: 40px; border-radius: 50%;
  display: inline-grid; place-items: center;
  background: var(--sage-tint); border: 1.5px solid var(--line); color: var(--green-800);
  transition: background .2s ease, border-color .2s ease, transform .2s ease;
}
.cart-btn:hover { background: var(--sage-soft); border-color: var(--green-600); transform: translateY(-1px); }
.cart-btn svg { pointer-events: none; }
.cart-btn[hidden] { display: none !important; }
