/**
 * Egypt Manual Payments - Public Stylesheet
 * Custom designed for Shaheen Store Plant (shaheenstoreplant.com) & Astra Theme
 * Palette: Brand Emerald (#106A50), White (#FFFFFF), Subtle Green Accents (#F0F8F5, #D1FAE5)
 * RTL Native & Mobile-First
 */

:root {
  --emp-primary: #106A50;
  --emp-primary-dark: #0d5641;
  --emp-primary-light: #f0f8f5;
  --emp-primary-subtle: #e6f4ef;
  --emp-primary-border: #bfe5d9;
  --emp-primary-shadow: rgba(16, 106, 80, 0.12);
  --emp-white: #ffffff;
  --emp-page-bg: #f8fafc;
  --emp-gray-bg: #f8fafc;
  --emp-gray-border: #e2e8f0;
  --emp-text-dark: #0f172a;
  --emp-text-muted: #475569;
  --emp-success: #106A50;
  --emp-success-light: #eaf5f2;
  --emp-whatsapp: #25D366;
  --emp-whatsapp-hover: #1eb857;
  --emp-radius: 12px;
  --emp-radius-sm: 8px;
}

/* ==========================================================================
   Astra & WooCommerce Checkout Integration
   ========================================================================== */

/* Payment methods container */
.woocommerce-checkout #payment ul.payment_methods {
  border-radius: var(--emp-radius);
  padding: 0;
  margin: 0 0 20px 0;
}

/* Individual payment method card */
.woocommerce-checkout #payment ul.payment_methods li.payment_method_emp_vodafone_cash,
.woocommerce-checkout #payment ul.payment_methods li.payment_method_emp_instapay {
  background: var(--emp-white);
  border: 1.5px solid var(--emp-gray-border);
  border-radius: var(--emp-radius);
  margin-bottom: 12px;
  padding: 14px 18px;
  transition: all 0.25s ease-in-out;
  position: relative;
  overflow: visible;
}

.woocommerce-checkout #payment ul.payment_methods li.payment_method_emp_vodafone_cash:hover,
.woocommerce-checkout #payment ul.payment_methods li.payment_method_emp_instapay:hover {
  border-color: var(--emp-primary-border);
  background: #fafdfc;
}

/* Selected state highlight */
.woocommerce-checkout #payment ul.payment_methods li.payment_method_emp_vodafone_cash:has(input:checked),
.woocommerce-checkout #payment ul.payment_methods li.payment_method_emp_instapay:has(input:checked),
.woocommerce-checkout #payment ul.payment_methods li.payment_method_emp_vodafone_cash.selected,
.woocommerce-checkout #payment ul.payment_methods li.payment_method_emp_instapay.selected {
  border-color: var(--emp-primary) !important;
  background: var(--emp-white) !important;
  box-shadow: 0 4px 18px var(--emp-primary-shadow) !important;
}

/* Radio button styling */
.woocommerce-checkout #payment ul.payment_methods li.payment_method_emp_vodafone_cash input[type="radio"],
.woocommerce-checkout #payment ul.payment_methods li.payment_method_emp_instapay input[type="radio"] {
  accent-color: var(--emp-primary);
  width: 18px;
  height: 18px;
  margin: 0 0 0 10px;
  vertical-align: middle;
  cursor: pointer;
}

/* Payment Method Label */
.woocommerce-checkout #payment ul.payment_methods li.payment_method_emp_vodafone_cash > label,
.woocommerce-checkout #payment ul.payment_methods li.payment_method_emp_instapay > label {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  font-size: 15px !important;
  font-weight: 700 !important;
  color: var(--emp-text-dark) !important;
  cursor: pointer !important;
  margin: 0 !important;
  width: calc(100% - 28px) !important;
  display: inline-flex !important;
  vertical-align: middle !important;
}

/* Payment Gateway Logos */
.woocommerce-checkout #payment ul.payment_methods li img[src*="vodafone-cash"],
.woocommerce-checkout #payment ul.payment_methods li img[src*="instapay"],
.woocommerce-checkout #payment ul.payment_methods li img[src*="egypt-manual-payments"] {
  max-height: 32px !important;
  height: 32px !important;
  width: auto !important;
  border-radius: 6px !important;
  vertical-align: middle !important;
  margin-inline-start: 12px !important;
  border: 1px solid #e2e8f0 !important;
  background: #ffffff !important;
  padding: 0 !important;
  display: inline-block !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05) !important;
  transition: transform 0.2s ease !important;
  object-fit: contain !important;
}

.woocommerce-checkout #payment ul.payment_methods li:hover img[src*="vodafone-cash"],
.woocommerce-checkout #payment ul.payment_methods li:hover img[src*="instapay"] {
  transform: scale(1.03);
}

/* ==========================================================================
   Payment Details Box (Inside Checkout)
   ========================================================================== */

.emp-payment-box {
  background: #ffffff;
  border: 1.5px solid var(--emp-primary-border);
  border-radius: var(--emp-radius-sm);
  padding: 18px 20px;
  margin: 14px 0 6px 0;
  box-shadow: 0 4px 14px var(--emp-primary-shadow);
  direction: rtl;
  text-align: right;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Cairo", "Tajawal", Tahoma, sans-serif;
  box-sizing: border-box;
  position: relative;
  overflow: hidden;
}

/* Top brand highlight stripe */
.emp-payment-box::before {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  height: 3.5px;
  background: var(--emp-primary);
}

/* Header inside Payment Box */
.emp-box-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px dashed var(--emp-primary-border);
}

.emp-box-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--emp-primary);
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
}

.emp-box-title svg {
  width: 18px;
  height: 18px;
  stroke: var(--emp-primary);
  fill: none;
  flex-shrink: 0;
}

.emp-box-badge {
  background: var(--emp-primary-light);
  color: var(--emp-primary);
  border: 1px solid var(--emp-primary-border);
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
}

/* Account Number Display Card */
.emp-account-card {
  background: var(--emp-primary-light);
  border: 1.5px solid var(--emp-primary-border);
  border-radius: var(--emp-radius-sm);
  padding: 14px 16px;
  margin: 12px 0 14px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.emp-account-info {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.emp-account-label {
  font-size: 12px;
  color: var(--emp-text-muted);
  font-weight: 600;
}

.emp-account-val {
  font-size: 20px;
  font-weight: 800;
  color: var(--emp-primary);
  letter-spacing: 1px;
  direction: ltr;
  text-align: right;
  user-select: all;
  font-family: Consolas, "Segoe UI Mono", monospace, sans-serif;
}

/* Interactive Copy Button */
.emp-btn-copy {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--emp-white);
  color: var(--emp-primary);
  border: 1.5px solid var(--emp-primary);
  padding: 8px 16px;
  border-radius: var(--emp-radius-sm);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  outline: none;
  font-family: inherit;
  box-shadow: 0 2px 6px rgba(16, 106, 80, 0.08);
}

.emp-btn-copy:hover {
  background: var(--emp-primary);
  color: var(--emp-white);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px var(--emp-primary-shadow);
}

.emp-btn-copy svg {
  width: 15px;
  height: 15px;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
  transition: transform 0.2s ease;
}

.emp-btn-copy.copied {
  background: #10B981 !important;
  border-color: #10B981 !important;
  color: var(--emp-white) !important;
}

/* ==========================================================================
   InstaPay Direct Pay Now Button & Action Styling
   ========================================================================== */
.emp-instapay-pay-action {
  margin: 14px 0;
  text-align: center;
}

.emp-btn-instapay-pay {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  max-width: 380px;
  background: linear-gradient(135deg, #7C3AED 0%, #5B21B6 100%);
  color: #ffffff !important;
  font-size: 15.5px;
  font-weight: 800;
  padding: 12px 24px;
  border-radius: var(--emp-radius-sm);
  text-decoration: none !important;
  box-shadow: 0 4px 14px rgba(124, 58, 237, 0.32);
  transition: all 0.25s ease;
  border: 1.5px solid #8B5CF6;
  box-sizing: border-box;
  cursor: pointer;
  font-family: inherit;
}

.emp-btn-instapay-pay:hover {
  background: linear-gradient(135deg, #6D28D9 0%, #4C1D95 100%);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(124, 58, 237, 0.45);
  color: #ffffff !important;
}

.emp-btn-instapay-pay svg.emp-icon-bolt {
  fill: #FDE047;
  flex-shrink: 0;
}

.emp-btn-instapay-pay svg.emp-icon-external {
  stroke: #ffffff;
  flex-shrink: 0;
}

.emp-btn-hint {
  display: block;
  font-size: 12px;
  color: var(--emp-text-muted);
  margin-top: 6px;
  font-weight: 600;
}

/* Thank You page InstaPay Direct Action */
.emp-instapay-thankyou-action {
  margin-top: 20px;
  margin-bottom: 20px;
  padding: 18px 20px;
  background: #FAF5FF;
  border: 1.5px solid #DDD6FE;
  border-radius: var(--emp-radius);
  text-align: center;
}

.emp-action-step {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 14.5px;
  color: #5B21B6;
  margin: 0 0 14px 0;
}

.emp-step-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  background: #7C3AED;
  color: #FFFFFF;
  border-radius: 50%;
  font-size: 13px;
  font-weight: 800;
  flex-shrink: 0;
}

/* Instructions / Note text */
.emp-box-instructions {
  font-size: 13.5px;
  line-height: 1.65;
  color: var(--emp-text-dark);
  margin: 10px 0 0 0;
}

.emp-box-instructions p {
  margin: 0 0 8px 0;
}

.emp-box-instructions p:last-child {
  margin-bottom: 0;
}

.emp-notice-box {
  background: var(--emp-primary-light);
  border-inline-start: 3.5px solid var(--emp-primary);
  border: 1px solid var(--emp-primary-border);
  border-inline-start-width: 3.5px;
  padding: 10px 14px;
  border-radius: 6px;
  font-size: 13px;
  color: var(--emp-primary-dark);
  margin-top: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  line-height: 1.5;
}

.emp-notice-box svg {
  stroke: var(--emp-primary);
  flex-shrink: 0;
}

/* ==========================================================================
   Thank You / Order Confirmation Page
   ========================================================================== */

body.emp-order-received-page .woocommerce-order {
  width: 100%;
  max-width: 1100px;
  margin-inline: auto;
  padding-block: clamp(20px, 3.5vw, 48px);
}

.emp-thankyou-card {
  background: var(--emp-white);
  border: 1px solid var(--emp-gray-border);
  border-radius: var(--emp-radius);
  padding: clamp(20px, 3vw, 32px);
  margin: 0 0 28px;
  box-shadow: 0 10px 30px rgba(16, 106, 80, 0.06);
  direction: rtl;
  text-align: right;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Cairo", "Tajawal", Tahoma, sans-serif;
  position: relative;
  overflow: hidden;
}

.emp-thankyou-card::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  right: 0;
  width: 6px;
  background: var(--emp-primary);
}

.emp-thankyou-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1.5px solid #f0f8f5;
  padding-bottom: 16px;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 12px;
}

.emp-thankyou-title {
  font-size: clamp(18px, 2vw, 22px);
  font-weight: 800;
  color: var(--emp-primary);
  margin: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.emp-thankyou-title svg {
  width: 28px;
  height: 28px;
  padding: 5px;
  border-radius: 50%;
  background: var(--emp-primary-light);
  color: var(--emp-primary);
  box-sizing: border-box;
}

.emp-thankyou-status-pill {
  background: var(--emp-primary-light);
  color: var(--emp-primary);
  border: 1px solid var(--emp-primary-border);
  padding: 6px 14px;
  border-radius: 30px;
  font-size: 13px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.emp-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #d97706;
  display: inline-block;
  animation: emp-pulse 2s infinite;
}

@keyframes emp-pulse {
  0% { transform: scale(0.95); opacity: 0.8; }
  50% { transform: scale(1.25); opacity: 1; }
  100% { transform: scale(0.95); opacity: 0.8; }
}

.emp-thankyou-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}

.emp-thankyou-item {
  background: var(--emp-gray-bg);
  border: 1px solid var(--emp-gray-border);
  border-radius: var(--emp-radius-sm);
  padding: 16px;
  min-width: 0;
}

.emp-thankyou-item-title {
  font-size: 12.5px;
  color: var(--emp-text-muted);
  margin-bottom: 6px;
  font-weight: 600;
}

.emp-thankyou-item-value {
  font-size: 17px;
  font-weight: 800;
  color: var(--emp-text-dark);
  overflow-wrap: anywhere;
}

.emp-thankyou-item-value.brand-primary {
  color: var(--emp-primary);
  font-size: 20px;
}

.emp-thankyou-account .emp-thankyou-item-value {
  direction: ltr;
  text-align: right;
  font-family: Consolas, "Segoe UI Mono", monospace;
  color: var(--emp-primary);
}

.emp-thankyou-account .emp-btn-copy {
  margin-top: 10px;
}

.emp-thankyou-card .emp-box-instructions {
  margin: 0;
  padding: 14px 16px;
  border-inline-start: 3.5px solid var(--emp-primary);
  border: 1px solid var(--emp-primary-border);
  border-inline-start-width: 3.5px;
  border-radius: var(--emp-radius-sm);
  background: var(--emp-primary-light);
  color: var(--emp-primary-dark);
}

/* WhatsApp Action Box & Button */
.emp-whatsapp-action-wrapper {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px dashed var(--emp-primary-border);
  text-align: center;
}

.emp-whatsapp-instruction {
  font-size: 14.5px;
  color: var(--emp-text-dark);
  font-weight: 700;
  margin-bottom: 14px;
}

.emp-btn-whatsapp {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: var(--emp-whatsapp);
  color: #ffffff !important;
  font-size: 16px;
  font-weight: 800;
  padding: 14px 30px;
  border-radius: 40px;
  text-decoration: none !important;
  box-shadow: 0 4px 14px rgba(37, 211, 102, 0.35);
  transition: all 0.25s ease;
  border: 2px solid #20BD5A;
  box-sizing: border-box;
}

.emp-btn-whatsapp:hover {
  background: var(--emp-whatsapp-hover);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(37, 211, 102, 0.45);
  color: #ffffff !important;
}

.emp-btn-whatsapp svg {
  width: 24px;
  height: 24px;
  fill: #ffffff;
  flex-shrink: 0;
}

/* Safe Theme-independent order summary */
.emp-order-summary {
  margin-top: 28px;
  padding: clamp(20px, 3vw, 32px);
  border: 1px solid var(--emp-gray-border);
  border-radius: var(--emp-radius);
  background: var(--emp-white);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.04);
  direction: rtl;
  text-align: right;
}

.emp-section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--emp-gray-border);
}

.emp-section-eyebrow {
  display: block;
  margin-bottom: 4px;
  color: var(--emp-primary);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.05em;
}

.emp-section-heading h2 {
  margin: 0;
  color: var(--emp-text-dark);
  font-size: clamp(19px, 2vw, 24px);
}

.emp-order-number {
  flex: 0 0 auto;
  padding: 6px 14px;
  border: 1px solid var(--emp-primary-border);
  border-radius: 8px;
  background: var(--emp-primary-light);
  color: var(--emp-primary);
  font-family: Consolas, "Segoe UI Mono", monospace;
  font-weight: 800;
}

.emp-order-items {
  display: grid;
  gap: 10px;
}

.emp-order-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 14px 16px;
  border-radius: var(--emp-radius-sm);
  background: var(--emp-gray-bg);
}

.emp-order-line-name strong {
  color: var(--emp-text-dark);
  font-size: 15px;
}

.emp-order-line-name span {
  color: var(--emp-text-muted);
  font-size: 12px;
}

.emp-order-line-total {
  flex: 0 0 auto;
  color: var(--emp-text-dark);
  font-weight: 800;
}

.emp-order-totals {
  width: min(100%, 480px);
  margin: 20px 0 0 auto;
  padding: 16px 18px;
  border: 1px solid var(--emp-gray-border);
  border-radius: var(--emp-radius-sm);
}

.emp-total-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 8px 0;
}

.emp-total-row + .emp-total-row {
  border-top: 1px dashed var(--emp-gray-border);
}

.emp-total-row dt {
  color: var(--emp-text-muted);
  font-weight: 600;
}

.emp-total-row dd {
  color: var(--emp-text-dark);
  font-weight: 800;
}

.emp-total-row:last-child dd {
  color: var(--emp-primary);
  font-size: 18px;
}

.emp-customer-addresses {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
  margin-top: 20px;
}

.emp-address-card {
  padding: 16px;
  border: 1px solid var(--emp-gray-border);
  border-radius: var(--emp-radius-sm);
  background: var(--emp-white);
}

.emp-address-card h3 {
  margin: 0 0 8px;
  color: var(--emp-primary);
  font-size: 14px;
}

.emp-address-card address,
.emp-address-card p {
  margin: 0;
  color: var(--emp-text-muted);
  font-style: normal;
  line-height: 1.7;
}

/* ==========================================================================
   Mobile Responsiveness
   ========================================================================== */

@media (max-width: 600px) {
  .woocommerce-checkout #payment ul.payment_methods li.payment_method_emp_vodafone_cash,
  .woocommerce-checkout #payment ul.payment_methods li.payment_method_emp_instapay {
    padding: 12px 14px;
  }

  .woocommerce-checkout #payment ul.payment_methods li.payment_method_emp_vodafone_cash > label,
  .woocommerce-checkout #payment ul.payment_methods li.payment_method_emp_instapay > label {
    font-size: 14px !important;
  }

  .emp-payment-box,
  .emp-thankyou-card {
    padding: 14px;
  }
  
  .emp-account-card {
    flex-direction: column;
    align-items: flex-start;
  }

  .emp-account-val {
    font-size: 18px;
  }

  .emp-btn-copy {
    width: 100%;
    justify-content: center;
  }
  
  .emp-btn-whatsapp {
    width: 100%;
    padding: 13px 20px;
    font-size: 15px;
  }

  .emp-thankyou-header,
  .emp-section-heading,
  .emp-order-line {
    align-items: flex-start;
    flex-direction: column;
  }

  .emp-thankyou-status-pill {
    width: 100%;
    justify-content: center;
  }

  .emp-thankyou-grid {
    grid-template-columns: 1fr;
  }

  .emp-order-line-total {
    align-self: flex-end;
  }
}

@media (prefers-reduced-motion: reduce) {
  .emp-status-dot {
    animation: none;
  }

  .emp-btn-copy,
  .emp-btn-whatsapp {
    transition: none;
  }
}
