/* ======================================== SHARED CARD STYLES ======================================== */
.shipping-address-card,
.shipping-address-summary,
.payment-method-card,
.discount-card {
  background: #fff;
  border-radius: 12px;
  padding: 0;
  margin: 4px -5px;
  overflow: hidden;
}
.shipping-popupsummary {
  padding: 0 8px;
}

/* ======================================== COMPACT ROW STYLES (Shared) ======================================== */
.address-compact-row,
.payment-compact-row,
.discount-compact-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 4px 16px;
  cursor: pointer;
  transition: background 0.2s;
}

.address-compact-row:hover,
.payment-compact-row:hover,
.discount-compact-row:hover {
  background: rgba(0, 0, 0, 0.02);
}

.address-compact-row.address-compact-empty {
  background: #fff;
}

.address-compact-label,
.payment-compact-label,
.discount-compact-label {
  font-size: 15px;
  font-weight: 400;
  color: #333;
}

.address-compact-action,
.payment-compact-action,
.discount-compact-action {
  font-size: 15px;
  font-weight: 400;
  color: #666;
  display: flex;
  align-items: center;
  gap: 4px;
}
.address-slider {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 13px;
    color: #888;
    margin: 0 8px;
    min-width: 0;
}

/* ======================================== COMPACT DETAILS (Shared) ======================================== */
.address-compact-details,
.payment-compact-details,
.discount-compact-details {
  padding: 4px 16px;
  border-top: 1px solid rgba(0, 0, 0, 0.05);
}

.address-compact-name {
  font-size: 14px;
  color: #333;
}

.address-compact-text {
  font-size: 14px;
  font-weight: 400;
  color: #666;
  line-height: 1.6;
}

/* ======================================== SHARED MODAL STYLES ======================================== */
.address-modal-overlay,
.payment-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  display: none;
  justify-content: center;
  align-items: flex-end;
  /* Above #summary-details (100000) so address/payment/login work while summary stays open */
  z-index: 100060;
  opacity: 0;
  transition: opacity 0.3s ease-in-out;
}

.address-modal-overlay.active {
  opacity: 1;
}

.payment-modal-overlay.active {
  display: flex;
  opacity: 1;
}

.address-modal-container,
.payment-modal-container {
  width: 100%;
  max-width: 600px;
  max-height: 90vh;
  border-radius: 16px 16px 0 0;
  overflow: hidden;
  transform: translateY(100%);
  transition: transform 0.3s ease-in-out;
  display: flex;
  flex-direction: column;
}

.address-modal-container {
  background: #F5F7FF;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.1);
}

.payment-modal-container {
  background: #f6f7fe;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);
}

.address-modal-overlay.active .address-modal-container,
.payment-modal-overlay.active .payment-modal-container {
  transform: translateY(0);
}

/* ======================================== MODAL HEADER (Shared) ======================================== */
.address-modal-header,
.payment-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
}

.address-modal-header {
  padding: 20px 24px;
}

.payment-modal-header {
  padding: 16px 20px;
}

.address-modal-header h2,
.payment-modal-header h2 {
  font-size: 20px;
  color: #333;
  margin: 0;
}

.address-modal-close,
.payment-modal-close {
  background: #f6f6f6;
  border: none;
  border-radius: 50%;
  font-size: 32px;
  line-height: 1;
  color: #666;
  cursor: pointer;
  padding: 0;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s;
  margin-block-start: 0 !important;
}

.address-modal-close:hover,
.payment-modal-close:hover {
  color: #333;
}

/* ======================================== MODAL BODY (Shared) ======================================== */
.address-modal-body,
.payment-modal-body {
  overflow-y: auto;
  flex: 1;
}

.address-modal-body {
  padding: 0 16px;
}

.payment-modal-body {
  padding: 0 20px;
}

/* ======================================== ADDRESS LIST ======================================== */
.address-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.address-option {
  display: flex;
  align-items: flex-start;
  padding: 16px;
  background: #f8f9fa;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s;
  border: 2px solid transparent;
}

.address-option:hover {
  background: #e8f0fe;
}

.address-option.selected {
  background: #e8f0fe;
  border-color: #4285f4;
}

.address-option-radio {
  margin-right: 12px;
  flex-shrink: 0;
}

.radio-icon {
  font-size: 20px;
  color: #999;
  transition: color 0.2s;
}

.address-option.selected .radio-icon {
  color: #4285f4;
}

.address-option-content {
  flex: 1;
  min-width: 0;
}

.address-option-name {
  font-weight: 600;
  font-size: 14px;
  color: #333;
  margin-bottom: 4px;
}

.address-option-text {
  font-size: 13px;
  color: #666;
  line-height: 1.5;
  word-wrap: break-word;
}

/* ======================================== ADDRESS FORM ======================================== */
.address-form-group {
  margin-bottom: 12px;
}

.address-modal-body .address-form-group:nth-child(3) {
  margin-bottom: 6px;
}

.address-modal-body .address-form-group:last-child {
  margin-bottom: 0px;
}

.address-form-group label {
  display: none;
}

.address-form-group input,
.address-form-group textarea {
  width: 100%;
  padding: 16px 10px !important;
  font-size: 16px;
  background-color: #fff !important;
  border: 1px solid #e8e9ea !important;
  border-radius: 12px !important;
  font-family: inherit;
  transition: all 0.2s !important;
  box-sizing: border-box;
  color: #333;
}

.address-form-group input:focus,
.address-form-group textarea:focus {
  outline: none;
  background: #fff;
  border-color: #d0d1d2;
}

.address-form-group textarea {
  resize: vertical;
  height: 7rem;
  line-height: 1.5;
}

.address-form-group input::placeholder,
.address-form-group textarea::placeholder {
  color: #a0a1a3;
  font-size: 16px;
}

/* ======================================== MODAL FOOTER (Shared) ======================================== */
.address-modal-footer,
.payment-modal-footer {
  flex-shrink: 0;
}

.address-modal-footer {
  padding: 16px 24px;
  display: flex;
  gap: 8px;
}

.payment-modal-footer {
  padding: 16px 24px;
}

.address-cancel-btn {
  flex: 1;
  padding: 14px 20px;
  background: #fff;
  color: #333;
  border: .5px solid #999;
  border-radius: 50px;
  font-size: 16px;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.address-cancel-btn:hover {
  background: #f8f9fa;
}

.address-cancel-btn:active {
  background: #e8e9ea;
}

.address-save-btn,
.payment-confirm-btn {
  padding: 12px 25px;
  background: #3829E1;
  color: #fff;
  border-radius: 50px;
  font-size: 16px;
  font-family: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: none;
}

.address-save-btn {
  flex: 1;
}

.payment-confirm-btn {
  width: 100%;
  padding: 16px;
}

.address-save-btn:hover {
  background: #2a2a2a;
  border-color: #2a2a2a;
}

.address-save-btn:active {
  background: #0a0a0a;
  border-color: #0a0a0a;
}

.payment-confirm-btn:hover:not(:disabled) {
  background: #3829E1;
}

.payment-confirm-btn:disabled {
  background: #3829E1;
  cursor: not-allowed;
}

.payment-confirm-btn .btn-arrows {
  font-size: 14px;
  letter-spacing: 2px;
}

/* ======================================== PAYMENT COMPACT ROW - Specific ======================================== */
.payment-compact-row.payment-locked {
  cursor: default;
  background: #f8f9fa;
}

.payment-compact-row.payment-locked:hover {
  background: #f8f9fa;
}

.payment-compact-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.payment-compact-value {
  font-size: 14px;
  font-weight: 500;
  color: #333;
}

.payment-compact-action.disabled {
  color: #ccc;
  pointer-events: none;
}

.payment-compact-method {
  font-size: 14px;
  font-weight: 600;
  color: #333;
  display: flex;
  align-items: center;
  gap: 8px;
}

.payment-compact-method svg {
  width: 18px;
  height: 18px;
  color: #666;
}

.payment-locked-badge {
  font-size: 11px;
  font-weight: 500;
  color: #888;
  background: #f0f0f0;
  padding: 2px 8px;
  border-radius: 4px;
  margin-left: 8px;
}

/* ======================================== PAYMENT OPTIONS ======================================== */
.payment-options-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.payment-option-card {
  background: #fff;
  border-radius: 16px;
  padding: 12px !important;
  cursor: pointer;
  transition: all 0.2s ease;
  border: 2px solid transparent;
}

.payment-option-card:hover {
  background: #f0f0f0;
}

.payment-option-card.selected {
  background: #fff;
  margin: 0 !important;
}

.payment-option-header {
  display: flex;
  align-items: center;
  gap: 12px;
}

.payment-option-radio {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.2s;
}

.payment-option-card:not(.selected) .payment-option-radio {
  background: #f3f3f3;
}

.payment-option-card.selected .payment-option-radio {
  background: #3579f7;
}

.payment-option-radio svg {
  width: 32px;
  height: 32px;
  color: #fff;
  opacity: 0;
  transition: opacity 0.2s;
}

.payment-option-card.selected .payment-option-radio svg {
  opacity: 1;
}

.payment-option-content {
  flex: 1;
}

.payment-option-title {
  font-size: 18px;
  color: #222;
  margin: 0;
}

.payment-option-card:not(.selected) .payment-option-title {
  color: #666;
}

.pay-discount {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 8px;
  padding: 4px 10px;
  background: #e8f5e9;
  color: #2e7d32;
  font-size: 13px;
  font-weight: 600;
  border-radius: 6px;
}

.payment-discount-text {
  color: #e85d04;
  font-weight: 600;
}

.pay-discount svg {
  width: 16px;
  height: 16px;
  color: #2e7d32;
}

.pay-discount-inline {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: white;
  font-size: 12px;
  font-weight: 500;
  padding: 2px 8px;
  border-radius: 4px;
  margin-left: 8px;
  vertical-align: middle;
}

.pay-discount-inline svg {
  flex-shrink: 0;
}

/* ======================================== PAYMENT EXPAND CONTENT ======================================== */
.payment-option-expand {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease, padding 0.3s ease;
  padding-top: 0;
}

.payment-option-card.selected .payment-option-expand {
  max-height: 500px;
  padding-top: 4px;
}

.payment-expand-content {
  margin-top: 4px;
}

/* ======================================== BANK TRANSFER SECTION ======================================== */
.bank-transfer-section {
  background: #f6f7fe;
  border-radius: 12px;
  padding: 8px;
}

.bank-transfer-section .bank-info {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 4px;
}

.bank-transfer-section .bank-info bankicon img {
  width: 56px;
  height: 56px;
  border-radius: 8px;
}

.bank-transfer-section .bank-info .info {
  flex: 1;
}

.bank-transfer-section .bank-info .info strong {
  display: block;
  font-size: 14px;
  color: #333;
}

.bank-transfer-section .bank-info .info .hidden-sm {
  font-size: 13px;
  color: #666;
  margin-top: 4px;
}

.bank-transfer-section #copy-bank-number {
  background: #e0e0e0;
  border: none;
  padding: 4px 12px;
  border-radius: 4px;
  font-size: 12px;
  cursor: pointer;
  transition: background 0.2s;
}

.bank-transfer-section #copy-bank-number:hover {
  background: #d0d0d0;
}

/* ======================================== BANK SLIP UPLOAD ======================================== */
.bank-slip-upload {
  margin-top: 8px;
}

.bank-slip-upload-label {
  font-size: 14px;
  display: block;
}

.bank-slip-upload-area {
  border: 2px dashed #ccc;
  border-radius: 12px;
  padding: 8px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  background: #fff;
}

.bank-slip-upload-area:hover {
  border-color: #999;
  background: #fafafa;
}

.bank-slip-upload-area.has-file {
  border-color: #4CAF50;
  border-style: solid;
}

.bank-slip-upload-icon {
  width: 36px;
  height: 36px;
  margin: 0 auto;
  color: #999;
}

.bank-slip-upload-text {
  font-size: 16px;
  color: #666;
}

.bank-slip-upload-hint {
  font-size: 12px;
  color: #999;
}

.bank-slip-preview {
  margin-top: 12px;
  text-align: center;
}

.bank-slip-preview img {
  max-width: 100%;
  max-height: 200px;
  border-radius: 8px;
  display: block;
  margin: 0 auto;
  border: 2px solid #4CAF50;
}

.bank-slip-change {
  display: inline-block;
  margin-top: 12px;
  padding: 10px 24px;
  background: #f5f5f5;
  border: 1px solid #ddd;
  border-radius: 8px;
  color: #333;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.bank-slip-change:hover {
  background: #e8e8e8;
  border-color: #ccc;
}

.bank-slip-remove {
  display: block;
  margin: 8px auto 0;
  background: none;
  border: none;
  color: #e53935;
  font-size: 14px;
  cursor: pointer;
}

/* ======================================== CREDIT CARD SECTION ======================================== */
.credit-card-section {
  background: #f8f9fa;
  border-radius: 12px;
  padding: 16px;
}

.credit-card-section #stripe-card-element-modal {
  background: #fff;
  padding: 16px;
  border-radius: 8px;
  border: 1px solid #ddd;
}

.credit-card-section .secure-payment-modal {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  font-size: 12px;
  color: #666;
}

.credit-card-section .secure-payment-modal svg {
  width: 16px;
  height: 16px;
  color: #4CAF50;
}

.credit-card-section .secure-payment-modal img {
  height: 20px;
  margin-left: auto;
}

.credit-card-section #card-errors-modal {
  color: #e53935;
  font-size: 13px;
  margin-top: 8px;
}

/* ======================================== WAITING TRANSFER REMARK ======================================== */
.waiting-transfer-remark {
  text-align: center;
  font-size: 13px;
  color: #888;
  margin-top: 12px;
  padding: 8px;
  background: #fff8e1;
  border-radius: 8px;
}

/* ======================================== DISCOUNT DETAILS ======================================== */
.discount-detail-item {
  font-size: 14px;
  font-weight: 500;
  color: #333;
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
  justify-content: space-between;
}

.discount-detail-left {
  display: flex;
  align-items: center;
  gap: 6px;
}

.discount-detail-item:last-child {
  margin-bottom: 0;
}

.discount-detail-item svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.discount-detail-item .discount-amount {
  color: #e85d04;
  font-weight: 600;
  flex-shrink: 0;
}

/* ======================================== CASH VOUCHER ROW ======================================== */
.cash-voucher-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #fff;
  padding: 4px 16px;
  margin: 4px 0;
  border-radius: 12px;
  font-size: .9rem !important;
  font-weight: 300;
}

.cash-voucher-row div:last-child {
  color: #16a34a;
  font-weight: 500;
}

/* ======================================== COMPACT SUMMARY ROWS ======================================== */
/* Delivery + Subtotal combined row */
.delivery-subtotal-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 2px 8px;
  font-size: 14px;
  color: #666;
}

.delivery-date-short {
  color: #333;
  font-weight: 500;
}

.subtotal-inline {
  color: #666;
  font-weight: 400;
}

/* Grand total with inline savings */
.grand-total [summary="grand-total"] {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
}

.savings-inline {
  color: #4CAF50;
  font-size: 14px;
  font-weight: 500;
}

.grandtotal-amount {
  font-size: 20px;
  font-weight: 700;
  color: #333;
}
/* ======================================== SUMMARY DETAILS ======================================== */
/*
 * LIFF-inspired checkout panel:
 * - Mobile: full-viewport column (header + scroll + sticky CTA)
 * - Desktop: centered max-width panel over scrim
 * Uses !important where WordPress custom CSS forces bottom-sheet chrome.
 */

body.benjaruk-summary-open {
  overflow: hidden !important;
  overscroll-behavior: none;
}

#summary-details {
  display: none;
  flex-direction: column;
  overflow: hidden;
  box-sizing: border-box;
}

#summary-details.active {
  display: flex !important;
  position: fixed !important;
  inset: 0 !important;
  left: 0 !important;
  right: 0 !important;
  top: 0 !important;
  bottom: 0 !important;
  width: 100% !important;
  max-width: none !important;
  height: 100% !important;
  height: 100dvh !important;
  max-height: none !important;
  margin: 0 !important;
  /* No side gutter — white padding here would show as white borders beside gray scroll */
  padding: 0 !important;
  transform: none !important;
  opacity: 1 !important;
  z-index: 100000 !important;
  background: #fff !important;
  background-color: #fff !important;
  box-shadow: none !important;
  border-radius: 0 !important;
  align-items: stretch !important;
  justify-content: flex-start !important;
}

/* Extra specificity vs theme Customizer / Elementor dark scrim rules */
html body.benjaruk-checkout #summary-details.active,
html body.benjaruk-summary-open #summary-details.active {
  background: #ffffff !important;
  background-color: #ffffff !important;
  opacity: 1 !important;
}

#summary-details.active > .order-summary,
#summary-details.active > .summary-scroll-content,
#summary-details.active > .grand-total,
#summary-details.active > .summary-submit-button {
  transform: none !important;
  opacity: 1 !important;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

#summary-details.active > .order-summary {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: calc(6px + env(safe-area-inset-top, 0px)) 8px 6px;
  margin: 0;
  background: #fff;
  border-bottom: 1px solid rgba(15, 23, 42, 0.06);
  cursor: pointer;
  user-select: none;
  z-index: 2;
}

#summary-details.active > .order-summary [summary="toggle-button"] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #eef1f5;
  flex-shrink: 0;
}

#summary-details.active > .summary-scroll-content {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  /* Gray fills padding box edge-to-edge; content stays inset */
  padding: 6px 12px 12px;
  background: #f5f7fb;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

#summary-details.active > hr {
  display: none;
}

#summary-details.active > .grand-total {
  flex-shrink: 0;
  margin: 0;
  padding: 5px 8px 0;
  background: #fff;
  border-top: 1px solid rgba(15, 23, 42, 0.08);
  box-shadow: 0 -8px 24px rgba(15, 23, 42, 0.06);
  z-index: 2;
}

#summary-details.active > .summary-submit-button {
  flex-shrink: 0;
  margin: 0;
  padding: 5px 8px calc(6px + env(safe-area-inset-bottom, 0px));
  background: #fff;
  z-index: 2;
}

#summary-details.active > .summary-submit-button .summary-submit-button,
#summary-details.active #summary-submit-btn {
  width: 100%;
  margin: 0;
}

#summary-details .summary-scroll-content {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
}

#summary-details .order-products,
#summary-details .shipping-address-card,
#summary-details .payment-method-card,
#summary-details .discount-card,
#summary-details .cash-voucher-row,
#summary-details .delivery-subtotal-row {
  /* Cancel shared negative side margins so cards sit inside scroll padding */
  margin-left: 0 !important;
  margin-right: 0 !important;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  border-radius: 12px;
}

#summary-details .shipping-popupsummary {
  padding-left: 0;
  padding-right: 0;
}

#summary-details .delivery-subtotal-row {
  padding-left: 8px;
  padding-right: 8px;
}

/* Summary body: match CTA (“กรุณาระบุที่อยู่”) scale — no zoom enlargement */
#summary-details.active .summary-scroll-content {
  zoom: 1;
}

/* Desktop: payment-modal model — #summary-details is overlay; .summary-desktop-card is white panel */
@media (min-width: 768px) {
  #summary-details.active {
    inset: 0 !important;
    left: 0 !important;
    right: 0 !important;
    top: 0 !important;
    bottom: 0 !important;
    width: 100% !important;
    max-width: none !important;
    height: 100% !important;
    max-height: none !important;
    transform: none !important;
    border-radius: 0 !important;
    /* Lighter than theme CCSS rgb(0 0 0/.5); single overlay layer */
    background: rgba(0, 0, 0, 0.35) !important;
    background-color: rgba(0, 0, 0, 0.35) !important;
    box-shadow: none !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 12px !important;
  }

  body.benjaruk-summary-open::before,
  body.benjaruk-summary-no-scrim::before {
    content: none !important;
    display: none !important;
    background: transparent !important;
  }

  #summary-details.active > .summary-desktop-card {
    display: flex !important;
    flex-direction: column !important;
    width: min(600px, calc(100vw - 24px)) !important;
    max-width: 600px !important;
    max-height: min(90vh, 900px) !important;
    margin: 0 auto !important;
    background: #ffffff !important;
    border-radius: 24px !important;
    overflow: hidden !important;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.18) !important;
    box-sizing: border-box !important;
  }

  #summary-details.active .summary-desktop-card > .order-summary {
    padding: 7px 10px;
    border-radius: 24px 24px 0 0;
    background: #fff !important;
  }

  #summary-details.active .summary-desktop-card > .summary-scroll-content {
    max-height: min(58vh, 560px);
    padding: 6px 12px 10px;
    background: #f5f7fb !important;
    box-sizing: border-box;
  }

  #summary-details.active .summary-desktop-card > .summary-submit-button {
    padding: 5px 10px 8px;
    border-radius: 0 0 24px 24px;
    background: #fff !important;
  }

  html body.benjaruk-checkout #summary-details.active,
  html body.benjaruk-summary-open #summary-details.active {
    background: rgba(0, 0, 0, 0.35) !important;
    background-color: rgba(0, 0, 0, 0.35) !important;
    opacity: 1 !important;
    color: #1a1a1a !important;
  }
}

/* ======================================== EMPTY STATE ======================================== */
.no-addresses-message {
  text-align: center;
  padding: 40px 20px;
  color: #999;
  font-size: 14px;
}

/* ======================================== UTILITY CLASSES ======================================== */
.hidden {
  display: none !important;
}

.loading {
  opacity: 0.6;
  pointer-events: none;
}

/* ======================================== LEGACY COMPATIBILITY ======================================== */
.address-name {
  font-weight: 600;
  color: #333;
  margin-bottom: 4px;
}

.address-text {
  color: #666;
  line-height: 1.5;
}

/* ======================================== HIDE ORIGINAL SECTIONS ======================================== */
.payment-method {
  display: none !important;
}

#payment .stripe {
  display: none !important;
}

.bank-slip {
  display: none !important;
}

/* ======================================== ANIMATIONS ======================================== */
@keyframes slideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

@keyframes slideDown {
  from { transform: translateY(0); }
  to { transform: translateY(100%); }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes fadeOut {
  from { opacity: 1; }
  to { opacity: 0; }
}

/* ======================================== DESKTOP (min-width: 768px) ======================================== */
@media (min-width: 768px) {
  .address-modal-overlay,
  .payment-modal-overlay {
    align-items: center;
  }
  
  .address-modal-container {
    border-radius: 24px;
    max-height: 80vh;
  }
  
  .payment-modal-container {
    border-radius: 24px;
    max-height: 85vh;
  }
}

/* ======================================== MOBILE (max-width: 480px) ======================================== */
@media (max-width: 480px) {
  /* Modal Headers */
  .address-modal-header,
  .payment-modal-header {
    padding: 16px 20px;
  }
  
  .address-modal-header h2,
  .payment-modal-header h2 {
    font-size: 18px;
  }
  
  /* Modal Bodies */
  .address-modal-body {
    padding: 0 12px;
  }
  
  .payment-modal-body {
    padding: 0 16px;
  }
  
  /* Address Options */
  .address-option {
    padding: 12px;
  }
  
  .address-option-name {
    font-size: 13px;
  }
  
  .address-option-text {
    font-size: 12px;
  }
  
  /* Address Form - CRITICAL: 16px prevents iOS zoom */
  .address-form-group label {
    display: none;
  }
  
  .address-form-group input,
  .address-form-group textarea {
    font-size: 16px !important;
    padding: 14px 16px;
  }
  
  /* ======================================== LOGIN SUGGESTION BANNER ======================================== */
.login-suggestion-banner {
  background: #aec6f9;
  color: #fff;
  padding: 12px 16px;
  font-size: 14px;
  font-weight: 500;
  text-align: center;
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  transition: background 0.2s, transform 0.1s;
  width: -webkit-fill-available;
  margin: 0 -8px;
  padding: 4px 0;
}

.login-suggestion-banner:hover {
  background: #9bb8f5;
}

.login-suggestion-banner:active {
  transform: scale(0.98);
}

.login-suggestion-banner .arrow {
  font-size: 16px;
  font-weight: 600;
}

  /* Payment Options */
  .payment-option-card {
    padding: 16px;
  }
  
  .payment-option-title {
    font-size: 16px;
  }
  
  .payment-option-radio {
    width: 25px;
    height: 25px;
  }
  
  /* Modal Footers */
  .address-modal-footer,
  .payment-modal-footer {
    padding: 12px 16px;
  }
  
  .address-cancel-btn,
  .address-save-btn,
  .payment-confirm-btn {
    padding: 12px 16px;
    font-size: 15px;
  }
}

/* ========================================
   #use-points OTP drawer — overlay model
   Overrides legacy theme CSS (left:50% + margin + full pill radius)
   that chips the header away from the sheet body.
   ======================================== */
#use-points {
  position: fixed !important;
  inset: 0 !important;
  left: 0 !important;
  right: 0 !important;
  top: 0 !important;
  bottom: 0 !important;
  width: 100% !important;
  max-width: none !important;
  height: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
  transform: none !important;
  background: rgba(0, 0, 0, 0.5) !important;
  /* Theme left 16px radius + white glow shadow on this full-bleed dimmer → chipped viewport corners */
  border-radius: 0 !important;
  box-shadow: none !important;
  z-index: 2147483000 !important; /* above cookie consent bars */
  display: none !important;
  flex-direction: column !important;
  justify-content: flex-end !important;
  align-items: center !important;
  opacity: 0;
  box-sizing: border-box !important;
  transition: opacity 0.3s ease-out;
  gap: 0 !important;
}

#use-points.active {
  display: flex !important;
  opacity: 1 !important;
  padding-bottom: 0 !important;
}

#use-points > .otp-toggle,
#use-points > .tabcontent,
#use-points > div {
  width: 100% !important;
  max-width: 600px !important;
  margin: 0 !important;
  box-sizing: border-box;
}

/* Header must share top corners only — not a detached pill */
#use-points > .otp-toggle {
  background-color: #F5F7FF !important;
  border-radius: 16px 16px 0 0 !important;
  padding-left: 0.5rem !important;
  padding-right: 0.5rem !important;
  margin-top: 0 !important;
  margin-bottom: 0 !important;
  box-shadow: none !important;
}

#use-points > .tabcontent {
  background-color: #F5F7FF !important;
  border-radius: 0 !important;
  padding-left: 0.5rem !important;
  padding-right: 0.5rem !important;
  max-height: 75vh;
  overflow-y: auto;
  margin: 0 !important;
  box-shadow: none !important;
}

/* Visible panel gets bottom corners so sheet reads as one card */
#use-points > .tabcontent[style*="display: block"],
#use-points > .tabcontent[style*="display:block"] {
  border-radius: 0 0 16px 16px !important;
  padding-bottom: 8px !important;
}

#use-points > .tabcontent[style*="display: none"],
#use-points > .tabcontent[style*="display:none"] {
  display: none !important;
  height: 0 !important;
  overflow: hidden !important;
  padding: 0 !important;
  margin: 0 !important;
  border: 0 !important;
}

/* Keep cookie / consent bars from covering OTP CTA */
html.otp-modal-open #cookie-law-info-bar,
html.otp-modal-open .cli-bar,
html.otp-modal-open .cli-modal,
html.otp-modal-open #cliSettingsPopup,
html.otp-modal-open .cky-consent-container,
html.otp-modal-open .cky-btn-revisit-wrapper,
html.otp-modal-open .notification,
html.otp-modal-open .alert.-fixed,
html.otp-modal-open .alert.-small.-fixed {
  display: none !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

/* Happy Points → Redeem via LINE CTA */
.product.redeem-via-line .product-selection,
.product.happy-points-product.redeem-via-line .product-selection {
  flex: 0 0 128px !important;
  min-width: 128px !important;
  max-width: none !important;
  justify-content: flex-end;
  align-items: center;
}

button.select-link.redeem-via-line-btn,
.product .select-link.redeem-via-line-btn {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  width: max-content !important;
  min-width: 112px !important;
  max-width: none !important;
  padding: 8px 12px !important;
  margin: 0;
  border: none !important;
  border-radius: 9999px;
  background: #55bb36 !important;
  color: #fff !important;
  font-size: 0.8rem !important;
  font-weight: 700 !important;
  line-height: 1.2 !important;
  white-space: nowrap !important;
  word-break: keep-all !important;
  text-decoration: none !important;
  text-align: center;
  cursor: pointer;
}

button.select-link.redeem-via-line-btn:hover,
.product .select-link.redeem-via-line-btn:hover {
  background: #4aa62f !important;
  color: #fff !important;
  text-decoration: none !important;
}

/* Ghost Ohio popups: opacity/visibility hidden but pointer-events still active +
   z-index 9999999 block taps on iPhone & Chrome (page looks loaded but "ค้าง").
   ohio-main is dequeued on checkout, so remove/hide every .clb-popup shell. */
body.benjaruk-checkout .clb-popup {
  display: none !important;
  pointer-events: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
  z-index: -1 !important;
}

button.select-link.redeem-via-line-btn:disabled,
.product .select-link.redeem-via-line-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

#guest-login-modal-overlay .payment-modal-footer .payment-confirm-btn {
  width: 100%;
}

#guest-login-modal-overlay .payment-modal-body {
  padding-bottom: 8px;
}

.guest-login-hint {
  margin: 0 0 16px;
  font-size: 14px;
  line-height: 1.5;
  color: #555;
}

.guest-login-otp {
  position: relative;
}

.guest-login-otp input[name="otp-phone"],
.guest-login-otp input[name="otp-code"]:not([hidden]):not(.is-collapsed) {
  width: 100%;
  box-sizing: border-box;
  padding: 14px 16px;
  margin: 0 0 12px;
  border: 1px solid #d8dbe7;
  border-radius: 12px;
  font-size: 16px;
  background: #fff;
}

/* Collapse parked OTP / empty message / invisible reCAPTCHA so they don't leave a white bar */
.guest-login-otp input[name="otp-code"][hidden],
.guest-login-otp input[name="otp-code"].is-collapsed,
.guest-login-otp .new-otp[hidden],
.guest-login-otp .new-otp.is-collapsed,
.guest-login-otp .guest-otp-error[hidden],
.guest-login-otp .guest-otp-error.is-collapsed,
.guest-login-otp .guest-otp-message[hidden],
.guest-login-otp .guest-otp-message.is-collapsed,
.guest-login-otp .guest-otp-message:empty {
  display: none !important;
  margin: 0 !important;
  padding: 0 !important;
  height: 0 !important;
  min-height: 0 !important;
  border: none !important;
  overflow: hidden !important;
}

.guest-login-otp .guest-otp-error:not([hidden]):not(.is-collapsed) {
  display: block;
  color: #c62828;
  margin: 8px 0;
  text-align: center;
  font-size: 14px;
}

.guest-login-otp .new-otp:not([hidden]):not(.is-collapsed) {
  display: block;
  text-align: center;
  margin-top: 8px;
  cursor: pointer;
  font-size: 14px;
  color: #555;
}

#guest-login-modal-overlay .guest-login-recaptcha,
#guest-login-modal-overlay #recaptcha-container {
  position: absolute !important;
  left: -9999px !important;
  top: 0 !important;
  width: 1px !important;
  height: 1px !important;
  margin: 0 !important;
  padding: 0 !important;
  overflow: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
  border: none !important;
  background: transparent !important;
}

/* Native checkout shell (replaces Forminator chrome; WPBakery vc_custom-css still wins if present) */
#forminator-module-226673 .bj-checkout-sr-only {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.forminator-hidden {
  display: none !important;
}
.forminator-row-last {
  display: none;
  position: static;
  width: 98%;
  max-width: 600px;
  margin: 0 auto 5px !important;
  padding-left: 0.5rem;
  padding-right: 0.5rem;
  border-radius: 16px;
  background-color: #F5F7FF;
  background-image: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  box-shadow: 0 -6px 20px rgba(22, 21, 25, 0.12);
}
.forminator-row-last.forminator-row-visible {
  display: flex !important;
  flex-direction: column;
  position: static;
}
.forminator-row-last.forminator-row-visible.is-sticky {
  position: fixed;
  left: 50%;
  bottom: 2px;
  transform: translateX(-50%);
  z-index: 1000;
}
.forminator-row-last > div {
  align-self: center;
}
.forminator-row-last .short-summary,
.short-summary {
  display: flex;
  justify-content: space-between;
  font-size: 1rem;
}

/* Restore cart bar — static + opaque first, .is-sticky becomes fixed after window.load */
.bj-cart-bar {
  position: static;
  box-sizing: border-box;
  width: 100%;
  max-width: 600px;
  margin: 12px auto 8px;
  padding: 8px 10px;
  border-radius: 16px;
  background-color: #F5F7FF;
  background-image: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  box-shadow: 0 -4px 16px rgba(22, 21, 25, 0.08);
}
.bj-cart-bar.is-sticky {
  position: fixed;
  left: 50%;
  right: auto;
  bottom: 2px;
  transform: translateX(-50%);
  width: 98%;
  margin: 0 auto 5px;
  z-index: 1000;
  box-shadow: 0 -6px 20px rgba(22, 21, 25, 0.12);
}
.bj-cart-bar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.bj-cart-bar-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.bj-cart-bar-thumb {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  overflow: hidden;
  background: #e1e8ff;
}
.bj-cart-bar-thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.bj-cart-bar-thumb-fallback {
  display: block;
  width: 100%;
  height: 100%;
  background: #d4def8;
}
.bj-cart-bar-label {
  font-size: 0.9rem;
  color: #161519;
  white-space: nowrap;
}
.bj-cart-bar-continue {
  flex-shrink: 0;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  color: #fff;
  background: #3829E1;
  border: none;
  border-radius: 50px;
  padding: 8px 14px;
  cursor: pointer;
}
body.benjaruk-summary-open .bj-cart-bar,
body:has(#summary-details.active) .bj-cart-bar {
  display: none !important;
}
.forminator-button-submit,
.happy-points-submit > button.send-otp {
  font-size: 1rem !important;
  color: #fff !important;
  border: none !important;
  cursor: pointer !important;
  background-color: #3829E1 !important;
  border-radius: 50px !important;
  padding: 12px 25px !important;
  max-width: 640px !important;
  width: 100%;
  font-family: inherit;
}

