/**
 * Glozin Refurb Suite - frontend styles v2.0.0
 *
 * Section 1: Condition cards   (unchanged from 1.x - the design you love)
 * Section 2: Phone options, step indicator, summary, modals, sticky bar
 *            (unchanged from 1.x)
 * Section 3: Modules adopted from Refurbshop Core, restyled to match
 */

/**
 * Glozin Refurb Suite — Condition Cards  v2.0.0
 * CSS prefix: .grs-cc-
 *
 * Changes from v1:
 * - Added missing top-margin for the badge so it doesn't overlap the card above.
 * - Improved focus-visible ring (uses :focus-visible instead of :focus).
 * - Added explicit aria-live polite container styling.
 */

/* =========================================================================
   Wrapper + header
   ========================================================================= */

.grs-cc-wrap {
  margin-top: 20px;
}

.grs-cc-header {
  display:         flex;
  align-items:     center;
  justify-content: space-between;
  margin-bottom:   20px;
  width:           100%;
}

.grs-cc-header-main {
  display:     flex;
  align-items: center;
  gap:         14px;
  flex-wrap:   nowrap;
  width:       auto;
}

.grs-cc-title {
  font-weight:  700;
  font-size:    16px;
  margin:       0;
  white-space:  nowrap;
  flex:         0 0 auto;
}

.grs-cc-wrap .grs-cc-info-trigger {
  display:     inline-flex;
  align-items: center;
  gap:         6px;
  white-space: nowrap;
  margin:      0;
  flex:        0 0 auto;
}

.grs-cc-wrap .grs-po-heading-link {
  white-space: nowrap;
}

/* Help / status text */
.grs-cc-help {
  margin-top: 8px;
  font-size:  13px;
  color:      #666;
  min-height: 1.3em; /* Reserve space so layout doesn't jump */
}

/* =========================================================================
   Card row
   ========================================================================= */

.grs-cc-row {
  display:               grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap:                   12px;
  /* FIX: top margin so the Most Chosen badge has room */
  margin-top:            22px;
}

/* =========================================================================
   Individual card (button)
   ========================================================================= */

.grs-cc-card {
  position:        relative;
  text-align:      left;
  border:          1px solid rgba( 0, 0, 0, 0.12 );
  background:      #fff;
  padding:         12px;
  border-radius:   8px;
  cursor:          pointer;
  transition:      transform 0.08s ease,
                   box-shadow 0.12s ease,
                   border-color 0.12s ease;
  display:         block;
  text-decoration: none;
  color:           inherit;
  /* FIX: Reset browser button styles */
  font-family:     inherit;
  font-size:       inherit;
}

.grs-cc-card:hover {
  transform: translateY( -2px );
}

.grs-cc-card.is-active {
  border-color: rgba( 0, 0, 0, 0.6 );
  border-width: 2px;
  box-shadow:   0 8px 20px rgba( 0, 0, 0, 0.06 );
}

/* FIX: Use :focus-visible for keyboard accessibility without mouse jank */
.grs-cc-card:focus {
  outline: none;
}
.grs-cc-card:focus-visible {
  outline:        3px solid rgba( 0, 0, 0, 0.4 );
  outline-offset: 2px;
}

/* =========================================================================
   Card internals
   ========================================================================= */

.grs-cc-label {
  font-weight:   700;
  font-size:     14px;
  margin-bottom: 6px;
}

.grs-cc-stars {
  font-size:      14px;
  letter-spacing: 1px;
  margin-bottom:  8px;
  opacity:        0.9;
  color:          #ffc40d;
}

.grs-cc-price,
.grs-cc-price .grs-cc-price-html {
  font-weight:    800;
  font-size:      18px;
  letter-spacing: -0.3px;
}

/* Sale price */
.grs-cc-price del {
  font-size:    14px;
  font-weight:  500;
  color:        #888;
  opacity:      0.8;
  margin-right: 6px;
}

.grs-cc-price ins {
  text-decoration: none;
}

.grs-cc-price ins .grs-cc-price-html,
.grs-cc-price ins {
  color:       #e60023;
  font-weight: 800;
}

.grs-cc-card.is-active .grs-cc-price ins {
  background:    rgba( 230, 0, 35, 0.08 );
  padding:       2px 6px;
  border-radius: 4px;
}

/* =========================================================================
   Out-of-stock state
   ========================================================================= */

.grs-cc-card.is-oos {
  opacity: 0.6;
}

.grs-cc-card.is-oos .grs-cc-price {
  opacity: 0.85;
}

.grs-cc-oos-text {
  font-weight: 600;
  color:       #b00;
  margin-left: 6px;
  font-size:   12px;
}

/* Diagonal line — pointer-events: none so the card remains clickable */
.grs-cc-diagonal {
  pointer-events: none;
  position:       absolute;
  inset:          0;
  border-radius:  8px;
  overflow:       hidden;
}

.grs-cc-diagonal::before {
  content:    '';
  position:   absolute;
  left:       -20%;
  top:        50%;
  width:      140%;
  height:     2px;
  background: rgba( 0, 0, 0, 0.15 );
  transform:  rotate( -12deg );
  opacity:    0.9;
}

/* =========================================================================
   "Most chosen" badge
   ========================================================================= */

.grs-cc-badge {
  position:      absolute;
  top:           -18px;
  left:          50%;
  transform:     translateX( -50% );
  z-index:       3;

  font-size:     11px;
  font-weight:   700;
  padding:       5px 14px;
  border-radius: 999px;

  background:    #ffe66a;
  color:         #111;
  border:        2px solid #fff;
  box-shadow:    0 2px 6px rgba( 0, 0, 0, 0.08 );
  white-space:   nowrap;
}

/* =========================================================================
   Original UI suppression
   ========================================================================= */

/* Visually hide WC/theme condition <select> but keep in DOM for variation JS */
.grs-has-condition-cards select.grs-cc-hidden-select {
  position:       absolute !important;
  left:           -9999px !important;
  width:          1px !important;
  height:         1px !important;
  opacity:        0 !important;
  pointer-events: none !important;
}

/* Hide the surrounding row / wrapper */
.grs-has-condition-cards .grs-cc-hide-original {
  display: none !important;
}

/* Extra specificity for common theme/plugin structures */
.grs-has-condition-cards table.variations tr.grs-cc-hide-original,
.grs-has-condition-cards .variations__row.grs-cc-hide-original,
.grs-has-condition-cards .variation.grs-cc-hide-original,
.grs-has-condition-cards .value.grs-cc-hide-original,
.grs-has-condition-cards .swatch-wrapper.grs-cc-hide-original,
.grs-has-condition-cards .attribute.grs-cc-hide-original,
.grs-has-condition-cards .attr.grs-cc-hide-original,
.grs-has-condition-cards .wcboost-variation-swatches__wrapper.grs-cc-hide-original {
  display: none !important;
}

/* =========================================================================
   Responsive — small screens
   ========================================================================= */

@media ( max-width: 640px ) {

  .grs-cc-row {
    grid-template-columns: 1fr;
    gap:                   12px;
    margin-top:            22px;
  }

  .grs-cc-card {
    width:     100%;
    padding:   12px;

    /* Two-column grid on mobile for label/price layout */
    display:               grid;
    grid-template-columns: 1fr auto;
    grid-template-rows:    auto auto;
    column-gap:            12px;
    row-gap:               8px;
    align-items:           center;
  }

  .grs-cc-label {
    grid-column: 1 / 2;
    grid-row:    1 / 2;
    margin:      0;
  }

  .grs-cc-price {
    grid-column:  2 / 3;
    grid-row:     1 / 2;
    justify-self: end;
    text-align:   right;
    white-space:  nowrap;
  }

  .grs-cc-stars {
    grid-column: 1 / 2;
    grid-row:    2 / 3;
    margin:      0;
  }

  /* Badge moves from absolute to grid on mobile */
  .grs-cc-badge {
    position:     static;
    transform:    none;
    grid-column:  2 / 3;
    grid-row:     2 / 3;
    justify-self: end;
    align-self:   center;
    padding:      4px 10px;
    font-size:    11px;
    border:       none;
    box-shadow:   none;
  }

  .grs-cc-diagonal {
    border-radius: 8px;
  }
}


/**
 * Glozin Refurb Suite — Phone Options  v2.1.0
 * CSS prefix: .grs-po-  /  .grs-step-  /  .grs-inline-badge
 *
 * v2.1 additions:
 * - .grs-inline-badge — numbered badge injected beside every heading.
 *   Visible on ALL screen sizes (including mobile).
 * - Green ✓ completed state, amber pulse active state, grey pending state
 *   for both the floating rail dots AND the inline badges.
 * - Desktop floating rail: unchanged behaviour, line only on desktop.
 * - Mobile: floating rail hidden, inline badges shown, no connecting line.
 */

/* =========================================================================
   Custom properties
   ========================================================================= */

:root {
  --grs-po-border:        #d9d9d9;
  --grs-po-border-strong: #111;
  --grs-po-bg:            #fff;
  --grs-po-bg-muted:      #f6f6f6;
  --grs-po-text:          #111;
  --grs-po-text-muted:    #6f6f6f;
  --grs-po-radius:        6px;

  /* Step rail active state colour */
  --grs-step-active: #f59e0b;
}

/* =========================================================================
   Desktop floating step rail
   ========================================================================= */

form.cart.grs-has-step-indicator {
  position:   relative;
  box-sizing: border-box;
}

.grs-step-indicator {
  position:       absolute;
  left:           8px;
  top:            0;
  width:          44px;
  height:         100%;
  pointer-events: none;
  z-index:        5;
}

.grs-step-indicator__line {
  position:      absolute;
  left:          20px;
  width:         2px;
  background:    #e0e0e0;
  border-radius: 999px;
  transition:    background .3s ease;
}

.grs-step-indicator__item {
  position:       absolute;
  left:           0;
  width:          44px;
  height:         44px;
  border:         0;
  background:     transparent;
  padding:        0;
  margin:         0;
  pointer-events: auto;
  cursor:         pointer;
}

.grs-step-indicator__dot {
  display:         inline-flex;
  align-items:     center;
  justify-content: center;
  width:           42px;
  height:          42px;
  border-radius:   999px;
  background:      var(--grs-step-pending);
  border:          2px solid var(--grs-step-pending);
  color:           #fff;
  font-size:       18px;
  font-weight:     700;
  line-height:     1;
  box-sizing:      border-box;
  transition:      background .25s ease, border-color .25s ease, box-shadow .25s ease;
  position:        relative;
}

/* Number always shown */
.grs-step-indicator__num { display: block; }

/* ── Active state (amber pulse) ────────────────────────────────────────── */
.grs-step-indicator__item.is-active .grs-step-indicator__dot {
  background:   var(--grs-step-active);
  border-color: var(--grs-step-active);
  box-shadow:   0 0 0 5px rgba(245,158,11,.18), 0 0 0 10px rgba(245,158,11,.07);
  animation:    grs-pulse 1.8s ease-in-out infinite;
}

@keyframes grs-pulse {
  0%,100% { box-shadow: 0 0 0 5px rgba(245,158,11,.18), 0 0 0 10px rgba(245,158,11,.07); }
  50%      { box-shadow: 0 0 0 7px rgba(245,158,11,.24), 0 0 0 14px rgba(245,158,11,.10); }
}

/* ── Complete state — stays black, keeps number ─────────────────────────── */
.grs-step-indicator__item.is-complete .grs-step-indicator__dot {
  background:   #000;
  border-color: #000;
  animation:    none;
  box-shadow:   none;
}

.grs-step-indicator__item.is-hidden-step { display: none; }

/* =========================================================================
   Main plugin layout
   ========================================================================= */

.grs-po-wrapper {
  margin:         1.75rem 0;
  display:        flex;
  flex-direction: column;
  gap:            1.9rem;
}

.grs-po-group {
  display:        flex;
  flex-direction: column;
  gap:            1rem;
}

.grs-po-group-title {
  margin:         0;
  font-size:      2rem;
  line-height:    1.1;
  font-weight:    700;
  color:          var(--grs-po-text);
  text-transform: none;
  letter-spacing: 0;
}

.grs-po-heading-info {
  width:           26px;
  height:          26px;
  border-radius:   50%;
  border:          1.5px solid #9a9a9a;
  color:           #707070;
  display:         inline-flex;
  align-items:     center;
  justify-content: center;
  font-size:       14px;
  font-weight:     700;
  line-height:     1;
  flex:            0 0 26px;
}

.grs-po-heading-link {
  color:           #6f7b8b;
  text-decoration: none;
  font-size:       1rem;
  font-weight:     500;
}

.grs-po-info-trigger {
  display:     inline-flex;
  align-items: center;
  gap:         0.55rem;
  border:      0;
  background:  transparent;
  padding:     0;
  margin:      0;
  cursor:      pointer;
}

.grs-po-info-trigger:hover .grs-po-heading-link         { text-decoration: underline; }
.grs-po-info-trigger:focus                               { outline: none; }
.grs-po-info-trigger:focus-visible .grs-po-heading-info { box-shadow: 0 0 0 3px rgba(0,0,0,.08); }

/* Heading row — title + info button on the same line */
.grs-po-heading-row {
  display:     flex;
  align-items: center;
  gap:         0.75rem;
  flex-wrap:   nowrap;
}

/* =========================================================================
   Option cards (battery + tax)
   ========================================================================= */

.grs-po-cards {
  display:               grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap:                   1.15rem;
}

.grs-po-option-card {
  display: block;
  margin:  0;
  cursor:  pointer;
}

.grs-po-option-card input[type="radio"] {
  position:       absolute;
  opacity:        0;
  pointer-events: none;
}

.grs-po-card-face {
  min-height:   128px;
  background:   var(--grs-po-bg);
  border:       1.5px solid var(--grs-po-border);
  border-radius:var(--grs-po-radius);
  padding:      1.2rem 1.15rem;
  display:      flex;
  align-items:  stretch;
  justify-content:space-between;
  gap:          1rem;
  transition:   border-color .2s ease, box-shadow .2s ease, background .2s ease, opacity .2s ease;
}

.grs-po-option-card:hover .grs-po-card-face { border-color: #a8a8a8; }

.grs-po-option-card input[type="radio"]:checked + .grs-po-card-face {
  border-color: var(--grs-po-border-strong);
  box-shadow:   inset 0 0 0 1px var(--grs-po-border-strong);
}

.grs-po-option-card.is-disabled { cursor: not-allowed; }

.grs-po-option-card.is-disabled .grs-po-card-face,
.grs-po-option-card input[type="radio"]:disabled + .grs-po-card-face {
  background: var(--grs-po-bg-muted);
  color:      #8b8b8b;
  opacity:    .75;
  position:   relative;
  overflow:   hidden;
}

.grs-po-option-card.is-disabled .grs-po-card-face::after,
.grs-po-option-card input[type="radio"]:disabled + .grs-po-card-face::after {
  content:          "";
  position:         absolute;
  left:             -12%;
  right:            -12%;
  top:              50%;
  border-top:       2px solid rgba(160,160,160,.75);
  transform:        rotate(-10deg);
  transform-origin: center;
  pointer-events:   none;
}

.grs-po-card-main {
  display:        flex;
  flex-direction: column;
  gap:            .75rem;
}

.grs-po-card-title {
  display:     block;
  font-size:   1.05rem;
  font-weight: 700;
  line-height: 1.3;
  color:       var(--grs-po-text);
}

.grs-po-card-description {
  display:     block;
  font-size:   .92rem;
  line-height: 1.28;
  color:       var(--grs-po-text-muted);
}

.grs-po-card-price {
  align-self:  flex-end;
  white-space: nowrap;
  font-size:   1.05rem;
  line-height: 1.2;
  font-weight: 700;
  color:       var(--grs-po-text);
}

.grs-po-card-price .woocommerce-Price-amount,
.grs-po-card-price .amount { font-weight: 700; }

.grs-po-tax-group .grs-po-card-face {
  min-height:     96px;
  padding-top:    1rem;
  padding-bottom: .9rem;
}

.grs-po-tax-group .grs-po-card-main  { gap: .2rem; }
.grs-po-tax-group .grs-po-card-price { margin-top: auto; }

/* =========================================================================
   Order summary
   ========================================================================= */

.grs-po-summary {
  display:         flex;
  justify-content: space-between;
  align-items:     flex-start;
  gap:             1.25rem;
  background:      #000;
  color:           #fff;
  border-radius:   10px;
  padding:         1.35rem;
  margin-top:      .25rem;
}

.grs-po-summary__left,
.grs-po-summary__right {
  display:        flex;
  flex-direction: column;
  gap:            .55rem;
}

.grs-po-summary__left  { min-width: 0; flex: 1 1 auto; }
.grs-po-summary__right { text-align: right; flex: 0 0 auto; }

.grs-po-summary__title {
  font-size:   1.1rem;
  line-height: 1.2;
  font-weight: 700;
  color:       #fff;
}

.grs-po-summary__tip {
  font-size:   1rem;
  line-height: 1.3;
  font-weight: 600;
  color:       #fff;
}

.grs-po-summary__condition {
  display:     flex;
  align-items: center;
  gap:         .7rem;
  flex-wrap:   wrap;
  margin-top:  .4rem;
}

.grs-po-summary__stars {
  color:          #f8df00;
  letter-spacing: 1px;
  min-width:      5.5em;
}

.grs-po-summary__condition-text {
  color:       #fff;
  font-size:   1rem;
  line-height: 1.35;
  font-weight: 500;
}

.grs-po-summary__subtotal,
.grs-po-summary__subtotal .amount,
.grs-po-summary__subtotal .woocommerce-Price-amount {
  color:       #fff;
  font-size:   1.1rem;
  font-weight: 700;
}

.grs-po-summary__stock { font-size: 1rem; line-height: 1.3; font-weight: 500; }
.grs-po-summary__stock.is-in-stock      { color: #1be21b; }
.grs-po-summary__stock.is-in-stock::before { content: '\2022 '; }
.grs-po-summary__stock.is-out-of-stock  { color: #ff8080; }

/* =========================================================================
   Modals — base
   ========================================================================= */

body.grs-po-modal-open { overflow: hidden; }

.grs-po-modal { position: fixed; inset: 0; z-index: 99999; display: none; }
.grs-po-modal.is-open { display: block; }

.grs-po-modal__overlay {
  position:   absolute;
  inset:      0;
  background: rgba(0,0,0,.55);
  cursor:     pointer;
}

.grs-po-modal__dialog {
  position:      relative;
  z-index:       2;
  width:         min(92vw, 560px);
  max-height:    88vh;
  overflow-y:    auto;
  margin:        6vh auto 0;
  background:    #fff;
  color:         #111;
  border-radius: 14px;
  padding:       1.75rem 1.6rem 1.5rem;
  box-shadow:    0 20px 60px rgba(0,0,0,.25);
  scrollbar-width: thin;
}

/* Wider dialog for condition modal (3-column grid needs more space) */
.grs-po-modal__dialog--wide {
  width: min(92vw, 660px);
}

.grs-po-modal__dialog--condition {
  width: min(96vw, 780px);
}

.grs-po-modal__close {
  position:        absolute;
  top:             .75rem;
  right:           .8rem;
  border:          0;
  background:      transparent;
  color:           #111;
  font-size:       28px;
  line-height:     1;
  cursor:          pointer;
  padding:         4px 8px;
  border-radius:   4px;
  display:         flex;
  align-items:     center;
  justify-content: center;
  transition:      background .15s ease, color .15s ease;
}

.grs-po-modal__close:hover           { background: rgba(0,0,0,.07); }
.grs-po-modal__close:focus           { outline: none; }
.grs-po-modal__close:focus-visible   { outline: 2px solid rgba(0,0,0,.4); outline-offset: 2px; }

.grs-po-modal__title {
  margin:      0 2.5rem 1.1rem 0;
  font-size:   1.5rem;
  line-height: 1.2;
  font-weight: 700;
  color:       #111;
}

/* =========================================================================
   Modal shared content blocks
   ========================================================================= */

.grs-po-modal__content p,
.grs-po-minfo-intro {
  margin:      0 0 .85rem;
  color:       #333;
  line-height: 1.65;
  font-size:   .97rem;
}

.grs-po-minfo-block {
  margin-bottom: 1.1rem;
}

.grs-po-minfo-block__heading {
  margin:      0 0 .35rem;
  font-size:   1rem;
  font-weight: 700;
  color:       #111;
  line-height: 1.3;
}

.grs-po-minfo-block p {
  margin:      0;
  color:       #444;
  line-height: 1.65;
  font-size:   .95rem;
}

/* =========================================================================
   Modal — Note block (battery)
   ========================================================================= */

.grs-po-minfo-note {
  margin-top:    1.25rem;
  padding:       1rem 1.15rem;
  background:    #f7f7f7;
  border-radius: 8px;
  border-left:   3px solid #111;
}

.grs-po-minfo-note__label {
  margin:      0 0 .5rem;
  font-size:   1rem;
  font-weight: 700;
  color:       #111;
}

.grs-po-minfo-note__list {
  margin:      0;
  padding:     0 0 0 1.2rem;
  list-style:  disc;
}

.grs-po-minfo-note__list li {
  margin-bottom: .55rem;
  color:         #444;
  line-height:   1.6;
  font-size:     .94rem;
}

.grs-po-minfo-note__list li:last-child { margin-bottom: 0; }

/* =========================================================================
   Modal — Condition grid
   ========================================================================= */

.grs-po-minfo-condition__subtitle {
  margin:      0 0 .5rem;
  font-size:   1rem;
  font-weight: 700;
  text-align:  center;
  color:       #111;
}

.grs-po-minfo-condition-grid {
  display:               grid;
  grid-template-columns: repeat(3, 1fr);
  gap:                   .85rem;
  margin:                1.1rem 0 1.25rem;
}

.grs-po-minfo-condition-card {
  border:        1.5px solid #d0d0d0;
  border-radius: 8px;
  overflow:      hidden;
  display:       flex;
  flex-direction:column;
}

.grs-po-minfo-condition-card__header {
  background:  #111;
  color:       #fff;
  font-weight: 700;
  font-size:   .92rem;
  text-align:  center;
  padding:     .6rem .75rem;
  line-height: 1.25;
}

.grs-po-minfo-condition-card__body {
  padding:        .85rem .75rem .7rem;
  display:        flex;
  flex-direction: column;
  flex:           1;
  gap:            .65rem;
}

.grs-po-minfo-condition-card__body p {
  margin:      0;
  font-size:   .86rem;
  line-height: 1.55;
  color:       #444;
  text-align:  center;
  flex:        1;
}

.grs-po-minfo-condition-card__image {
  text-align: center;
  margin-top: auto;
}

.grs-po-minfo-condition-card__image img {
  width:         100%;
  max-width:     180px;
  height:        auto;
  display:       inline-block;
  border-radius: 4px;
}

.grs-po-minfo-condition__footer {
  margin:    .25rem 0 0;
  font-size: .93rem;
  color:     #555;
}

.grs-po-minfo-condition__link {
  color:           #111;
  text-decoration: underline;
}

.grs-po-minfo-condition__link:hover { color: #444; }

/* =========================================================================
   Modal responsive
   ========================================================================= */

@media (max-width: 640px) {
  .grs-po-minfo-condition-grid {
    grid-template-columns: 1fr;
    gap: .7rem;
  }

  /* Stack image on top, text below — image fills full card width */
  .grs-po-minfo-condition-card__body {
    flex-direction: column;
    align-items:    center;
    gap:            .65rem;
  }

  /* Image first visually — use order to push it above the text */
  .grs-po-minfo-condition-card__image {
    order:     -1;
    flex:      none;
    width:     100%;
    margin:    0;
    text-align: center;
  }

  .grs-po-minfo-condition-card__image img {
    max-width:  100%;
    width:      100%;
    height:     auto;
  }

  .grs-po-minfo-condition-card__body p {
    text-align: center;
    flex:       none;
  }

  .grs-po-modal__dialog {
    width:      calc(100vw - 24px);
    margin-top: 4vh;
    padding:    1.25rem 1rem 1rem;
  }
}

/* =========================================================================
   Inline badges — numbers left of each section title, MOBILE ONLY
   On desktop the floating rail already shows the numbers.
   ========================================================================= */

.grs-inline-badge {
  display:         none; /* hidden by default; shown only on mobile below */
  align-items:     center;
  justify-content: center;
  width:           28px;
  height:          28px;
  border-radius:   999px;
  background:      #b0b0b0;   /* pending — grey */
  color:           #fff;
  font-size:       13px;
  font-weight:     700;
  line-height:     1;
  flex-shrink:     0;
  margin-right:    0.55rem;
  vertical-align:  middle;
  transition:      background .25s ease, box-shadow .25s ease;
  box-sizing:      border-box;
}

/* Active state — amber pulse */
.grs-inline-badge.is-active {
  background: var(--grs-step-active);
  box-shadow: 0 0 0 4px rgba(245,158,11,.18), 0 0 0 8px rgba(245,158,11,.07);
  animation:  grs-badge-pulse 1.8s ease-in-out infinite;
}

@keyframes grs-badge-pulse {
  0%,100% { box-shadow: 0 0 0 4px rgba(245,158,11,.18), 0 0 0 8px rgba(245,158,11,.07); }
  50%      { box-shadow: 0 0 0 6px rgba(245,158,11,.24), 0 0 0 12px rgba(245,158,11,.10); }
}

/* Complete state — black */
.grs-inline-badge.is-complete {
  background: #000;
  box-shadow: none;
  animation:  none;
}

/* =========================================================================
   Responsive — Desktop (floating rail visible, inline badges hidden)
   ========================================================================= */

@media (min-width: 1024px) {
  form.cart.grs-has-step-indicator {
    padding-left: 64px;
  }

  /* Ensure product summary column overflows for the rail */
  .summary,
  .product .summary { overflow: visible; }

  /* Badges are hidden on desktop — rail dots do the job */
  .grs-inline-badge { display: none !important; }
}

/* =========================================================================
   Responsive — Tablet / Mobile  (≤1023 px)
   =========================================================================
   Floating rail HIDDEN. Inline badges shown — numbers only, no line.
   ========================================================================= */

@media (max-width: 1023px) {
  /* Hide the entire floating rail */
  .grs-step-indicator { display: none !important; }

  /* Remove desktop left-padding */
  form.cart.grs-has-step-indicator { padding-left: 0 !important; }

  /* Show inline badges */
  .grs-inline-badge {
    display:      inline-flex;
    width:        26px;
    height:       26px;
    font-size:    12px;
  }

  /* Align badge + text in group titles and condition title */
  .grs-po-group-title,
  .grs-cc-title {
    display:     flex;
    align-items: center;
  }

  /* Align badge inside variation table labels */
  .variations th label {
    display:     inline-flex;
    align-items: center;
  }
}

@media (max-width: 767px) {
  .grs-po-group-title  { font-size: 1.5rem; }
  .grs-po-cards        { grid-template-columns: 1fr; }
  .grs-po-card-face    { min-height: auto; }
  .grs-po-summary      { flex-direction: column; }
  .grs-po-summary__right { text-align: left; }

  .grs-po-modal__dialog {
    width:      calc(100vw - 24px);
    margin-top: 5vh;
    padding:    1.25rem 1rem 1rem;
  }
}

/* =========================================================================
   Sticky Add-to-Cart bar  (#glozin-sticky-add-to-cart)
   Appears when the real ATC button scrolls out of viewport.
   Slides in from the bottom, matching the Glozin native sticky ATC position.
   Respects the Glozin mobile navigation bar via --gz-navigation-bar-height.
   ========================================================================= */

#glozin-sticky-add-to-cart {
  position:       fixed;
  bottom:         var(--gz-navigation-bar-height, 0px);
  left:           0;
  right:          0;
  top:            auto;
  z-index:        998;
  background:     #fff;
  border-top:     1px solid #e8e8e8;
  border-bottom:  none;
  box-shadow:     0 -3px 16px rgba(0, 0, 0, .10);

  /* Slide in from bottom */
  transform:      translateY(110%);
  transition:     transform .28s cubic-bezier(.4, 0, .2, 1),
                  opacity   .28s ease;
  opacity:        0;
  pointer-events: none;
  will-change:    transform;
}

#glozin-sticky-add-to-cart.is-visible {
  transform:      translateY(0);
  opacity:        1;
  pointer-events: auto;
}

/* ── Inner layout ─────────────────────────────────────────────────────────── */

.grs-sticky-bar__inner {
  display:         flex;
  align-items:     center;
  gap:             16px;
  padding:         10px 24px;
  max-width:       1400px;
  margin:          0 auto;
  box-sizing:      border-box;
  min-height:      64px;
}

/* ── Product info (left) ─────────────────────────────────────────────────── */

.grs-sticky-bar__product {
  display:     flex;
  align-items: center;
  gap:         12px;
  flex:        1 1 0;
  min-width:   0;
}

.grs-sticky-bar__thumb {
  flex-shrink:  0;
  width:        46px;
  height:       46px;
  border-radius: 8px;
  overflow:     hidden;
  border:       1px solid #f0f0f0;
  background:   #fafafa;
}

.grs-sticky-bar__thumb img {
  width:       100%;
  height:      100%;
  object-fit:  cover;
  display:     block;
}

.grs-sticky-bar__info {
  min-width: 0;
}

.grs-sticky-bar__title {
  font-weight:     700;
  font-size:       .95rem;
  line-height:     1.3;
  color:           var(--gz-color-dark, #111);
  white-space:     nowrap;
  overflow:        hidden;
  text-overflow:   ellipsis;
  max-width:       320px;
}

.grs-sticky-bar__meta {
  display:     flex;
  align-items: center;
  gap:         5px;
  margin-top:  3px;
  font-size:   .8rem;
  color:       #888;
  line-height: 1.2;
  white-space: nowrap;
}

.grs-sticky-bar__sep {
  color:      #ccc;
  font-size:  .75rem;
}

.grs-sticky-bar__condition,
.grs-sticky-bar__tax {
  max-width:    120px;
  overflow:     hidden;
  text-overflow: ellipsis;
}

/* ── Action (right) ──────────────────────────────────────────────────────── */

.grs-sticky-bar__action {
  display:     flex;
  align-items: center;
  gap:         14px;
  flex-shrink: 0;
}

.grs-sticky-bar__price {
  font-size:    1.15rem;
  font-weight:  700;
  color:        var(--gz-color-dark, #111);
  white-space:  nowrap;
  line-height:  1;
  min-width:    56px;
  text-align:   right;
}

/* Inherit WooCommerce price amount styles */
.grs-sticky-bar__price .woocommerce-Price-amount { font-size: inherit; font-weight: inherit; }

/* ── ATC button ──────────────────────────────────────────────────────────── */

.grs-sticky-bar__btn {
  display:         inline-flex;
  align-items:     center;
  justify-content: center;
  gap:             8px;
  padding:         11px 24px;
  background:      var(--gz-color-dark, #111);
  color:           #fff !important;
  border:          none;
  border-radius:   var(--gz-button-radius, 4px);
  font-size:       .88rem;
  font-weight:     700;
  letter-spacing:  .04em;
  text-transform:  uppercase;
  cursor:          pointer;
  line-height:     1;
  white-space:     nowrap;
  transition:      background .18s ease, opacity .18s ease;
  text-decoration: none !important;
}

.grs-sticky-bar__btn:hover:not(.is-disabled) {
  background: #333;
  color:      #fff !important;
}

.grs-sticky-bar__btn:focus-visible {
  outline:        2px solid var(--gz-color-dark, #111);
  outline-offset: 2px;
}

.grs-sticky-bar__btn.is-disabled,
.grs-sticky-bar__btn[disabled] {
  opacity:  .45;
  cursor:   not-allowed;
}

/* Loading state (WC adds .loading) */
.grs-sticky-bar__btn.loading {
  opacity:  .7;
  cursor:   wait;
}

.grs-sticky-bar__btn-icon {
  flex-shrink:  0;
  width:        15px;
  height:       15px;
  margin-top:   -1px;
}

/* ── Responsive ──────────────────────────────────────────────────────────── */

/* Tablet: hide thumbnail */
@media (max-width: 900px) {
  .grs-sticky-bar__thumb { display: none; }
  .grs-sticky-bar__title { max-width: 220px; }
}

/* Mobile: single tight row — info left, price+button right, never wraps */
@media (max-width: 639px) {
  .grs-sticky-bar__inner {
    flex-wrap:   nowrap;
    align-items: center;
    gap:         0;
    padding:     0 0 0 14px;  /* no right padding — button edge-to-edge */
  }

  /* Left: product info takes all remaining space */
  .grs-sticky-bar__product {
    flex:     1 1 0;
    min-width: 0;
    gap:       8px;
  }

  .grs-sticky-bar__thumb { display: none; }

  .grs-sticky-bar__title {
    max-width:     none;
    font-size:     .85rem;
    white-space:   nowrap;
    overflow:      hidden;
    text-overflow: ellipsis;
  }

  .grs-sticky-bar__meta {
    font-size:  .72rem;
    gap:        4px;
    flex-wrap:  nowrap;
    overflow:   hidden;
  }

  .grs-sticky-bar__condition,
  .grs-sticky-bar__tax {
    max-width:     80px;
    overflow:      hidden;
    text-overflow: ellipsis;
    white-space:   nowrap;
  }

  /* Right: price + button, no gap between them, button flush to edge */
  .grs-sticky-bar__action {
    display:     flex;
    align-items: stretch;
    gap:         0;
    flex-shrink: 0;
    height:      100%;
  }

  .grs-sticky-bar__price {
    font-size:   .95rem;
    min-width:   0;
    padding:     0 10px;
    display:     flex;
    align-items: center;
    white-space: nowrap;
    text-align:  right;
  }

  /* Button: tall touch target, square-ish, matches Glozin mobile ATC style */
  .grs-sticky-bar__btn {
    display:         flex;
    align-items:     center;
    justify-content: center;
    padding:         0 18px;
    min-height:      56px;
    font-size:       .82rem;
    gap:             6px;
    border-radius:   0;    /* flush to bar edges on mobile */
  }

  /* Keep icon on mobile — it helps identify the button at a glance */
  .grs-sticky-bar__btn-icon {
    width:  14px;
    height: 14px;
  }
}

/* Respect reduced-motion preference */
@media (prefers-reduced-motion: reduce) {
  #glozin-sticky-add-to-cart {
    transition: opacity .15s ease;
    transform:  none !important;
  }
  #glozin-sticky-add-to-cart:not(.is-visible) { opacity: 0; pointer-events: none; }
}

/* ── Missing-selection shake (triggered from sticky ATC validation) ────────── */

@keyframes grs-shake {
  0%, 100% { transform: translateX(0); }
  18%       { transform: translateX(-6px); }
  36%       { transform: translateX(6px); }
  54%       { transform: translateX(-4px); }
  72%       { transform: translateX(4px); }
  90%       { transform: translateX(-2px); }
}

.grs-sticky-missing {
  animation:    grs-shake .55s ease both;
  outline:      2px solid #c00;
  outline-offset: 4px;
  border-radius: 6px;
}

@media (prefers-reduced-motion: reduce) {
  .grs-sticky-missing {
    animation: none;
    outline:   2px solid #c00;
  }
}


/* =============================================================================
   SECTION 3 — MODULES ADOPTED FROM REFURBSHOP CORE (restyled to match GRS)
   Paid extras, price decoration, trust tiles, eco tile, stock badge,
   product-tab content and Glozin visibility helpers.
   ========================================================================== */

/* === Paid extras ========================================================== */

.grs-extras {
  margin: 18px 0;
}

.grs-extras .grs-po-heading-row {
  align-items: baseline;
}

.grs-extras__hint {
  font-size: 12px;
  color: #888;
}

.grs-extra {
  display:       flex;
  align-items:   center;
  gap:           12px;
  padding:       12px;
  margin-bottom: 8px;
  border:        1px solid rgba( 0, 0, 0, 0.12 );
  border-radius: 8px;
  background:    #fff;
  cursor:        pointer;
  transition:    border-color 0.12s ease, box-shadow 0.12s ease;
}

.grs-extra:hover {
  border-color: rgba( 0, 0, 0, 0.35 );
}

.grs-extra input[type="checkbox"] {
  width:  18px;
  height: 18px;
  margin: 0;
  flex:   0 0 auto;
}

.grs-extra__body {
  flex:           1;
  display:        flex;
  flex-direction: column;
  gap:            2px;
  min-width:      0;
}

.grs-extra__label {
  font-size:   14px;
  font-weight: 600;
  color:       inherit;
}

.grs-extra__rec {
  font-style:  normal;
  font-weight: 700;
  font-size:   11px;
  margin-left: 6px;
  color:       #15803d;
}

.grs-extra__sub {
  font-size: 12px;
  color:     #777;
}

.grs-extra__price {
  font-size:   14px;
  font-weight: 700;
  white-space: nowrap;
}

.grs-extra--recommended {
  border-color: rgba( 0, 0, 0, 0.45 );
  background:   #fafafa;
}

.grs-extra.is-checked {
  border-color: rgba( 0, 0, 0, 0.6 );
  border-width: 2px;
  padding:      11px;
  box-shadow:   0 8px 20px rgba( 0, 0, 0, 0.06 );
}

.grs-extra.is-disabled {
  opacity:        0.45;
  pointer-events: none;
}

/* === Price decoration (RRP + Klarna + footnote) =========================== */

.grs-pricebox {
  margin: 4px 0 6px;
  clear:  both;
}

.grs-pricebox__savings {
  display:     flex;
  flex-wrap:   wrap;
  align-items: center;
  gap:         8px;
  margin:      6px 0;
}

.grs-pricebox__savings:empty {
  display: none;
}

.grs-pricebox__rrp {
  color:           #888;
  text-decoration: line-through;
  font-size:       14px;
}

.grs-pricebox__save-pill {
  display:       inline-block;
  background:    #dcfce7;
  color:         #15803d;
  font-size:     11px;
  font-weight:   700;
  padding:       3px 10px;
  border-radius: 999px;
}

.grs-pricebox__klarna {
  font-size: 12px;
}

.grs-pricebox__klarna:empty {
  display: none;
}

.grs-pricebox__footnote {
  font-size:   11px;
  color:       #888;
  line-height: 1.4;
  margin:      4px 0 10px;
}

/* === Trust tiles ========================================================== */

.grs-trust {
  display:               grid;
  grid-template-columns: repeat( 5, minmax( 0, 1fr ) );
  gap:                   8px;
  margin:                14px 0;
}

.grs-trust__tile {
  background:     #fafafa;
  border-radius:  6px;
  padding:        10px 8px;
  text-align:     center;
  display:        flex;
  flex-direction: column;
  gap:            2px;
  font-size:      11px;
}

.grs-trust__tile strong {
  font-size: 12px;
}

.grs-trust__tile span {
  color: #777;
}

@media ( max-width: 640px ) {
  .grs-trust {
    grid-template-columns: repeat( 2, minmax( 0, 1fr ) );
  }
}

.grs-trustbar {
  display:         flex;
  flex-wrap:       wrap;
  justify-content: center;
  gap:             10px;
  background:      #111;
  color:           #fff;
  padding:         8px 12px;
  font-size:       12px;
}

/* === Stock badge (standalone, optional) =================================== */

.grs-stock {
  display:        flex;
  flex-direction: column;
  gap:            2px;
  padding:        10px 12px;
  margin:         10px 0;
  border-radius:  8px;
  background:     #dcfce7;
  font-size:      13px;
}

.grs-stock--low {
  background: #fef3c7;
}

.grs-stock--out {
  background: #fee2e2;
}

.grs-stock__dot {
  width:          8px;
  height:         8px;
  border-radius:  50%;
  background:     #15803d;
  display:        inline-block;
  margin-right:   6px;
  vertical-align: middle;
}

.grs-stock--low .grs-stock__dot {
  background: #d97706;
}

.grs-stock--out .grs-stock__dot {
  background: #b91c1c;
}

.grs-stock__line {
  font-weight: 600;
}

.grs-stock__notify {
  display:    flex;
  gap:        6px;
  margin-top: 6px;
}

.grs-stock__notify input[type="email"] {
  flex:          1;
  padding:       8px 10px;
  border:        1px solid rgba( 0, 0, 0, 0.15 );
  border-radius: 6px;
  font-size:     12px;
}

.grs-stock__notify button {
  padding:       8px 12px;
  background:    #111;
  color:         #fff;
  border:        0;
  border-radius: 6px;
  font-weight:   600;
  font-size:     12px;
  cursor:        pointer;
}

.grs-stock__done {
  color:       #15803d;
  font-weight: 600;
  font-size:   13px;
  margin:      6px 0 0;
}

/* === Eco impact =========================================================== */

.grs-eco {
  display:        flex;
  flex-direction: column;
  gap:            4px;
  padding:        10px 12px;
  margin:         10px 0;
  border-radius:  8px;
  background:     #dcfce7;
}

.grs-eco__title {
  font-size:   12px;
  font-weight: 700;
  color:       #15803d;
}

.grs-eco__stats {
  display:   flex;
  flex-wrap: wrap;
  gap:       10px;
  font-size: 12px;
}

/* === Product tabs: pros/cons + box ======================================== */

.grs-proscons {
  display:               grid;
  grid-template-columns: 1fr 1fr;
  gap:                   16px;
}

.grs-proscons__col h3 {
  font-size: 14px;
  margin:    0 0 6px;
}

.grs-proscons__col ul {
  list-style: none;
  padding:    0;
  margin:     0;
}

.grs-proscons__col li {
  font-size: 13px;
  padding:   3px 0;
}

.grs-proscons__col--pros li::before {
  content:     "\2713\00a0";
  color:       #15803d;
  font-weight: 700;
}

.grs-proscons__col--cons li::before {
  content:     "\2014\00a0";
  color:       #888;
  font-weight: 700;
}

@media ( max-width: 540px ) {
  .grs-proscons {
    grid-template-columns: 1fr;
  }
}

.grs-box {
  list-style: none;
  padding:    0;
  margin:     0;
  display:    flex;
  flex-wrap:  wrap;
  gap:        12px;
}

.grs-box li {
  flex:           0 0 100px;
  display:        flex;
  flex-direction: column;
  align-items:    center;
  gap:            4px;
  font-size:      11px;
  text-align:     center;
}

.grs-box img {
  width:         80px;
  height:        80px;
  object-fit:    contain;
  background:    #fafafa;
  border-radius: 6px;
}

/* === Glozin visibility helpers ============================================ */

/* Hide Glozin's OWN sticky bar on mobile when enabled — but never the
   Refurb Suite bar, which reuses the same base class on purpose. */
@media ( max-width: 880px ) {
  body.grs-hide-glozin-sticky-mobile .glozin-sticky-add-to-cart:not( .grs-sticky-bar ) {
    display: none !important;
  }
}

body.grs-hide-glozin-qa-share .glozin-extra-link-item--ask-question,
body.grs-hide-glozin-qa-share .glozin-extra-link-item--share,
body.grs-hide-glozin-qa-share .glozin-product-extra-link {
  display: none !important;
}

/* === Accessibility ======================================================== */

.grs-extra:focus-within,
.grs-stock__notify button:focus-visible {
  outline:        2px solid rgba( 0, 0, 0, 0.4 );
  outline-offset: 2px;
}


/* === Rich-text modal content (settings-driven battery / VAT popups) ======== */

.grs-po-modal__content--battery h4,
.grs-po-modal__content--vat h4 {
  font-size:   15px;
  font-weight: 700;
  margin:      18px 0 6px;
}

.grs-po-modal__content--battery h4:first-child,
.grs-po-modal__content--vat h4:first-child {
  margin-top: 0;
}

.grs-po-modal__content--battery p,
.grs-po-modal__content--vat p {
  font-size:   14px;
  line-height: 1.6;
  margin:      0 0 12px;
  color:       #444;
}

.grs-po-modal__content--battery ul,
.grs-po-modal__content--vat ul {
  margin:       0 0 12px 18px;
  font-size:    14px;
  line-height:  1.6;
  color:        #444;
}
