/* ==========================================================================
   Shopify-Style High-Conversion Checkout for Penicure (WooCommerce Replica)
   ========================================================================== */

:root {
  --shopify-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --shopify-text: #333333;
  --shopify-text-dark: #111111;
  --shopify-muted: #737373;
  --shopify-border: #d9d9d9;
  --shopify-border-light: #e1e1e1;
  --shopify-bg-sidebar: #fafafa;
  --shopify-blue: #005bd3;
  --shopify-blue-hover: #004bb5;
  --shopify-error-bg: #fff4f4;
  --shopify-error-border: #f87171;
  --shopify-error-text: #b91c1c;
}

body.woocommerce-checkout-active,
body.page-template-page-checkout {
  background-color: #ffffff;
  color: var(--shopify-text);
  font-family: var(--shopify-font);
  margin: 0;
  padding: 0;
  -webkit-font-smoothing: antialiased;
}

/* Hide standard theme header / footer on checkout for maximum conversion & fidelity */
body.woocommerce-checkout-active #masthead,
body.woocommerce-checkout-active footer,
body.woocommerce-checkout-active .site-footer,
body.page-template-page-checkout #masthead,
body.page-template-page-checkout footer,
body.page-template-page-checkout .site-footer,
body.page-template-page-checkout #gscAnnouncementBar {
  display: none !important;
}

/* Main Layout Wrapper */
.shopify-checkout-container {
  display: flex;
  min-height: 100vh;
  width: 100%;
  max-width: 1160px;
  margin: 0 auto;
  box-sizing: border-box;
}

/* Left Column: Form Content */
.checkout-main-col {
  flex: 1 1 58%;
  padding: 38px 48px 60px 24px;
  box-sizing: border-box;
  max-width: 650px;
}

/* Right Column: Order Summary Sidebar */
.checkout-sidebar-col {
  flex: 1 1 42%;
  background-color: var(--shopify-bg-sidebar);
  border-left: 1px solid var(--shopify-border-light);
  padding: 42px 24px 60px 44px;
  box-sizing: border-box;
  position: relative;
}

/* Header & Logo */
.checkout-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.checkout-logo-text {
  font-family: var(--shopify-font);
  font-size: 26px;
  font-weight: 700;
  color: var(--shopify-text-dark);
  text-decoration: none;
  letter-spacing: -0.03em;
}

.checkout-header-cart-icon svg {
  width: 22px;
  height: 22px;
  color: var(--shopify-text-dark);
}

/* Express Checkout Section */
.express-checkout-box {
  margin-bottom: 24px;
  text-align: center;
}

.express-checkout-label {
  font-size: 13px;
  color: var(--shopify-muted);
  margin-bottom: 12px;
  display: block;
}

.express-buttons-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 24px;
}

.express-btn {
  height: 48px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border: none;
  font-weight: 600;
  transition: opacity 0.15s ease;
  padding: 0 12px;
  text-decoration: none;
}

.express-btn:hover {
  opacity: 0.92;
}

.express-btn-applepay {
  background-color: #000000;
  color: #ffffff;
}

.express-btn-shop {
  background-color: #5a31f4;
  color: #ffffff;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.express-btn-paypal {
  background-color: #ffc439;
}

.express-btn-gpay {
  background-color: #000000;
}

/* Divider with OR */
.checkout-divider {
  display: flex;
  align-items: center;
  text-align: center;
  margin: 24px 0 28px 0;
  color: var(--shopify-muted);
  font-size: 12px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.checkout-divider::before,
.checkout-divider::after {
  content: "";
  flex: 1;
  border-bottom: 1px solid var(--shopify-border-light);
}

.checkout-divider span {
  padding: 0 16px;
}

/* Section Titles */
.checkout-section-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 14px;
}

.checkout-section-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--shopify-text-dark);
  margin: 0;
}

.checkout-section-action {
  font-size: 13px;
  color: var(--shopify-blue);
  text-decoration: none;
  font-weight: 500;
}

.checkout-section-action:hover {
  text-decoration: underline;
}

.checkout-section-subtitle {
  font-size: 13px;
  color: var(--shopify-muted);
  margin: -6px 0 14px 0;
}

/* Form Fields */
.field-group {
  margin-bottom: 12px;
}

.field-row {
  display: flex;
  gap: 12px;
  margin-bottom: 12px;
}

.field-col-50 {
  flex: 1 1 50%;
  min-width: 0;
}

.field-col-33 {
  flex: 1 1 33.33%;
  min-width: 0;
}

.field-input-wrapper {
  position: relative;
  width: 100%;
}

.field-input,
.field-select {
  width: 100%;
  height: 48px;
  border: 1px solid var(--shopify-border);
  border-radius: 6px;
  padding: 0 14px;
  font-family: var(--shopify-font);
  font-size: 14px;
  color: var(--shopify-text-dark);
  background-color: #ffffff;
  box-sizing: border-box;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.field-input:focus,
.field-select:focus {
  border-color: var(--shopify-blue);
  box-shadow: 0 0 0 1px var(--shopify-blue);
}

.field-select {
  appearance: none;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23737373' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 16px;
  padding-right: 36px;
  cursor: pointer;
}

.field-icon-right {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--shopify-muted);
  pointer-events: none;
  display: flex;
  align-items: center;
}

/* Checkbox Style */
.field-checkbox-label {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  color: var(--shopify-text);
  cursor: pointer;
  margin: 12px 0 24px 0;
  user-select: none;
}

.field-checkbox-label input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--shopify-blue);
  cursor: pointer;
  margin: 0;
}

/* Shipping Method Notice Box */
.shipping-notice-box {
  background-color: #f4f4f4;
  border: 1px solid var(--shopify-border-light);
  border-radius: 6px;
  padding: 16px;
  font-size: 14px;
  color: var(--shopify-muted);
  margin-bottom: 28px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.shipping-method-live {
  background-color: #ffffff;
  border: 1px solid var(--shopify-border);
  border-radius: 6px;
  padding: 16px;
  font-size: 14px;
  color: var(--shopify-text-dark);
  margin-bottom: 28px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 500;
}

.shipping-price-free {
  font-weight: 600;
  color: #16a34a;
}

/* Payment Accordion Box */
.payment-accordion-box {
  border: 1px solid var(--shopify-border);
  border-radius: 6px;
  overflow: hidden;
  margin-bottom: 28px;
}

.payment-option {
  border-bottom: 1px solid var(--shopify-border);
}

.payment-option:last-child {
  border-bottom: none;
}

.payment-option[hidden],
.payment-unavailable[hidden] {
  display: none;
}

.payment-unavailable {
  padding: 18px 16px;
  margin: 0;
  color: #9b1c1c;
  font-size: 14px;
  line-height: 1.45;
}

.payment-option-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px;
  background-color: #ffffff;
  cursor: pointer;
  user-select: none;
}

.payment-option.active .payment-option-header {
  background-color: #fcfcfc;
}

.payment-radio-label {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  font-weight: 600;
  color: var(--shopify-text-dark);
  margin: 0;
  cursor: pointer;
}

.payment-radio-label input[type="radio"] {
  width: 18px;
  height: 18px;
  accent-color: var(--shopify-blue);
  cursor: pointer;
  margin: 0;
}

.payment-cards-icons {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 4px;
  align-items: center;
  list-style: none;
  margin: 0;
  padding: 0;
}

.payment-cards-icons li {
  display: flex;
  line-height: 0;
}

.payment-cards-icons svg {
  width: 38px;
  height: 24px;
}

/* ShieldClimb hosted checkout: redirect notice in place of on-site card fields */
.payment-offsite {
  text-align: center;
  font-size: 14px;
  color: var(--shopify-text, #1a1a1a);
}

.payment-offsite-icon {
  display: block;
  margin: 4px auto 14px;
}

.payment-offsite p {
  margin: 0 auto 8px;
  max-width: 320px;
  line-height: 1.45;
}

.payment-offsite p:last-child {
  margin-bottom: 0;
}

@media (max-width: 480px) {
  .payment-cards-icons svg {
    width: 32px;
    height: 20px;
  }
}

.payment-option-body {
  display: none;
  padding: 18px 16px;
  background-color: #fafafa;
  border-top: 1px solid var(--shopify-border-light);
}

.payment-option.active .payment-option-body {
  display: block;
}

/* Pay Now Button */
.btn-pay-now {
  width: 100%;
  height: 54px;
  background-color: var(--shopify-blue);
  color: #ffffff;
  font-family: var(--shopify-font);
  font-size: 16px;
  font-weight: 600;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: background-color 0.15s ease, opacity 0.15s ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.btn-pay-now:hover {
  background-color: var(--shopify-blue-hover);
}

.btn-pay-now:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

/* Spinner */
.btn-spinner {
  display: none;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: shopify-spin 0.8s linear infinite;
}

@keyframes shopify-spin {
  to { transform: rotate(360deg); }
}

.btn-pay-now.loading .btn-spinner {
  display: inline-block;
}

/* Checkout Footer Links */
.checkout-footer-links {
  margin-top: 32px;
  padding-top: 20px;
  border-top: 1px solid var(--shopify-border-light);
  display: flex;
  gap: 20px;
  font-size: 12px;
}

.checkout-footer-links a {
  color: var(--shopify-blue);
  text-decoration: none;
}

.checkout-footer-links a:hover {
  text-decoration: underline;
}

/* Error Callout */
.checkout-error-box {
  display: none;
  background-color: var(--shopify-error-bg);
  border: 1px solid var(--shopify-error-border);
  border-radius: 6px;
  padding: 14px 16px;
  margin-bottom: 24px;
  color: var(--shopify-error-text);
  font-size: 14px;
  line-height: 1.4;
}

/* ==========================================================================
   Order Summary Sidebar (Right Column)
   ========================================================================== */

.summary-items-list {
  display: flex;
  flex-direction: column;
  gap: 18px;
  margin-bottom: 24px;
  max-height: 480px;
  overflow-y: auto;
  padding-right: 6px;
}

/* Scrollbar */
.summary-items-list::-webkit-scrollbar {
  width: 5px;
}
.summary-items-list::-webkit-scrollbar-thumb {
  background-color: #ccc;
  border-radius: 4px;
}

.summary-item-card {
  display: flex;
  align-items: center;
  gap: 16px;
  width: 100%;
}

.summary-item-thumb-wrapper {
  position: relative;
  width: 64px;
  height: 64px;
  border-radius: 8px;
  border: 1px solid var(--shopify-border-light);
  background-color: #ffffff;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: visible;
}

.summary-item-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 8px;
}

.summary-item-qty-badge {
  position: absolute;
  top: -8px;
  right: -8px;
  width: 21px;
  height: 21px;
  background-color: rgba(114, 114, 114, 0.95);
  color: #ffffff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
  z-index: 2;
}

.summary-item-info {
  flex: 1 1 auto;
  min-width: 0;
}

.summary-item-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--shopify-text-dark);
  margin: 0 0 2px 0;
  line-height: 1.3;
}

.summary-item-variant {
  font-size: 12px;
  color: var(--shopify-muted);
  margin: 0;
}

.summary-item-discount-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  color: #555555;
  margin-top: 4px;
  font-weight: 500;
}

.summary-item-discount-tag svg {
  width: 12px;
  height: 12px;
  color: #555555;
}

.summary-item-price-col {
  text-align: right;
  flex-shrink: 0;
}

.summary-price-original {
  font-size: 13px;
  color: var(--shopify-muted);
  text-decoration: line-through;
  margin-right: 6px;
}

.summary-price-current {
  font-size: 14px;
  font-weight: 600;
  color: var(--shopify-text-dark);
}

/* Discount Code Input Box */
.summary-discount-box {
  display: flex;
  gap: 10px;
  margin: 24px 0;
}

.summary-discount-input {
  flex: 1;
  height: 44px;
  border: 1px solid var(--shopify-border);
  border-radius: 6px;
  padding: 0 14px;
  font-size: 14px;
  outline: none;
  background-color: #ffffff;
}

.summary-discount-btn {
  height: 44px;
  padding: 0 18px;
  border: 1px solid var(--shopify-border);
  border-radius: 6px;
  background-color: #f1f1f1;
  color: var(--shopify-muted);
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: background-color 0.15s;
}

.summary-discount-btn:hover {
  background-color: #e5e5e5;
  color: var(--shopify-text-dark);
}

/* Totals Breakdown */
.summary-totals-table {
  border-top: 1px solid var(--shopify-border-light);
  padding-top: 18px;
  margin-top: 18px;
}

.summary-totals-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 14px;
  color: var(--shopify-text);
  margin-bottom: 10px;
}

.summary-totals-row.final-total {
  border-top: 1px solid var(--shopify-border-light);
  padding-top: 18px;
  margin-top: 18px;
  margin-bottom: 6px;
}

.final-total-label {
  font-size: 16px;
  font-weight: 600;
  color: var(--shopify-text-dark);
}

.final-total-price {
  font-size: 20px;
  font-weight: 700;
  color: var(--shopify-text-dark);
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.currency-code {
  font-size: 12px;
  color: var(--shopify-muted);
  font-weight: 500;
}

.summary-savings-row {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 700;
  color: var(--shopify-text-dark);
  margin-top: 6px;
  letter-spacing: -0.01em;
}

.summary-savings-row svg {
  width: 14px;
  height: 14px;
}

/* Mobile Order Summary Accordion */
.mobile-summary-toggle-bar {
  display: none;
  background-color: #f6f6f6;
  border-top: 1px solid var(--shopify-border-light);
  border-bottom: 1px solid var(--shopify-border-light);
  padding: 16px 20px;
  cursor: pointer;
  user-select: none;
  justify-content: space-between;
  align-items: center;
}

.mobile-summary-toggle-left {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--shopify-blue);
  font-weight: 500;
}

.mobile-summary-toggle-left svg.chevron {
  width: 12px;
  height: 12px;
  transition: transform 0.2s ease;
}

.mobile-summary-toggle-bar.open .mobile-summary-toggle-left svg.chevron {
  transform: rotate(180deg);
}

.mobile-summary-price {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  font-size: 16px;
  font-weight: 700;
  color: var(--shopify-text-dark);
}

.mobile-summary-compare {
  font-size: 13px;
  font-weight: 400;
  color: #707070;
}

.checkout-header--mobile {
  display: none;
}

/* ==========================================================================
   Responsive Breakpoints
   ========================================================================== */

@media screen and (max-width: 999px) {
  .shopify-checkout-container {
    flex-direction: column;
  }

  .mobile-summary-toggle-bar {
    display: flex;
  }

  /* Logo above the summary bar; the form's own logo is hidden */
  .checkout-header--mobile {
    display: flex;
    margin: 0;
    padding: 16px 20px;
  }

  .checkout-main-col > .checkout-header {
    display: none;
  }

  /* The summary opens right under the bar, above the form */
  .checkout-sidebar-col {
    order: -1;
    display: none;
    border-left: none;
    border-bottom: 1px solid var(--shopify-border-light);
    padding: 24px 20px;
    background-color: #fafafa;
  }

  .checkout-sidebar-col.open-mobile {
    display: block;
  }

  .checkout-main-col {
    flex: 1 1 100%;
    max-width: 100%;
    padding: 24px 20px 48px 20px;
  }

  .field-row {
    flex-direction: column;
    gap: 12px;
  }

  .field-col-50,
  .field-col-33 {
    flex: 1 1 100%;
  }

  .express-buttons-grid {
    grid-template-columns: 1fr;
    gap: 8px;
  }
}

@media screen and (min-width: 540px) and (max-width: 999px) {
  .express-buttons-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
  }
}

/* ==========================================================================
   Order page: "View Your Order" from the confirmation email, order payment
   (template-parts/checkout-order.php, woocommerce/checkout/thankyou.php)
   ========================================================================== */

.order-thankyou-head {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 8px 0 24px;
}

.order-thankyou-icon {
  flex: 0 0 auto;
  width: 46px;
  height: 46px;
  color: var(--shopify-blue);
}

.order-thankyou-icon svg {
  width: 100%;
  height: 100%;
}

.order-thankyou-number {
  margin: 0 0 2px;
  font-size: 14px;
  color: var(--shopify-muted);
}

.order-thankyou-title {
  margin: 0;
  font-size: 24px;
  font-weight: 600;
  line-height: 1.25;
  color: var(--shopify-text-dark);
}

.order-status-box {
  border: 1px solid var(--shopify-border);
  border-radius: 8px;
  padding: 18px 20px;
  margin-bottom: 16px;
  font-size: 14px;
  line-height: 1.5;
}

.order-status-box p {
  margin: 0;
  color: var(--shopify-muted);
}

.order-status-box.is-failed {
  border-color: var(--shopify-error-border);
  background-color: var(--shopify-error-bg);
}

.order-status-box.is-failed p {
  color: var(--shopify-error-text);
}

.order-status-title {
  margin: 0 0 6px;
  font-size: 17px;
  font-weight: 600;
  color: var(--shopify-text-dark);
}

.order-status-btn {
  margin-top: 16px;
  text-decoration: none;
}

.order-progress-steps {
  list-style: none;
  margin: 0 0 10px;
  padding: 0;
}

.order-progress-steps li {
  position: relative;
  padding: 3px 0 3px 26px;
  color: var(--shopify-muted);
}

.order-progress-steps li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 6px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 1.5px solid var(--shopify-border);
  box-sizing: border-box;
}

.order-progress-steps li.is-done,
.order-progress-steps li.is-current {
  color: var(--shopify-text-dark);
}

.order-progress-steps li.is-done::before {
  border-color: var(--shopify-blue);
  background: var(--shopify-blue) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 12.5 10 16.5 18 8'/%3E%3C/svg%3E") center / 12px no-repeat;
}

.order-progress-steps li.is-current {
  font-weight: 600;
}

.order-progress-steps li.is-current::before {
  border-color: var(--shopify-blue);
  border-width: 5px;
}

.order-progress-note {
  font-size: 13px;
}

.order-details-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px 24px;
  margin-top: 12px;
}

.order-details-grid h3 {
  margin: 0 0 4px;
  font-size: 14px;
  font-weight: 600;
  color: var(--shopify-text-dark);
}

.order-details-grid p {
  word-break: break-word;
}

.order-page-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 24px;
}

.order-continue-btn {
  display: inline-flex;
  width: auto;
  padding: 0 28px;
  text-decoration: none;
}

/* WooCommerce forms shown on the order page (guest e-mail check, "Pay for order") */
.order-page-content .woocommerce input[type="email"],
.order-page-content .woocommerce input[type="text"] {
  width: 100%;
  height: 48px;
  padding: 0 12px;
  border: 1px solid var(--shopify-border);
  border-radius: 6px;
  font: inherit;
  font-size: 14px;
  box-sizing: border-box;
}

.order-page-content .woocommerce button.button,
.order-page-content .woocommerce #place_order {
  height: 48px;
  padding: 0 24px;
  border: none;
  border-radius: 6px;
  background-color: var(--shopify-blue);
  color: #ffffff;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

@media screen and (max-width: 999px) {
  .order-page-actions .order-continue-btn {
    width: 100%;
  }
}

@media screen and (max-width: 540px) {
  .order-details-grid {
    grid-template-columns: 1fr;
  }
}
