/* ===================================
   Easy 2 Learn - Cart Page Styles
   cart.css
   =================================== */

@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@300;400;600;700;800;900&family=Tajawal:wght@300;400;500;700;800;900&display=swap');

:root {
  --primary: #00B4A6;
  --primary-dark: #008F84;
  --primary-light: #E0F7F5;
  --secondary: #F5A623;
  --secondary-dark: #D4891A;
  --secondary-light: #FFF3DC;
  --accent-red: #E84040;
  --accent-green: #2ECC71;
  --dark: #1A2340;
  --dark-alt: #2D3A5F;
  --gray: #6B7A99;
  --light-gray: #F4F6FB;
  --border: #E8ECF5;
  --white: #FFFFFF;
  --font-main: 'Cairo', sans-serif;
  --font-display: 'Tajawal', sans-serif;
  --shadow-sm: 0 2px 12px rgba(0,0,0,0.07);
  --shadow-md: 0 8px 30px rgba(0,0,0,0.11);
  --shadow-lg: 0 20px 60px rgba(0,0,0,0.14);
  --shadow-glow: 0 8px 32px rgba(0,180,166,0.22);
  --radius-sm: 12px;
  --radius-md: 20px;
  --radius-lg: 28px;
  --transition: all 0.3s cubic-bezier(0.4,0,0.2,1);
  --transition-bounce: all 0.4s cubic-bezier(0.34,1.56,0.64,1);
}

*, *::before, *::after { margin:0; padding:0; box-sizing:border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-main);
  direction: rtl;
  background: #F0F4F8;
  color: var(--dark);
  min-height: 100vh;
  overflow-x: hidden;
}

a { text-decoration: none; color: inherit; }
ul { list-style: none; }
img { max-width: 100%; display: block; }
button { cursor: pointer; border: none; font-family: var(--font-main); }

/* ── Navbar ── */
.navbar {
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(18px);
  border-bottom: 1px solid rgba(0,180,166,0.1);
  position: sticky; top: 0; z-index: 100;
  box-shadow: var(--shadow-sm);
}
.navbar-inner {
  max-width: 1200px; margin: 0 auto;
  padding: 0 24px;
  height: 72px;
  display: flex; align-items: center; justify-content: space-between;
}
.logo { display: flex; align-items: center; gap: 12px; }
.logo-cube {
  width: 46px; height: 46px;
  background: linear-gradient(135deg,#00B4A6,#F5A623);
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 24px; flex-shrink: 0;
}
.logo-text .name { font-family: var(--font-display); font-weight: 900; font-size: 20px; color: var(--dark); }
.logo-text .name span { color: var(--primary); }
.logo-text .tagline { font-size: 11px; color: var(--gray); }

.back-btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 20px; border-radius: 50px;
  background: var(--light-gray); color: var(--dark-alt);
  font-size: 14px; font-weight: 700;
  transition: var(--transition-bounce);
}
.back-btn:hover { background: var(--primary-light); color: var(--primary); transform: translateX(4px); }

/* ── Page Header ── */
.page-header {
  background: linear-gradient(135deg, var(--dark) 0%, var(--dark-alt) 100%);
  padding: 48px 24px;
  position: relative; overflow: hidden;
}
.page-header::before {
  content: '';
  position: absolute; top: -80px; left: -80px;
  width: 300px; height: 300px;
  background: radial-gradient(circle, rgba(0,180,166,0.15) 0%, transparent 70%);
  border-radius: 50%;
}
.page-header::after {
  content: '';
  position: absolute; bottom: -60px; right: -60px;
  width: 240px; height: 240px;
  background: radial-gradient(circle, rgba(245,166,35,0.12) 0%, transparent 70%);
  border-radius: 50%;
}
.page-header-inner {
  max-width: 1200px; margin: 0 auto;
  position: relative; z-index: 1;
}
.page-header h1 {
  font-family: var(--font-display);
  font-size: clamp(28px,4vw,42px);
  font-weight: 900; color: var(--white);
  display: flex; align-items: center; gap: 14px;
  margin-bottom: 8px;
}
.page-header p { font-size: 15px; color: rgba(255,255,255,0.6); }
.cart-icon-large {
  width: 56px; height: 56px;
  background: var(--primary);
  border-radius: 16px;
  display: flex; align-items: center; justify-content: center;
  font-size: 26px;
}

/* ── Free Shipping Banner ── */
.shipping-banner {
  background: linear-gradient(90deg, #00B4A6, #00D4C4);
  padding: 12px 24px;
}
.shipping-banner-inner {
  max-width: 1200px; margin: 0 auto;
  display: flex; align-items: center; justify-content: center; gap: 12px;
  color: white; font-size: 14px; font-weight: 700;
}
.shipping-progress-wrap {
  background: rgba(255,255,255,0.25);
  border-radius: 50px; height: 8px; width: 200px; overflow: hidden;
}
.shipping-progress-bar {
  height: 100%;
  background: white;
  border-radius: 50px;
  transition: width 0.6s ease;
}

/* ── Main Layout ── */
.cart-layout {
  max-width: 1200px; margin: 0 auto;
  padding: 40px 24px;
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 28px;
  align-items: start;
}

/* ── Cart Items Panel ── */
.cart-panel {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.panel-header {
  padding: 24px 28px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
}
.panel-header h2 {
  font-family: var(--font-display);
  font-size: 20px; font-weight: 900; color: var(--dark);
  display: flex; align-items: center; gap: 10px;
}
.item-count-badge {
  background: var(--primary);
  color: white; font-size: 13px; font-weight: 800;
  width: 28px; height: 28px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
}
.clear-btn {
  font-size: 13px; color: var(--accent-red); font-weight: 600;
  background: #FFF5F5; padding: 7px 14px; border-radius: 8px;
  transition: var(--transition);
}
.clear-btn:hover { background: var(--accent-red); color: white; }

/* ── Cart Item ── */
.cart-items-list { padding: 8px 0; }

.cart-item {
  display: grid;
  grid-template-columns: 88px 1fr auto;
  gap: 20px;
  align-items: center;
  padding: 20px 28px;
  border-bottom: 1px solid var(--border);
  transition: var(--transition);
  position: relative;
}
.cart-item:last-child { border-bottom: none; }
.cart-item:hover { background: #FAFCFF; }

/* Remove animation */
.cart-item.removing {
  animation: slideOut 0.35s ease forwards;
}
@keyframes slideOut {
  to { opacity: 0; transform: translateX(60px); max-height: 0; padding: 0; }
}

.item-image {
  width: 88px; height: 88px;
  border-radius: 16px; overflow: hidden;
  background: var(--light-gray);
  display: flex; align-items: center; justify-content: center;
  font-size: 40px;
  flex-shrink: 0;
  position: relative;
}
.item-image .category-dot {
  position: absolute; top: 6px; right: 6px;
  width: 10px; height: 10px; border-radius: 50%;
}

.item-info { flex: 1; min-width: 0; }
.item-category {
  font-size: 11px; font-weight: 700;
  color: var(--primary); text-transform: uppercase;
  letter-spacing: 0.5px; margin-bottom: 4px;
}
.item-name {
  font-size: 16px; font-weight: 800; color: var(--dark);
  margin-bottom: 6px; line-height: 1.3;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.item-age {
  font-size: 12px; color: var(--gray);
  background: var(--light-gray);
  display: inline-block; padding: 3px 10px; border-radius: 50px;
  margin-bottom: 12px;
}
.item-unit-price {
  font-size: 13px; color: var(--gray); font-weight: 500;
}
.item-unit-price strong { color: var(--primary); font-size: 14px; }

/* Quantity Control */
.qty-control {
  display: flex; align-items: center; gap: 0;
  background: var(--light-gray);
  border-radius: 12px; overflow: hidden;
  border: 1.5px solid var(--border);
  width: fit-content;
}
.qty-btn {
  width: 36px; height: 36px;
  background: transparent; color: var(--dark-alt);
  font-size: 18px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  transition: var(--transition);
  line-height: 1;
}
.qty-btn:hover { background: var(--primary); color: white; }
.qty-btn.minus:hover { background: var(--accent-red); }
.qty-input {
  width: 44px; height: 36px;
  background: white;
  border: none; border-right: 1.5px solid var(--border); border-left: 1.5px solid var(--border);
  text-align: center;
  font-family: var(--font-display);
  font-size: 16px; font-weight: 900; color: var(--dark);
  -moz-appearance: textfield;
  outline: none;
}
.qty-input::-webkit-outer-spin-button,
.qty-input::-webkit-inner-spin-button { -webkit-appearance: none; }

/* Item right side */
.item-right {
  display: flex; flex-direction: column;
  align-items: flex-end; gap: 12px;
  flex-shrink: 0;
}
.item-total {
  font-family: var(--font-display);
  font-size: 22px; font-weight: 900;
  color: var(--dark);
}
.item-total .kd { font-size: 14px; color: var(--gray); font-weight: 600; }

.remove-btn {
  width: 34px; height: 34px;
  border-radius: 10px;
  background: #FFF0F0; color: var(--accent-red);
  font-size: 16px;
  display: flex; align-items: center; justify-content: center;
  transition: var(--transition-bounce);
}
.remove-btn:hover { background: var(--accent-red); color: white; transform: scale(1.15) rotate(10deg); }

/* ── Empty Cart ── */
.empty-cart {
  padding: 80px 24px;
  text-align: center;
  display: none;
}
.empty-cart.show { display: block; }
.empty-cart .empty-icon {
  font-size: 80px; margin-bottom: 24px;
  animation: float 3s ease-in-out infinite;
}
@keyframes float { 0%,100%{transform:translateY(0)} 50%{transform:translateY(-14px)} }
.empty-cart h3 { font-family: var(--font-display); font-size: 24px; font-weight: 900; color: var(--dark); margin-bottom: 10px; }
.empty-cart p { font-size: 15px; color: var(--gray); margin-bottom: 28px; }
.shop-now-btn {
  display: inline-flex; align-items: center; gap: 10px;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: white; padding: 14px 32px; border-radius: 50px;
  font-size: 16px; font-weight: 700;
  box-shadow: var(--shadow-glow);
  transition: var(--transition-bounce);
}
.shop-now-btn:hover { transform: translateY(-4px); box-shadow: 0 14px 40px rgba(0,180,166,0.4); }

/* ── Coupon ── */
.coupon-section {
  padding: 20px 28px;
  border-top: 1px solid var(--border);
  background: var(--light-gray);
}
.coupon-label { font-size: 13px; font-weight: 700; color: var(--gray); margin-bottom: 10px; }
.coupon-row {
  display: flex; gap: 10px;
}
.coupon-input {
  flex: 1; padding: 12px 16px;
  border: 2px solid var(--border);
  border-radius: 12px; font-family: var(--font-main);
  font-size: 14px; color: var(--dark);
  background: white; outline: none;
  transition: var(--transition);
}
.coupon-input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(0,180,166,0.1); }
.coupon-apply {
  padding: 12px 20px; border-radius: 12px;
  background: var(--primary); color: white;
  font-size: 14px; font-weight: 700;
  transition: var(--transition-bounce);
}
.coupon-apply:hover { background: var(--primary-dark); transform: translateY(-2px); }

/* ── Order Summary Panel ── */
.summary-panel {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  position: sticky; top: 96px;
}
.summary-header {
  background: linear-gradient(135deg, var(--dark), var(--dark-alt));
  padding: 22px 28px;
}
.summary-header h2 {
  font-family: var(--font-display);
  font-size: 20px; font-weight: 900; color: white;
  display: flex; align-items: center; gap: 10px;
}
.summary-body { padding: 24px 28px; }

.summary-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  font-size: 15px;
}
.summary-row:last-of-type { border-bottom: none; }
.summary-row .label { color: var(--gray); font-weight: 500; display: flex; align-items: center; gap: 8px; }
.summary-row .value { font-weight: 700; color: var(--dark); }
.summary-row .value.free {
  color: var(--accent-green);
  background: #EDFAF3; padding: 3px 10px; border-radius: 50px; font-size: 13px;
}
.summary-row .value.shipping-fee { color: var(--gray); }

/* Divider + Total */
.summary-divider {
  height: 1px; background: var(--border); margin: 4px 0;
}
.summary-total {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 0 0;
}
.summary-total .total-label {
  font-family: var(--font-display);
  font-size: 18px; font-weight: 900; color: var(--dark);
}
.summary-total .total-value {
  font-family: var(--font-display);
  font-size: 32px; font-weight: 900; color: var(--primary);
  line-height: 1;
}
.summary-total .total-value .kd { font-size: 16px; color: var(--gray); font-weight: 600; }

/* Free shipping notice */
.free-shipping-note {
  margin-top: 14px;
  background: linear-gradient(135deg, #EDFAF3, #D5F5E3);
  border: 1px solid #A9DFBF;
  border-radius: 12px;
  padding: 12px 16px;
  display: flex; align-items: center; gap: 10px;
  font-size: 13px; font-weight: 700; color: #1D7A45;
}
.remaining-note {
  margin-top: 14px;
  background: var(--secondary-light);
  border: 1px solid #FFD580;
  border-radius: 12px;
  padding: 12px 16px;
  display: flex; align-items: flex-start; gap: 10px;
  font-size: 13px; font-weight: 600; color: #8B5E00;
}

/* Checkout Button */
.checkout-btn {
  width: 100%; margin-top: 22px;
  padding: 18px;
  border-radius: 16px;
  background: linear-gradient(135deg, #25D366 0%, #128C7E 100%);
  color: white;
  font-family: var(--font-display);
  font-size: 20px; font-weight: 900;
  display: flex; align-items: center; justify-content: center; gap: 12px;
  box-shadow: 0 8px 32px rgba(37,211,102,0.35);
  transition: var(--transition-bounce);
  position: relative; overflow: hidden;
}
.checkout-btn::before {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.15), transparent);
  transform: translateX(-100%);
}
.checkout-btn:hover { transform: translateY(-4px); box-shadow: 0 16px 48px rgba(37,211,102,0.5); }
.checkout-btn:hover::before { animation: shimmer 1.2s ease; }
@keyframes shimmer { to { transform: translateX(100%); } }
.checkout-btn:active { transform: translateY(0); }
.checkout-btn .wa-icon { font-size: 26px; }

.checkout-btn:disabled {
  background: linear-gradient(135deg, #ccc, #aaa);
  box-shadow: none; cursor: not-allowed; transform: none;
}

.secure-note {
  margin-top: 14px;
  text-align: center;
  font-size: 12px; color: var(--gray);
  display: flex; align-items: center; justify-content: center; gap: 6px;
}

/* Delivery Info Cards */
.delivery-cards {
  margin-top: 22px;
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px;
}
.delivery-card {
  background: var(--light-gray);
  border-radius: 12px; padding: 14px 12px;
  text-align: center;
  border: 1.5px solid var(--border);
}
.delivery-card .d-icon { font-size: 22px; margin-bottom: 6px; }
.delivery-card .d-title { font-size: 12px; font-weight: 800; color: var(--dark); margin-bottom: 2px; }
.delivery-card .d-sub { font-size: 11px; color: var(--gray); }

/* ── Suggested Products ── */
.suggested-section {
  max-width: 1200px; margin: 0 auto;
  padding: 0 24px 60px;
}
.suggested-section h3 {
  font-family: var(--font-display);
  font-size: 22px; font-weight: 900; color: var(--dark);
  margin-bottom: 20px;
  display: flex; align-items: center; gap: 10px;
}
.suggested-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}
.suggested-card {
  background: white; border-radius: var(--radius-md);
  padding: 18px; text-align: center;
  box-shadow: var(--shadow-sm);
  transition: var(--transition-bounce);
  cursor: pointer;
  border: 2px solid transparent;
}
.suggested-card:hover { transform: translateY(-6px); border-color: var(--primary-light); box-shadow: var(--shadow-glow); }
.suggested-card .s-emoji { font-size: 44px; margin-bottom: 10px; }
.suggested-card .s-name { font-size: 13px; font-weight: 800; color: var(--dark); margin-bottom: 6px; line-height: 1.3; }
.suggested-card .s-price { font-family: var(--font-display); font-size: 16px; font-weight: 900; color: var(--primary); margin-bottom: 10px; }
.suggested-card .s-add {
  width: 100%; padding: 9px;
  background: var(--primary-light); color: var(--primary);
  border-radius: 10px; font-size: 13px; font-weight: 700;
  transition: var(--transition);
}
.suggested-card .s-add:hover { background: var(--primary); color: white; }

/* ── Toast ── */
.toast {
  position: fixed; bottom: 30px; right: 30px;
  background: var(--dark); color: white;
  padding: 14px 20px; border-radius: 14px;
  font-size: 14px; font-weight: 600;
  z-index: 9999;
  display: flex; align-items: center; gap: 10px;
  box-shadow: var(--shadow-md);
  transform: translateY(80px); opacity: 0;
  transition: var(--transition-bounce);
  max-width: 320px;
}
.toast.show { transform: translateY(0); opacity: 1; }
.toast-icon {
  width: 28px; height: 28px;
  background: var(--primary); border-radius: 8px;
  display: flex; align-items: center; justify-content: center; font-size: 14px;
  flex-shrink: 0;
}

/* ── Reveal animation ── */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity 0.6s ease, transform 0.6s ease; }
.reveal.visible { opacity: 1; transform: translateY(0); }
.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }

/* ── Responsive ── */
@media (max-width: 900px) {
  .cart-layout { grid-template-columns: 1fr; }
  .summary-panel { position: static; }
  .suggested-grid { grid-template-columns: repeat(2,1fr); }
}
@media (max-width: 600px) {
  .cart-item { grid-template-columns: 72px 1fr; gap: 14px; }
  .item-right { display: none; }
  .item-info { display: flex; flex-direction: column; }
  .item-mobile-price {
    display: flex !important;
    align-items: center; justify-content: space-between;
    margin-top: 10px;
  }
  .suggested-grid { grid-template-columns: repeat(2,1fr); }
  .delivery-cards { grid-template-columns: 1fr; }
  .page-header h1 { font-size: 24px; }
}
@media (min-width: 601px) {
  .item-mobile-price { display: none; }
}
