/* =========================================================
   JOJOZ DESIGNS
   STORE / CART / ORDER SUCCESS PAGES
   ========================================================= */


/* =========================================================
   STORE VARIABLES
   ========================================================= */

:root {
  --store-teal: #087f7b;
  --store-teal-dark: #055e5b;
  --store-ink: #172626;
  --store-muted: #60706f;
  --store-line: #dce7e5;
  --store-soft: #f3f8f7;
  --store-white: #fff;
  --store-danger: #a52a2a;
}


/* =========================================================
   STORE PAGE BASE
   ========================================================= */

.store-page {
  min-height: 100vh;

  margin: 0;

  background: #fbfdfc;
  color: var(--store-ink);

  font-family: Arial, Helvetica, sans-serif;
  line-height: 1.5;
}

.store-page .header p {
  margin: 1em 0;
}


/* =========================================================
   STORE HEADER / LOGO
   ========================================================= */

.store-page .logo-row {
  display: flex;

  align-items: center;
  justify-content: center;

  width: 100%;

  margin-bottom: 2vh;
  padding: 0 2vw;

  gap: 1vw;
}

.store-page .logo {
  width: 100%;
  max-width: 20vw;

  margin: 0 2vw;
  padding: 2vh 1vw;

  text-align: center;
}

.store-page .center {
  display: block;

  width: 50%;
  height: auto;

  margin-left: auto;
  margin-right: auto;
}


/* =========================================================
   STORE HEADER BUTTON GROUPS
   ========================================================= */

.store-page .logo-side-buttons {
  display: flex;

  gap: 1vw;

  margin-right: -0.9vw;
}

.store-page .logo-side-buttons.right {
  margin-right: 0;
  margin-left: -0.9vw;
}


/* =========================================================
   STORE HEADER BUTTONS
   ========================================================= */

.store-page .side-btn {
  display: inline-block;

  padding: 0.5em 1em;

  background: none;
  color: teal;

  border: 0;
  border-radius: 2em;

  text-align: center;
  text-decoration: none;

  font: inherit;
  font-size: 1.22rem;

  white-space: nowrap;

  cursor: pointer;

  transition: color 0.2s;
}

.store-page .side-btn:hover,
.store-page .side-btn:focus-visible {
  color: #008080cc;
}

.store-page .side-btn.active,
.store-page .side-btn[aria-current="page"] {
  color: black;
}


/* =========================================================
   STORE DROPDOWN
   ========================================================= */

.store-page .dropdown {
  position: relative;

  display: inline-block;
}

.store-page .dropdown-content {
  display: none;

  position: absolute;

  min-width: 180px;

  background: #f9f9f9;

  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);

  z-index: 1000;
}

.store-page .dropdown-content a {
  display: block;

  padding: 10px 16px;

  color: black;

  text-align: left;
  text-decoration: none;
}

.store-page .dropdown-content a:hover,
.store-page .dropdown-content a:focus-visible {
  background: #f1f1f1;
}

.store-page .dropdown:hover .dropdown-content,
.store-page .dropdown:focus-within .dropdown-content {
  display: block;
}


/* =========================================================
   STORE MAIN CONTENT
   ========================================================= */

.store-main {
  width: min(1180px, calc(100% - 40px));

  margin: 0 auto;
  padding: 64px 0 90px;
}


/* =========================================================
   PAGE HEADING
   ========================================================= */

.page-heading {
  max-width: 650px;

  margin-bottom: 38px;
}

.eyebrow {
  margin: 0 0 8px;

  color: var(--store-teal);

  font-size: 0.78rem;
  font-weight: 800;

  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.page-heading h1,
.success-card h1 {
  margin: 0;

  font-family: Georgia, "Times New Roman", serif;

  line-height: 1.08;
}

.page-heading h1 {
  font-size: clamp(2.1rem, 5vw, 3.4rem);
}

.success-card h1 {
  font-size: clamp(2rem, 5vw, 3.25rem);
}

.page-heading > p:last-child {
  margin: 14px 0 0;

  color: var(--store-muted);

  font-size: 1.05rem;
}


/* =========================================================
   CART LAYOUT
   ========================================================= */

.cart-layout {
  display: grid;

  grid-template-columns:
    minmax(0, 1.65fr)
    minmax(300px, 0.75fr);

  align-items: start;

  gap: 28px;
}

.cart-panel,
.order-summary,
.empty-cart,
.success-card {
  background: var(--store-white);

  border: 1px solid var(--store-line);
  border-radius: 18px;

  box-shadow: 0 15px 45px rgba(14, 76, 72, 0.07);
}

.cart-panel {
  padding: 0 28px;
}


/* =========================================================
   CART PANEL HEADING
   ========================================================= */

.panel-heading {
  display: flex;

  align-items: center;
  justify-content: space-between;

  gap: 20px;

  padding: 25px 0 19px;

  border-bottom: 1px solid var(--store-line);
}

.panel-heading h2,
.order-summary h2 {
  margin: 0;

  font-size: 1.25rem;
}


/* =========================================================
   TEXT / REMOVE BUTTONS
   ========================================================= */

.text-button,
.remove-button {
  background: none;
  color: var(--store-teal-dark);

  border: 0;

  font: inherit;

  text-decoration: underline;
  text-underline-offset: 3px;

  cursor: pointer;
}


/* =========================================================
   CART ITEM
   ========================================================= */

.cart-item {
  display: grid;

  grid-template-columns: 130px minmax(0, 1fr) auto;

  align-items: center;

  gap: 22px;

  padding: 26px 0;

  border-bottom: 1px solid var(--store-line);
}

.cart-item:last-child {
  border-bottom: 0;
}

.cart-item-image {
  width: 130px;

  aspect-ratio: 1;

  overflow: hidden;

  background: var(--store-soft);

  border-radius: 12px;
}

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

  object-fit: cover;
}

.cart-item-image img.fallback-image {
  padding: 14px;

  object-fit: contain;
}

.cart-item-details h3 {
  margin: 0 0 8px;

  font-size: 1.05rem;
}

.item-options,
.unit-price {
  margin: 4px 0;

  color: var(--store-muted);

  font-size: 0.9rem;
}


/* =========================================================
   CART ITEM ACTIONS
   ========================================================= */

.cart-item-actions {
  display: grid;

  grid-template-columns: 1fr auto;

  align-items: center;

  min-width: 104px;

  gap: 8px;

  text-align: right;
}

.cart-item-actions label {
  grid-column: 1;

  color: var(--store-muted);

  text-align: left;

  font-size: 0.82rem;
}

.cart-item-actions select {
  grid-column: 2;

  width: 62px;

  padding: 7px;

  background: white;

  border: 1px solid #b8c9c7;
  border-radius: 7px;
}

.remove-button {
  grid-column: 1 / -1;

  justify-self: end;

  font-size: 0.86rem;
}

.line-total {
  grid-column: 1 / -1;

  margin-top: 5px;

  font-size: 1rem;
}


/* =========================================================
   SHIPPING FORM
   ========================================================= */

.shipping-form {
  padding: 34px 0 30px;

  border-top: 1px solid var(--store-line);
}

.form-section-heading {
  margin-bottom: 25px;
}

.form-section-heading h2,
.shipping-method-section h2 {
  margin: 0;

  font-size: 1.35rem;
}

.shipping-form fieldset {
  margin: 0 0 30px;
  padding: 0;

  border: 0;
}

.shipping-form legend {
  width: 100%;

  margin-bottom: 15px;
  padding: 0 0 10px;

  border-bottom: 1px solid var(--store-line);

  font-size: 1.05rem;
  font-weight: 800;
}


/* =========================================================
   SHIPPING FORM GRID
   ========================================================= */

.form-grid {
  display: grid;

  grid-template-columns: repeat(2, minmax(0, 1fr));

  gap: 17px;
}

.form-field {
  display: flex;

  flex-direction: column;

  gap: 7px;
}

.form-field-wide {
  grid-column: 1 / -1;
}

.form-field label {
  color: var(--store-ink);

  font-size: 0.9rem;
  font-weight: 700;
}

.form-field label span {
  color: var(--store-muted);

  font-size: 0.8rem;
  font-weight: 400;
}

.form-field input,
.form-field select {
  width: 100%;
  min-height: 46px;

  padding: 10px 12px;

  background: white;
  color: var(--store-ink);

  border: 1px solid #aebfbd;
  border-radius: 8px;

  font: inherit;
}

.form-field input:focus,
.form-field select:focus {
  border-color: var(--store-teal);

  outline: 2px solid rgba(8, 127, 123, 0.2);
}


/* =========================================================
   SHIPPING METHOD
   ========================================================= */

.shipping-method-section {
  margin-top: 6px;
}

.shipping-method-option {
  display: grid;

  grid-template-columns: auto 1fr auto;

  align-items: center;

  gap: 13px;

  margin-top: 15px;
  padding: 16px;

  background: var(--store-soft);

  border: 2px solid var(--store-teal);
  border-radius: 10px;

  cursor: pointer;
}

.shipping-method-option input {
  width: 18px;
  height: 18px;

  accent-color: var(--store-teal);
}

.shipping-method-option span {
  display: flex;

  flex-direction: column;
}

.shipping-method-option small {
  margin-top: 2px;

  color: var(--store-muted);
}

.shipping-method-option > strong:last-child {
  color: var(--store-teal-dark);

  font-size: 0.88rem;
}


/* =========================================================
   ORDER SUMMARY
   ========================================================= */

.order-summary {
  position: sticky;
  top: 24px;

  padding: 28px;
}

.order-summary h2 {
  margin-bottom: 22px;
}

.summary-row,
.summary-total {
  display: flex;

  justify-content: space-between;

  gap: 20px;

  padding: 12px 0;
}

.muted-row {
  color: var(--store-muted);

  font-size: 0.9rem;
}

.muted-row span:last-child {
  text-align: right;
}

.summary-total {
  margin-top: 12px;
  padding-top: 20px;

  border-top: 1px solid var(--store-line);

  font-size: 1.15rem;
}

/* =========================================================
   JOJOZ REWARDS
   ========================================================= */

.rewards-section {
  margin: 16px 0 4px;
  padding: 18px;

  background: var(--store-soft);

  border: 1px solid var(--store-line);
  border-radius: 12px;
}

.rewards-section h3 {
  margin: 0 0 8px;

  color: var(--store-teal-dark);

  font-size: 1rem;
}

.rewards-section p {
  margin: 6px 0;

  color: var(--store-muted);

  font-size: 0.9rem;
}

.rewards-section p strong {
  color: var(--store-ink);
}

#rewards-redemption-controls {
  margin-top: 14px;
}

#rewards-redemption-controls label {
  display: block;

  margin-bottom: 7px;

  color: var(--store-ink);

  font-size: 0.88rem;
  font-weight: 700;
}

#reward-points {
  width: 100%;
  min-height: 42px;

  padding: 9px 11px;

  background: var(--store-white);
  color: var(--store-ink);

  border: 1px solid #aebfbd;
  border-radius: 8px;

  font: inherit;

  cursor: pointer;
}

#reward-points:focus {
  border-color: var(--store-teal);

  outline: 2px solid rgba(8, 127, 123, 0.2);
}

#rewards-message {
  margin-top: 10px;

  font-size: 0.82rem;
}

#rewards-discount-row {
  color: var(--store-teal-dark);
}

#rewards-discount {
  color: var(--store-teal-dark);
}
/* =========================================================
   PRIMARY / CHECKOUT BUTTON
   ========================================================= */

.primary-button {
  display: inline-flex;

  align-items: center;
  justify-content: center;

  gap: 8px;

  min-height: 50px;

  padding: 13px 24px;

  background: var(--store-teal);
  color: white;

  border: 0;
  border-radius: 999px;

  font: inherit;
  font-weight: 800;

  text-decoration: none;

  cursor: pointer;

  transition:
    background 0.2s,
    transform 0.2s;
}

.primary-button:hover,
.primary-button:focus-visible {
  background: var(--store-teal-dark);

  transform: translateY(-1px);
}

.primary-button:disabled {
  opacity: 0.65;

  cursor: wait;

  transform: none;
}

.checkout-button {
  width: 100%;

  margin-top: 21px;
}

.checkout-note {
  margin: 13px 0;

  color: var(--store-muted);

  text-align: center;

  font-size: 0.82rem;
}

.continue-link {
  display: block;

  margin-top: 17px;

  color: var(--store-teal-dark);

  text-align: center;
  text-decoration: none;

  font-size: 0.9rem;
  font-weight: 700;
}


/* =========================================================
   EMPTY CART
   ========================================================= */

.empty-cart {
  padding: 70px 28px;

  text-align: center;
}

.empty-cart-icon {
  display: grid;

  place-items: center;

  width: 72px;
  height: 72px;

  margin: 0 auto 20px;

  background: var(--store-soft);
  color: var(--store-teal);

  border-radius: 50%;

  font-size: 1.7rem;
}

.empty-cart h2 {
  margin: 0;

  font-size: 1.65rem;
}

.empty-cart p {
  margin: 10px auto 24px;

  color: var(--store-muted);
}


/* =========================================================
   STORE NOTICES
   ========================================================= */

.store-notice {
  margin-bottom: 24px;
  padding: 14px 18px;

  background: #edf8f7;
  color: #174d4a;

  border: 1px solid #afd2cf;
  border-radius: 10px;
}

.store-notice.error {
  background: #fff2f2;
  color: var(--store-danger);

  border-color: #e2b5b5;
}


/* =========================================================
   ORDER SUCCESS PAGE
   ========================================================= */

.success-main {
  width: min(760px, calc(100% - 40px));

  min-height: 68vh;

  margin: 0 auto;
  padding: 70px 0 90px;
}

.success-card {
  padding: clamp(30px, 7vw, 64px);

  text-align: center;
}

.success-mark {
  display: grid;

  place-items: center;

  width: 78px;
  height: 78px;

  margin: 0 auto 22px;

  background: var(--store-teal);
  color: white;

  border-radius: 50%;

  box-shadow: 0 10px 28px rgba(8, 127, 123, 0.25);

  font-size: 2rem;
}

.success-intro {
  max-width: 560px;

  margin: 18px auto 0;

  color: var(--store-muted);

  font-size: 1.05rem;
}

.order-reference {
  display: inline-block;

  margin: 20px auto 0;
  padding: 8px 14px;

  background: var(--store-soft);

  border-radius: 7px;

  font-family: monospace;

  overflow-wrap: anywhere;
}


/* =========================================================
   ORDER SUCCESS STEPS
   ========================================================= */

.order-steps {
  display: grid;

  gap: 22px;

  margin: 38px 0;
  padding: 24px;

  background: var(--store-soft);

  border-radius: 14px;

  text-align: left;
}

.order-step {
  display: grid;

  grid-template-columns: 34px 1fr;

  align-items: start;

  gap: 14px;
}

.order-step > span {
  display: grid;

  place-items: center;

  width: 30px;
  height: 30px;

  background: var(--store-teal);
  color: white;

  border-radius: 50%;

  font-size: 0.85rem;
  font-weight: 800;
}

.order-step p {
  margin: 3px 0 0;

  color: var(--store-muted);

  font-size: 0.9rem;
}

.support-line {
  margin: 25px 0 0;

  color: var(--store-muted);
}

.support-line a {
  color: var(--store-teal-dark);

  font-weight: 700;
}


/* =========================================================
   STORE FOOTER
   ========================================================= */

.store-footer {
  display: flex;

  align-items: center;
  justify-content: space-between;

  gap: 30px;

  padding: 30px clamp(20px, 5vw, 72px);

  background: #163b39;
  color: white;
}

.store-footer p {
  margin: 3px 0 0;

  color: #c8dddd;

  font-size: 0.88rem;
}

.store-footer nav {
  display: flex;

  justify-content: flex-end;

  flex-wrap: wrap;

  gap: 18px;
}

.store-footer a {
  color: white;

  font-size: 0.86rem;

  text-decoration: none;
}

.store-footer a:hover,
.store-footer a:focus-visible {
  text-decoration: underline;
}


/* =========================================================
   ADDRESS AUTOCOMPLETE
   ========================================================= */

.address-lookup-field {
  position: relative;
}

.address-suggestions {
  position: absolute;

  top: 100%;
  left: 0;
  right: 0;

  max-height: 260px;

  overflow-y: auto;

  background: white;

  border: 1px solid #d8d8d8;
  border-radius: 0 0 8px 8px;

  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);

  z-index: 1000;
}

.address-suggestion {
  display: block;

  width: 100%;

  padding: 12px 14px;

  background: white;

  border: 0;
  border-bottom: 1px solid #eee;

  text-align: left;

  font: inherit;

  cursor: pointer;
}

.address-suggestion:last-child {
  border-bottom: 0;
}

.address-suggestion:hover,
.address-suggestion:focus {
  background: #f5f5f5;

  outline: none;
}

.geoapify-attribution {
  margin-top: 6px;

  color: #777;

  font-size: 11px;
  line-height: 1.4;
}


/* =========================================================
   HIDDEN ELEMENTS
   ========================================================= */

[hidden] {
  display: none !important;
}


/* =========================================================
   TABLET
   ========================================================= */

@media screen and (max-width: 820px) {

  /* Store header */

  .store-page .logo-row {
    flex-wrap: wrap;

    gap: 5px;
  }

  .store-page .logo {
    order: -1;

    flex-basis: 100%;

    max-width: none;

    margin: 0;
    padding-bottom: 0;
  }

  .store-page .center {
    width: min(150px, 40vw);
  }

  .store-page .logo-side-buttons,
  .store-page .logo-side-buttons.right {
    margin: 0;

    gap: 2px;
  }

  .store-page .side-btn {
    padding: 0.45em 0.6em;

    font-size: 0.95rem;
  }


  /* Cart */

  .cart-layout {
    grid-template-columns: 1fr;
  }

  .order-summary {
    position: static;
  }


  /* Footer */

  .store-footer {
    flex-direction: column;

    text-align: center;
  }

  .store-footer nav {
    justify-content: center;
  }
}


/* =========================================================
   MOBILE
   ========================================================= */

@media screen and (max-width: 570px) {

  /* Main content */

  .store-main {
    width: min(calc(100% - 24px), 1180px);

    padding-top: 42px;
  }


  /* Cart panel */

  .cart-panel {
    padding: 0 18px;
  }


  /* Cart items */

  .cart-item {
    grid-template-columns: 92px 1fr;

    gap: 14px;
  }

  .cart-item-image {
    width: 92px;
  }

  .cart-item-actions {
    grid-column: 1 / -1;

    grid-template-columns: auto 70px 1fr auto;

    width: 100%;
  }

  .cart-item-actions label,
  .cart-item-actions select,
  .remove-button,
  .line-total {
    grid-column: auto;

    margin: 0;
  }

  .remove-button {
    justify-self: center;
  }

  .line-total {
    justify-self: end;
  }


  /* Shipping form */

  .form-grid {
    grid-template-columns: 1fr;
  }

  .form-field-wide {
    grid-column: auto;
  }

  .shipping-method-option {
    grid-template-columns: auto 1fr;
  }

  .shipping-method-option > strong:last-child {
    grid-column: 2;
  }


  /* Success page */

  .success-main {
    width: min(calc(100% - 24px), 760px);

    padding-top: 42px;
  }

  .success-card {
    padding: 32px 20px;
  }
}