/* ============================================================
   WooCommerce Phone Landing Page — Frontend Styles
   ============================================================ */

/* ── CSS VARIABLES ──────────────────────────────────────────── */
:root {
  --wpl-orange:   #FF6B00;
  --wpl-orange2:  #FF8C00;
  --wpl-red:      #E63946;
  --wpl-dark:     #1A1A1A;
  --wpl-gray:     #F5F5F5;
  --wpl-border:   #E0E0E0;
  --wpl-text:     #333333;
  --wpl-muted:    #888888;
  --wpl-white:    #FFFFFF;
  --wpl-success:  #2ECC71;
  --wpl-radius:   12px;
  --wpl-font:     'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  --wpl-font-ar:  'Amiri', 'Arial', sans-serif;
}

/* ── WRAPPER ────────────────────────────────────────────────── */
.wpl-wrapper {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 40px 20px;
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  min-height: 100vh;
  font-family: var(--wpl-font);
}
.wpl-wrapper.wpl-rtl {
  direction: rtl;
  font-family: var(--wpl-font-ar);
}

/* ── PHONE FRAME ────────────────────────────────────────────── */
.wpl-phone {
  width: 390px;
  max-width: 100%;
  background: var(--wpl-white);
  border-radius: 40px;
  box-shadow:
    0 0 0 10px #1A1A1A,
    0 0 0 12px #333,
    0 30px 80px rgba(0,0,0,0.4),
    0 10px 30px rgba(0,0,0,0.3);
  overflow: hidden;
  position: relative;
  display: flex;
  flex-direction: column;
  max-height: 820px;
}

/* Notch/Dynamic Island */
.wpl-phone::before {
  content: '';
  display: block;
  width: 120px;
  height: 30px;
  background: #1A1A1A;
  border-radius: 0 0 20px 20px;
  margin: 0 auto;
  position: relative;
  z-index: 10;
}

/* ── STATUS BAR ─────────────────────────────────────────────── */
.wpl-status-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 4px 20px 8px;
  font-size: 11px;
  font-weight: 700;
  background: var(--wpl-white);
  color: var(--wpl-dark);
}
.wpl-status-icons {
  display: flex;
  gap: 6px;
  align-items: center;
  font-size: 11px;
}
.wpl-battery { font-size: 10px; }

/* ── NAVBAR ─────────────────────────────────────────────────── */
.wpl-navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  background: var(--wpl-white);
  border-bottom: 1px solid var(--wpl-border);
}
.wpl-nav-icon {
  background: none;
  border: none;
  font-size: 20px;
  cursor: pointer;
  padding: 4px;
  color: var(--wpl-dark);
}
.wpl-brand {
  text-align: center;
  line-height: 1;
}
.wpl-brand-marka {
  display: block;
  font-size: 18px;
  font-weight: 900;
  color: var(--wpl-red);
  letter-spacing: 2px;
}
.wpl-brand-store {
  display: block;
  font-size: 14px;
  font-weight: 800;
  color: var(--wpl-dark);
  letter-spacing: 4px;
}
.wpl-nav-right {
  display: flex;
  align-items: center;
  gap: 8px;
}
.wpl-lang-btn {
  background: none;
  border: none;
  font-size: 12px;
  color: var(--wpl-text);
  cursor: pointer;
  font-family: var(--wpl-font-ar);
}
.wpl-cart-wrap {
  position: relative;
  cursor: pointer;
}
.wpl-cart-icon { font-size: 22px; }
.wpl-cart-badge {
  position: absolute;
  top: -4px; right: -4px;
  background: var(--wpl-orange);
  color: var(--wpl-white);
  font-size: 9px;
  font-weight: 700;
  width: 16px; height: 16px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ── SCROLL AREA ────────────────────────────────────────────── */
.wpl-scroll-area {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  scroll-behavior: smooth;
  position: relative;
}
.wpl-scroll-area::-webkit-scrollbar { width: 3px; }
.wpl-scroll-area::-webkit-scrollbar-thumb { background: var(--wpl-border); border-radius: 10px; }

/* ── GALLERY ────────────────────────────────────────────────── */
.wpl-gallery {
  position: relative;
  background: #fafafa;
  border-bottom: 1px solid var(--wpl-border);
}
.wpl-gallery-track {
  display: flex;
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}
.wpl-gallery-slide {
  min-width: 100%;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.wpl-gallery-slide.active { display: flex; }
.wpl-gallery-slide img {
  max-width: 100%;
  max-height: 280px;
  object-fit: contain;
  border-radius: 8px;
}
.wpl-thumbs {
  display: flex;
  gap: 8px;
  padding: 10px 16px;
  overflow-x: auto;
  scrollbar-width: none;
}
.wpl-thumbs::-webkit-scrollbar { display: none; }
.wpl-thumb {
  width: 60px;
  height: 60px;
  border-radius: 8px;
  border: 2px solid var(--wpl-border);
  overflow: hidden;
  cursor: pointer;
  flex-shrink: 0;
  transition: border-color 0.2s;
}
.wpl-thumb.active,
.wpl-thumb:hover { border-color: var(--wpl-orange); }
.wpl-thumb img { width: 100%; height: 100%; object-fit: cover; }
.wpl-breadcrumb {
  padding: 8px 16px;
  font-size: 11px;
  color: var(--wpl-muted);
  border-top: 1px solid var(--wpl-border);
}
.wpl-breadcrumb span + span::before { content: ' / '; }

/* ── PRODUCT INFO ───────────────────────────────────────────── */
.wpl-product-info {
  padding: 16px 16px 8px;
}
.wpl-brand-logo {
  font-size: 20px;
  font-weight: 900;
  letter-spacing: 3px;
  color: var(--wpl-dark);
  margin-bottom: 6px;
}
.wpl-product-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--wpl-dark);
  margin: 0 0 8px;
  line-height: 1.3;
}
.wpl-product-price {
  font-size: 22px;
  font-weight: 900;
  color: var(--wpl-orange);
}
.wpl-product-price .woocommerce-Price-amount { color: var(--wpl-orange); }

/* ── ORDER FORM ─────────────────────────────────────────────── */
.wpl-order-form {
  padding: 12px 16px 20px;
}
.wpl-form-hint {
  text-align: center;
  font-size: 13px;
  color: var(--wpl-muted);
  margin: 0 0 14px;
}
.wpl-bag-icon { font-size: 20px; vertical-align: middle; margin-left: 4px; }

/* Size options */
.wpl-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--wpl-muted);
  margin-bottom: 8px;
  text-align: right;
}
.wpl-field-row { margin-bottom: 14px; }
.wpl-size-options {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.wpl-size-btn {
  padding: 8px 16px;
  border: 2px solid var(--wpl-border);
  background: var(--wpl-white);
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  color: var(--wpl-dark);
}
.wpl-size-btn.active,
.wpl-size-btn:hover {
  border-color: var(--wpl-orange);
  background: var(--wpl-orange);
  color: var(--wpl-white);
}

/* Input fields */
.wpl-field {
  display: flex;
  align-items: center;
  border: 1px solid var(--wpl-border);
  border-radius: 10px;
  margin-bottom: 10px;
  background: var(--wpl-white);
  overflow: hidden;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.wpl-field:focus-within {
  border-color: var(--wpl-orange);
  box-shadow: 0 0 0 3px rgba(255,107,0,0.1);
}
.wpl-field-icon {
  padding: 12px;
  font-size: 16px;
  background: var(--wpl-gray);
  border-left: 1px solid var(--wpl-border);
  flex-shrink: 0;
  color: var(--wpl-muted);
}
.wpl-rtl .wpl-field-icon {
  border-left: none;
  border-right: 1px solid var(--wpl-border);
}
.wpl-input {
  flex: 1;
  padding: 12px 14px;
  border: none;
  outline: none;
  font-size: 14px;
  background: transparent;
  color: var(--wpl-dark);
  text-align: right;
  font-family: inherit;
}
.wpl-input::placeholder { color: var(--wpl-muted); }
.wpl-select-field { position: relative; }
.wpl-select-field select.wpl-input {
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  padding-left: 30px;
}
.wpl-chevron {
  position: absolute;
  left: 12px;
  font-size: 12px;
  color: var(--wpl-muted);
  pointer-events: none;
}
.wpl-rtl .wpl-chevron { left: auto; right: 12px; }

/* Coupon */
.wpl-coupon-row {
  margin: 4px 0 10px;
  font-size: 12px;
  color: var(--wpl-muted);
  text-align: center;
}
.wpl-coupon-toggle {
  background: none;
  border: none;
  color: var(--wpl-orange);
  font-size: 12px;
  cursor: pointer;
  text-decoration: underline;
  padding: 0;
  font-family: inherit;
}
.wpl-coupon-input {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
}
.wpl-apply-coupon {
  padding: 8px 14px;
  background: var(--wpl-orange);
  color: var(--wpl-white);
  border: none;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.2s;
}
.wpl-apply-coupon:hover { background: var(--wpl-orange2); }
.wpl-coupon-msg {
  font-size: 12px;
  margin: 0 0 10px;
  padding: 8px 12px;
  border-radius: 8px;
  text-align: center;
}
.wpl-coupon-msg.success { background: #d4edda; color: #155724; }
.wpl-coupon-msg.error   { background: #f8d7da; color: #721c24; }

/* Delivery row */
.wpl-delivery-row {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  color: var(--wpl-muted);
  margin-bottom: 10px;
  padding: 8px 12px;
  background: var(--wpl-gray);
  border-radius: 8px;
}
.wpl-delivery-note { font-style: italic; }

/* Quantity */
.wpl-qty-row {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0;
  margin-bottom: 14px;
}
.wpl-qty-btn {
  width: 42px;
  height: 42px;
  background: var(--wpl-gray);
  border: 1px solid var(--wpl-border);
  font-size: 20px;
  font-weight: 300;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
  color: var(--wpl-dark);
}
.wpl-qty-minus { border-radius: 8px 0 0 8px; }
.wpl-qty-plus  { border-radius: 0 8px 8px 0; }
.wpl-qty-btn:hover { background: var(--wpl-border); }
.wpl-qty-val {
  width: 50px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 700;
  border-top: 1px solid var(--wpl-border);
  border-bottom: 1px solid var(--wpl-border);
  color: var(--wpl-dark);
}

/* CTA Buttons */
.wpl-btn-order,
.wpl-btn-cart {
  display: block;
  width: 100%;
  padding: 15px;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 800;
  cursor: pointer;
  border: none;
  margin-bottom: 10px;
  transition: all 0.2s;
  font-family: inherit;
  letter-spacing: 0.5px;
}
.wpl-btn-order {
  background: linear-gradient(135deg, var(--wpl-orange), var(--wpl-orange2));
  color: var(--wpl-white);
  box-shadow: 0 4px 15px rgba(255,107,0,0.4);
}
.wpl-btn-order:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(255,107,0,0.5);
}
.wpl-btn-order:active { transform: translateY(0); }
.wpl-btn-cart {
  background: var(--wpl-white);
  color: var(--wpl-orange);
  border: 2px solid var(--wpl-orange);
}
.wpl-btn-cart:hover { background: rgba(255,107,0,0.05); }

/* Loading state */
.wpl-btn-order.loading,
.wpl-btn-cart.loading {
  opacity: 0.7;
  pointer-events: none;
}

/* ── ORDER SUMMARY ──────────────────────────────────────────── */
.wpl-summary {
  border: 1px solid var(--wpl-border);
  border-radius: 12px;
  margin-top: 12px;
  overflow: hidden;
}
.wpl-summary-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  background: var(--wpl-white);
  color: var(--wpl-dark);
  user-select: none;
}
.wpl-summary-thumb {
  width: 36px;
  height: 36px;
  border-radius: 6px;
  object-fit: cover;
}
.wpl-summary-toggle {
  transition: transform 0.25s;
  font-size: 12px;
  color: var(--wpl-muted);
}
.wpl-summary.open .wpl-summary-toggle { transform: rotate(180deg); }
.wpl-summary-body {
  display: none;
  border-top: 1px solid var(--wpl-border);
  padding: 12px 14px;
  background: var(--wpl-gray);
}
.wpl-summary.open .wpl-summary-body { display: block; }
.wpl-summary-row {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  color: var(--wpl-text);
  margin-bottom: 8px;
}
.wpl-summary-row:last-child { margin-bottom: 0; }
.wpl-summary-total {
  border-top: 1px solid var(--wpl-border);
  padding-top: 8px;
  margin-top: 4px;
  font-size: 14px;
}
.wpl-summary-total-val {
  color: var(--wpl-orange);
  font-size: 16px;
}

/* ── DESCRIPTION ────────────────────────────────────────────── */
.wpl-description {
  margin-top: 14px;
  font-size: 13px;
  line-height: 1.7;
  color: var(--wpl-text);
  text-align: center;
  padding: 12px;
  background: var(--wpl-gray);
  border-radius: 10px;
}

/* ── BOTTOM NAV ─────────────────────────────────────────────── */
.wpl-bottom-nav {
  display: flex;
  border-top: 1px solid var(--wpl-border);
  background: var(--wpl-white);
  padding: 4px 0 8px;
}
.wpl-bnav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 20px;
  padding: 6px 0;
  color: var(--wpl-muted);
  position: relative;
  transition: color 0.2s;
  font-family: inherit;
}
.wpl-bnav-item span {
  font-size: 10px;
  font-weight: 600;
}
.wpl-bnav-item.active { color: var(--wpl-orange); }
.wpl-bnav-badge {
  position: absolute;
  top: 4px; right: 20px;
  background: var(--wpl-orange);
  color: var(--wpl-white);
  font-size: 9px;
  font-weight: 700;
  width: 16px; height: 16px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ── SUCCESS OVERLAY ────────────────────────────────────────── */
.wpl-success-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  animation: wplFadeIn 0.3s ease;
}
.wpl-success-box {
  background: var(--wpl-white);
  border-radius: 20px;
  padding: 32px 24px;
  text-align: center;
  max-width: 280px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.3);
}
.wpl-success-icon { font-size: 48px; margin-bottom: 12px; }
.wpl-success-box h2 {
  font-size: 20px;
  font-weight: 800;
  color: var(--wpl-dark);
  margin: 0 0 8px;
}
.wpl-success-box p {
  font-size: 14px;
  color: var(--wpl-muted);
  margin: 0 0 16px;
}
.wpl-success-close {
  background: var(--wpl-orange);
  color: var(--wpl-white);
  border: none;
  border-radius: 10px;
  padding: 10px 24px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
}

/* ── ANIMATIONS ─────────────────────────────────────────────── */
@keyframes wplFadeIn {
  from { opacity: 0; transform: scale(0.9); }
  to   { opacity: 1; transform: scale(1); }
}
@keyframes wplPulse {
  0%, 100% { box-shadow: 0 4px 15px rgba(255,107,0,0.4); }
  50%       { box-shadow: 0 4px 25px rgba(255,107,0,0.7); }
}
.wpl-btn-order { animation: wplPulse 2s ease-in-out infinite; }
.wpl-btn-order:hover { animation: none; }

/* ── ERROR ──────────────────────────────────────────────────── */
.wpl-error {
  color: var(--wpl-red);
  padding: 10px 16px;
  background: #fdecea;
  border-radius: 8px;
  font-size: 14px;
}

/* ── RESPONSIVE ─────────────────────────────────────────────── */
@media (max-width: 480px) {
  .wpl-wrapper { padding: 0; background: var(--wpl-white); }
  .wpl-phone {
    border-radius: 0;
    box-shadow: none;
    max-height: 100vh;
  }
  .wpl-phone::before { display: none; }
}
