﻿/* ============================================================
   TABE3 3D — GLOBAL STYLES
   ============================================================ */

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --blue: #1a6fb5;
  --blue-light: #8fd2ff;
  --blue-hover: #155d9a;
  --red-badge: #e53935;
  --text-dark: #1a1a1a;
  --text-mid: #444;
  --text-light: #777;
  --border: #e0e0e0;
  --bg-light: #f5f7fa;
  --bg-footer: #f2f2f2;
  --white: #ffffff;
  --font: "IBM Plex Sans Arabic", sans-serif;
  --max-w: 1200px;
  --header-h: 70px;
}

html {
  scroll-behavior: smooth;
  overflow-x: clip; /* clip doesn't break position:fixed like hidden does */
}

body {
  font-family: var(--font);
  direction: rtl;
  text-align: right;
  color: var(--text-dark);
  background: var(--white);
  font-size: 16px;
  line-height: 1.6;
  max-width: 100vw;
}

img {
  display: block;
  max-width: 100%;
}
a {
  text-decoration: none;
  color: inherit;
}
button {
  cursor: pointer;
  font-family: var(--font);
  border: none;
  outline: none;
}
ul {
  list-style: none;
}

/* ============================================================
   ANNOUNCEMENT BAR
   ============================================================ */
.announcement-bar {
  background: #bde1f7;
  color: var(--blue);
  text-align: center;
  padding: 9px 16px;
  font-size: 16px;
  font-weight: 500;
  letter-spacing: 0.01em;
}

/* ============================================================
   HEADER
   ============================================================ */
.header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: var(--white);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.06);
  width: 100%;
}

.header-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 24px;
  height: var(--header-h);
  display: flex;
  align-items: center;
  gap: 0;
}

/* Logo */
.logo {
  flex-shrink: 0;
}

.logo img {
  height: 52px;
  width: auto;
  object-fit: contain;
}

/* Desktop Nav — truly centered */
.nav {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.nav a {
  font-size: 17px;
  font-weight: 500;
  color: var(--text-dark);
  padding: 7px 12px;
  border-radius: 6px;
  transition:
    background 0.18s,
    color 0.18s;
  white-space: nowrap;
}

.nav a:hover {
  background: var(--blue);
  color: var(--white);
}

/* Header Icons */
.header-icons {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

/* Hamburger — hidden on desktop */
.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  padding: 8px;
  flex-shrink: 0;
  cursor: pointer;
}

.icon-btn {
  background: none;
  color: var(--text-dark);
  padding: 8px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
  position: relative;
}

.icon-btn:hover {
  background: var(--bg-light);
}

.cart-badge {
  position: absolute;
  top: 2px;
  left: 2px;
  background: var(--red-badge);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  min-width: 16px;
  height: 16px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.lang-btn {
  background: none;
  border-radius: 6px;
  padding: 4px 6px;
  display: flex;
  align-items: center;
}

.lang-btn img {
  border-radius: 2px;
}

.hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text-dark);
  border-radius: 2px;
  transition:
    transform 0.25s,
    opacity 0.25s;
}

/* Mobile Nav */
.mobile-nav {
  display: none;
  flex-direction: column;
  background: var(--white);
  border-top: 1px solid var(--border);
  padding: 8px 0;
}

.mobile-nav a {
  padding: 13px 20px;
  font-size: 15px;
  font-weight: 500;
  border-bottom: 1px solid #f0f0f0;
  color: var(--text-dark);
  display: block;
  transition:
    background 0.15s,
    color 0.15s;
}

.mobile-nav a:hover {
  background: var(--blue);
  color: #fff;
}

.mobile-nav.open {
  display: flex;
}

/* ============================================================
   HERO SLIDER
   ============================================================ */
.slider-section {
  width: 100%;
  background: #fff;
  overflow: hidden;
}

.slider-wrapper {
  width: 100%;
  max-width: 100%;
  margin: 0 auto;
  position: relative;
  overflow: hidden;
  border-radius: 0;
  height: 550px;
}

.slide {
  display: none;
  width: 100%;
  height: 100%;
}

.slide.active {
  display: block;
}

.slide img {
  width: 100%;
  height: 550px;
  object-fit: cover;
  object-position: center;
  border-radius: 10px;
}

.slider-dots {
  display: flex;
  justify-content: center;
  gap: 7px;
  padding: 14px 0 6px;
}

.dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #c9dff0;
  cursor: pointer;
  transition:
    background 0.2s,
    transform 0.2s;
}

.dot.active {
  background: var(--blue);
  transform: scale(1.2);
}

.section-dots {
  padding: 12px 0 2px;
}

/* ============================================================
   CONTAINER
   ============================================================ */
.container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 24px;
}

/* ============================================================
   SECTION TITLE
   ============================================================ */
.section-title {
  text-align: center;
  font-size: 26px;
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: 20px;
}

/* ============================================================
   PRODUCTS SECTION
   ============================================================ */
.products-section {
  padding: 36px 0 22px;
}

/* ============================================================
   PRODUCTS GRID
   ============================================================ */
.products-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

/* ============================================================
   PRODUCT CARD
   ============================================================ */
.product-card {
  background: var(--white);
  border: 1.5px solid #8fd2ff;
  border-radius: 14px;
  overflow: hidden;
  position: relative;
  transition:
    box-shadow 0.2s,
    transform 0.2s;
  display: flex;
  flex-direction: column;
}

.product-card:hover {
  box-shadow: 0 8px 28px rgba(26, 111, 181, 0.16);
  transform: translateY(-3px);
}

.product-card:hover {
  box-shadow: 0 8px 28px rgba(26, 111, 181, 0.16);
  transform: translateY(-3px);
}

/* Badge */
/* ========================
   BADGE OFFER — pill shape with tag icon
   ======================== */
.badge-offer {
  position: absolute;
  top: 10px;
  right: 10px;
  background: var(--red-badge);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  padding: 4px 10px 4px 8px;
  border-radius: 999px;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 5px;
  letter-spacing: 0.02em;
}

.badge-offer::before {
  content: "";
  display: inline-block;
  width: 14px;
  height: 14px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.426 2.426 0 0 0 3.42 0l6.58-6.58a2.426 2.426 0 0 0 0-3.42z'/%3E%3Ccircle cx='7.5' cy='7.5' r='1' fill='white' stroke='none'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-size: contain;
  flex-shrink: 0;
}

/* Product image */
.product-img-wrap {
  background: #f9fafb;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px;
  min-height: 150px;
}

.product-img-wrap img {
  max-height: 120px;
  width: auto;
  object-fit: contain;
  margin: 0 auto;
}

/* Product info */
.product-info {
  padding: 10px 12px 12px;
  display: flex;
  flex-direction: column;
  flex: 1;
  justify-content: space-between; /* الاسم فوق، السعر+الأزرار تحت دايماً */
}

.product-name {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-dark);
  line-height: 1.45;
  min-height: calc(16px * 1.45 * 2); /* سطرين بالضبط */
  margin-bottom: 0;
}

/* السعر والأزرار — دايمًا في الأسفل */
.product-footer {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Pricing row — price right, qty left */
.product-pricing {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-direction: row-reverse;
}

/* Qty control */
.qty-control {
  display: flex;
  align-items: center;
  gap: 6px;
  border: 1.5px solid var(--border);
  border-radius: 9px;
  padding: 4px 10px;
}

.qty-btn {
  background: none;
  font-size: 19px;
  font-weight: 700;
  color: var(--text-mid);
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  transition: color 0.15s;
}

.qty-btn:hover {
  color: var(--blue);
  background: transparent;
  transform: none;
  box-shadow: none;
}

.qty-val {
  font-size: 17px;
  font-weight: 700;
  min-width: 22px;
  text-align: center;
}

/* Price box — right aligned */
.price-box {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  justify-content: flex-end;
}

.old-price {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-light);
  text-decoration: line-through;
  display: flex;
  align-items: center;
  gap: 4px;
  direction: ltr;
  unicode-bidi: embed;
  align-self: flex-end;
}

.new-price {
  font-size: 28px;
  font-weight: 800;
  color: var(--blue);
  display: flex;
  align-items: center;
  gap: 5px;
  direction: ltr;
  unicode-bidi: embed;
  align-self: flex-end;
}

.new-price.only-price {
  font-size: 28px;
}

/* Riyal icon */
.riyal-icon {
  width: auto;
  display: inline-block;
  vertical-align: middle;
  flex-shrink: 0;
}

.riyal-grey {
  height: 13px;
  opacity: 0.75;
}
.riyal-blue {
  height: 18px;
  opacity: 1;
}

/* Buttons */
.product-btns {
  display: flex;
  gap: 8px;
}

.btn-add {
  flex: 1;
  background: var(--blue-light);
  color: var(--blue);
  font-size: 15px;
  font-weight: 800;
  padding: 9px 6px;
  border-radius: 9px;
  text-align: center;
  transition:
    transform 0.18s,
    box-shadow 0.18s;
}

.btn-add:hover {
  transform: scale(1.04);
  box-shadow: 0 3px 10px rgba(26, 111, 181, 0.18);
}

.btn-buy {
  flex: 1;
  background: var(--blue);
  color: #fff;
  font-size: 15px;
  font-weight: 800;
  padding: 9px 6px;
  border-radius: 9px;
  text-align: center;
  transition:
    transform 0.18s,
    box-shadow 0.18s;
}

.btn-buy:hover {
  transform: scale(1.04);
  box-shadow: 0 3px 10px rgba(26, 111, 181, 0.28);
}

/* ============================================================
   MID BANNER
   ============================================================ */
.mid-banner-section {
  width: 100%;
  padding: 8px 0;
}

.mid-banner-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 24px;
}

.mid-banner-inner img {
  width: 100%;
  border-radius: 10px;
  object-fit: cover;
}

/* ============================================================
   FOOTER
   ============================================================ */
.footer {
  background: var(--bg-footer);
  margin-top: 28px;
  border-top: 1px solid #ddd;
}

.footer-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 36px 24px 24px;
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr;
  gap: 40px;
}

/* Footer headings */
.footer-col h4 {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: 12px;
}

.footer-desc {
  font-size: 15px;
  color: var(--text-mid);
  line-height: 1.7;
  margin-bottom: 14px;
  max-width: 300px;
}

/* Contact items */
.footer-contact {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
}

.contact-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  color: var(--text-mid);
}

.contact-item svg {
  flex-shrink: 0;
  color: var(--blue);
}

/* Social — line style like mail/phone icons */
.social-links {
  display: flex;
  gap: 14px;
}

.social-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-mid);
  transition:
    color 0.18s,
    transform 0.18s;
  width: 22px;
  height: 22px;
}

.social-btn:hover {
  transform: translateY(-2px);
}
.social-btn.tiktok:hover {
  color: #010101;
}
.social-btn.youtube:hover {
  color: #ff0000;
}
.social-btn.instagram:hover {
  color: #bc1888;
}

/* Footer divider */
.footer-divider {
  width: 40px;
  height: 3px;
  background: var(--blue);
  border-radius: 2px;
  margin-bottom: 14px;
}

/* Footer links */
.footer-links li {
  margin-bottom: 10px;
}

.footer-links a {
  font-size: 15px;
  color: var(--text-mid);
  transition: color 0.15s;
}

.footer-links a:hover {
  color: var(--blue);
}

/* Footer logos col */
.footer-col-logos {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 20px;
  text-align: right;
}

.footer-logo-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  justify-content: flex-end;
}

.footer-layer-logo {
  height: 52px;
  width: auto;
  object-fit: contain;
}

.footer-logo-text {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-dark);
  text-align: right;
}

.footer-vat-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  justify-content: flex-end;
}

.footer-vat-logo {
  height: 52px;
  width: auto;
  object-fit: contain;
}

.footer-tax-info {
  text-align: right;
}

.tax-label {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-dark);
}

.tax-number {
  font-size: 14px;
  color: var(--text-mid);
  direction: ltr;
  text-align: right;
}

/* Footer bottom */
.footer-bottom {
  border-top: 1px solid #ddd;
  text-align: center;
  padding: 14px 24px;
  font-size: 12.5px;
  color: var(--text-light);
}

/* ============================================================
   TOAST NOTIFICATION — top-right
   ============================================================ */
.toast-container {
  position: fixed;
  top: 80px;
  right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: flex-end;
  pointer-events: none;
}

.toast {
  background: #e8f5e9;
  border: 1.5px solid #a5d6a7;
  color: #2e7d32;
  font-size: 15px;
  font-weight: 700;
  padding: 12px 20px;
  border-radius: 10px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.13);
  animation:
    toastIn 0.28s ease,
    toastOut 0.28s ease 2.2s forwards;
  pointer-events: none;
  white-space: nowrap;
}

.toast.toast-error {
  background: #ffebee;
  border-color: #ef9a9a;
  color: #c62828;
}

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateX(20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes toastOut {
  from {
    opacity: 1;
    transform: translateX(0);
  }
  to {
    opacity: 0;
    transform: translateX(20px);
  }
}

/* ============================================================
   RESPONSIVE — LARGE DESKTOP clamp (1024px–1200px)
   ============================================================ */
@media (max-width: 1200px) {
  .nav a {
    font-size: 16px;
    padding: 7px 10px;
  }
}

@media (max-width: 1060px) {
  .nav a {
    font-size: 15px;
    padding: 6px 8px;
  }
}

/* ============================================================
   RESPONSIVE — TABLET (601px – 1024px)
   Hamburger RIGHT | Logo CENTER | Icons LEFT
   ============================================================ */
@media (max-width: 1024px) and (min-width: 601px) {
  :root {
    --header-h: 64px;
  }

  /* ---- Header: ☰ right | logo center | icons left ---- */
  .header-inner {
    padding: 0 20px;
    display: flex;
    align-items: center;
    position: relative;
    gap: 0;
  }

  .nav {
    display: none;
  }

  /* ☰ Hamburger — first in HTML = rightmost in RTL, just show it */
  .hamburger {
    display: flex;
    flex-shrink: 0;
  }

  /* Logo — absolutely centered in header */
  .logo {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    flex-shrink: 0;
  }
  .logo img {
    height: 46px;
  }

  /* Icons — last in HTML = leftmost in RTL, push to left edge */
  .header-icons {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
    margin-right: auto;
  }
  .lang-btn {
    display: flex;
  }

  /* ---- Slider — side margins = container padding ---- */
  .slider-section {
    padding: 14px 0 0;
  }
  .slider-wrapper {
    height: 400px;
    width: calc(100% - 48px);
    margin: 0 auto;
    border-radius: 12px;
    overflow: hidden;
    max-width: 100%;
  }
  .slide img {
    height: 400px;
    border-radius: 12px;
  }

  /* ---- Container with white side space ---- */
  .container {
    padding: 0 24px;
  }

  /* ---- 2-col product grid — desktop proportions ---- */
  .products-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
  }

  .product-card {
    min-height: unset;
  }
  .product-img-wrap {
    min-height: 160px;
    padding: 16px;
  }
  .product-img-wrap img {
    max-height: 130px;
  }
  .product-name {
    font-size: 17px;
    min-height: calc(17px * 1.45 * 2);
  }
  .product-info {
    padding: 12px 12px 14px;
  }
  .product-footer {
    gap: 10px;
  }
  .product-pricing {
    flex-direction: row-reverse;
    align-items: center;
    gap: 8px;
  }
  .price-box {
    align-items: flex-end;
    justify-content: flex-end;
  }
  .new-price {
    font-size: 28px;
  }
  .old-price {
    font-size: 16px;
  }
  .riyal-blue {
    height: 17px;
  }
  .riyal-grey {
    height: 13px;
  }

  .qty-control {
    padding: 5px 12px;
    gap: 8px;
  }
  .qty-val {
    font-size: 18px;
  }
  .qty-btn {
    font-size: 20px;
  }

  .btn-add,
  .btn-buy {
    font-size: 16px;
    padding: 11px 8px;
    font-weight: 800;
  }

  .section-title {
    font-size: 26px;
  }
  .products-section {
    padding: 30px 0 18px;
  }
  .product-name {
    font-size: 17px;
  }
  .btn-add,
  .btn-buy {
    font-size: 16px;
    padding: 12px 10px;
    font-weight: 800;
  }
  .mobile-nav a {
    font-size: 16px;
    padding: 15px 24px;
  }

  /* ---- Footer 2-col ---- */
  .footer-inner {
    grid-template-columns: 1fr 1fr;
    gap: 28px;
    padding: 28px 24px 20px;
  }
  .footer-col-logos {
    grid-column: 1 / -1;
    flex-direction: row;
    justify-content: space-between;
    align-items: flex-start;
  }
  .footer-desc {
    max-width: 100%;
    font-size: 15px;
  }
}

/* ============================================================
   RESPONSIVE — MOBILE (≤600px)
   Hamburger RIGHT | Logo CENTER | No Icons
   ============================================================ */
@media (max-width: 600px) {
  :root {
    --header-h: 54px;
  }

  .announcement-bar {
    font-size: 14px;
    padding: 8px 20px;
  }

  /* ---- Header: ☰ right | logo center | no icons ---- */
  .header-inner {
    padding: 0 16px;
    display: flex;
    align-items: center;
    position: relative;
    gap: 0;
  }

  .nav {
    display: none;
  }

  /* ☰ Hamburger — first in HTML = rightmost in RTL */
  .hamburger {
    display: flex;
    flex-shrink: 0;
  }

  /* Logo — absolutely centered */
  .logo {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
  }
  .logo img {
    height: 48px;
  }

  /* Hide icons completely on mobile */
  .header-icons {
    display: none !important;
  }

  /* Hide the floating WhatsApp button on mobile */
  .whatsapp-button {
    display: none !important;
  }

  /* ---- Slider ---- */
  .slider-section {
    padding: 12px 0 0;
    overflow: visible;
  }
  .slider-wrapper {
    height: 280px;
    width: calc(100% - 28px);
    margin: 0 auto;
    border-radius: 12px;
    overflow: hidden;
    max-width: calc(100vw - 28px);
  }
  .slide img {
    height: 280px;
    border-radius: 12px;
    object-position: center;
  }

  .container {
    padding: 0 14px;
  }
  .section-title {
    font-size: 16px;
    margin-bottom: 12px;
    font-weight: 700;
  }
  .products-section {
    padding: 18px 0 8px;
  }

  /* ---- Product grid 2-col ---- */
  .products-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }

  .product-card {
    border-radius: 10px;
    border-width: 1.5px;
    min-height: unset;
  }
  .product-img-wrap {
    min-height: 100px;
    padding: 10px;
    background: #f8f9fb;
  }
  .product-img-wrap img {
    max-height: 84px;
  }
  .product-info {
    padding: 9px 9px 11px;
  }
  .product-name {
    font-size: 11.5px;
    line-height: 1.4;
    min-height: calc(11.5px * 1.4 * 2);
  }
  .product-footer {
    gap: 7px;
  }

  /* ---- Pricing: horizontal like desktop ---- */
  .product-pricing {
    flex-direction: row-reverse;
    align-items: center;
    justify-content: space-between;
    gap: 4px;
  }
  .price-box {
    align-items: flex-end;
    justify-content: flex-end;
  }
  .old-price {
    font-size: 11px;
  }
  .new-price {
    font-size: 15px;
  }
  .riyal-blue {
    height: 12px;
  }
  .riyal-grey {
    height: 10px;
  }

  .qty-control {
    padding: 2px 6px;
    gap: 3px;
    border-radius: 7px;
  }
  .qty-btn {
    font-size: 13px;
    width: 16px;
    height: 16px;
  }
  .qty-val {
    font-size: 12px;
    min-width: 14px;
  }

  .product-btns {
    gap: 6px;
  }
  .btn-add,
  .btn-buy {
    font-size: 11px;
    font-weight: 700;
    padding: 8px 3px;
    border-radius: 7px;
  }

  .badge-offer {
    font-size: 10px;
    padding: 2px 7px;
    top: 8px;
    right: 8px;
  }

  .mid-banner-section {
    padding: 6px 0;
  }
  .mid-banner-inner {
    padding: 0 14px;
    overflow: hidden;
  }
  .mid-banner-inner img {
    border-radius: 10px;
    width: 100%;
  }

  /* ---- Footer ---- */
  body {
    padding-bottom: 62px;
  }
  .footer {
    margin-top: 16px;
  }
  .footer-inner {
    display: flex;
    flex-direction: column;
    gap: 0;
    padding: 18px 16px 12px;
  }

  .footer-col {
    border-bottom: 1px solid #e4e4e4;
    padding-bottom: 14px;
    margin-bottom: 14px;
  }
  .footer-col:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
  }
  .footer-col h4 {
    font-size: 14px;
    margin-bottom: 8px;
  }
  .footer-desc {
    font-size: 12.5px;
    max-width: 100%;
    margin-bottom: 8px;
    line-height: 1.6;
  }
  .contact-item {
    font-size: 12px;
    gap: 6px;
  }
  .contact-item svg {
    width: 14px;
    height: 14px;
  }
  .footer-contact {
    gap: 6px;
    margin-bottom: 12px;
  }
  .social-links {
    gap: 18px;
  }
  .social-btn svg {
    width: 20px;
    height: 20px;
  }

  .footer-links {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px 20px;
  }
  .footer-links li {
    margin-bottom: 0;
  }
  .footer-links a {
    font-size: 12.5px;
  }
  .footer-links-wrapper ul li {
    margin-bottom: 6px;
  }
  .footer-links-wrapper ul li a {
    font-size: 12.5px;
  }
  .footer-divider {
    margin-bottom: 10px;
  }

  .footer-col-logos {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
  }
  .footer-logo-wrap {
    flex-direction: column-reverse;
    align-items: flex-end;
    gap: 5px;
  }
  .footer-layer-logo {
    height: 38px;
  }
  .footer-logo-text {
    font-size: 11px;
    font-weight: 600;
  }
  .footer-vat-wrap {
    flex-direction: column-reverse;
    align-items: flex-end;
    gap: 5px;
  }
  .footer-vat-logo {
    height: 38px;
  }
  .footer-tax-info {
    text-align: right;
  }
  .tax-label {
    font-size: 11px;
  }
  .tax-number {
    font-size: 11px;
  }
  .footer-bottom {
    font-size: 11px;
    padding: 10px 16px;
  }

  .slider-dots {
    padding: 10px 0 4px;
  }
  .dot {
    width: 7px;
    height: 7px;
  }

  .toast-container {
    top: auto;
    bottom: 80px;
    left: 50% !important;
    right: auto !important;
    transform: translateX(-50%) !important;
    align-items: center;
    width: calc(100% - 32px);
    max-width: 340px;
  }
  .toast {
    font-size: 12.5px;
    padding: 10px 14px;
    border-radius: 8px;
  }
}

/* ============================================================
   RESPONSIVE — SMALL PHONE (≤390px)
   ============================================================ */
@media (max-width: 390px) {
  .logo img {
    height: 42px;
  }
  .products-grid {
    gap: 8px;
  }
  .product-name {
    font-size: 11px;
  }
  .new-price {
    font-size: 14px;
  }
  .riyal-blue {
    height: 11px;
  }
  .btn-add,
  .btn-buy {
    font-size: 10.5px;
    padding: 7px 2px;
  }
  .slider-wrapper {
    height: 155px;
  }
  .slide img {
    height: 155px;
  }

  .footer-col h4 {
    font-size: 13px;
  }
  .footer-desc,
  .footer-links-wrapper ul li a,
  .contact-item {
    font-size: 12px;
  }
  .footer-bottom {
    font-size: 10.5px;
  }

  .tab-item {
    font-size: 10px;
  }
  .tab-item svg {
    width: 20px;
    height: 20px;
  }
}

/* ============================================================
   MOBILE BOTTOM TAB BAR
   ============================================================ */
.bottom-tab-bar {
  display: none;
}

@media (max-width: 600px) {
  .bottom-tab-bar {
    display: flex;
    position: fixed;
    bottom: 0;
    right: 0;
    left: 0;
    z-index: 2000;
    background: #fff;
    border-top: 1.5px solid #e8e8e8;
    box-shadow: 0 -3px 16px rgba(0, 0, 0, 0.09);
    height: 62px;
    align-items: stretch;
    width: 100vw;
  }

  .tab-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    color: #aaa;
    font-size: 10.5px;
    font-weight: 600;
    font-family: var(--font);
    cursor: pointer;
    border: none;
    background: none;
    transition: color 0.18s;
    position: relative;
    padding: 6px 4px 8px;
    -webkit-tap-highlight-color: transparent;
  }

  .tab-item.active {
    color: var(--blue);
  }
  .tab-item.active svg {
    stroke: var(--blue);
  }

  .tab-item svg {
    width: 22px;
    height: 22px;
    stroke: #aaa;
    transition: stroke 0.18s;
  }

  .tab-cart-badge {
    position: absolute;
    top: 5px;
    right: calc(50% - 20px);
    background: var(--red-badge);
    color: #fff;
    font-size: 9px;
    font-weight: 700;
    min-width: 16px;
    height: 16px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #fff;
  }
}

/* ============================================================
   PRODUCT CARD LINKS
   ============================================================ */
.product-img-link {
  display: block;
  text-decoration: none;
}

.product-img-link:hover .product-img-wrap {
  background: #edf4ff;
}

.product-name-link {
  display: block;
  text-decoration: none;
}

.product-name-link:hover .product-name {
  color: var(--blue);
}

/* ============================================================
   COMPATIBILITY & OVERRIDES
   ============================================================ */

/* Ensure body uses IBM Plex Arabic by default */
body {
  font-family: "IBM Plex Sans Arabic", sans-serif !important;
}

/* Override Bootstrap default RTL direction if set elsewhere */
html[dir="rtl"] body {
  direction: rtl;
}

html[dir="ltr"] body {
  direction: ltr;
}

/* Active nav link styling */
.nav a.nav-active {
  background: var(--blue);
  color: var(--white);
}

/* Nav: align digits (e.g. "3D") with letters */
.nav-num {
  font-family: "Segoe UI", "Tahoma", "Arial", sans-serif;
  font-weight: 700;
  font-variant-numeric: lining-nums;
  vertical-align: baseline;
}
.nav a { font-variant-numeric: lining-nums; }

/* Ensure slider wrapper doesn't have extra white space */
.slider-wrapper > .col-lg-10 {
  width: 100%;
  padding: 0;
  margin: 0;
  float: none;
}

/* Reset AOS animation conflicts if old animations still loading */
[data-aos] {
  opacity: 1 !important;
  transform: none !important;
}

/* Ensure dropdown menus work properly in header */
.header-icons .dropdown-menu {
  position: absolute;
  top: 100%;
  right: 0;
  left: auto;
  margin-top: 8px;
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
  border: 1px solid #e0e0e0;
}

html[dir="ltr"] .header-icons .dropdown-menu {
  right: auto;
  left: 0;
}

.header-icons .dropdown-item {
  padding: 10px 16px;
  font-size: 14px;
  color: #444;
  transition: background 0.15s;
}

.header-icons .dropdown-item:hover {
  background: #f5f7fa;
  color: #1a6fb5;
}

/* Mobile bottom padding for bottom tab bar */
@media (max-width: 600px) {
  body {
    padding-bottom: 70px;
  }
}

/* Ensure links in product cards work */
.product-card a {
  color: inherit;
  text-decoration: none;
}

/* Fix z-index stacking for modals */
.modal {
  z-index: 10000;
}

.modal-backdrop {
  z-index: 9999;
}

/* Ensure old modules don't break new layout */
main
  > section:not(.slider-section):not(.products-section):not(
    .mid-banner-section
  ) {
  padding: 20px 0;
}

/* Hidden utility class */
.hidden {
  display: none !important;
}

/* Footer pages module RTL fix */
.footer-links-wrapper ul {
  list-style: none;
  padding: 0;
  margin: 0;
  text-align: right;
}

html[dir="ltr"] .footer-links-wrapper ul {
  text-align: left;
}

.footer-links-wrapper ul li {
  margin-bottom: 10px;
}

.footer-links-wrapper ul li a {
  font-size: 15px;
  color: var(--text-mid);
  transition: color 0.15s;
  text-decoration: none;
}

.footer-links-wrapper ul li a:hover {
  color: var(--blue);
}

/* Remove the old .footer-links styling since we're now wrapping */
.footer-col-center {
  text-align: right;
}

html[dir="ltr"] .footer-col-center {
  text-align: left;
}

/* Prevent nav links from wrapping to two lines */
.nav {
  flex-wrap: nowrap;
  overflow: hidden;
}

.nav a {
  white-space: nowrap;
  flex-shrink: 0;
}

/* Scale nav font down more aggressively if needed */
@media (max-width: 1200px) {
  .nav a {
    font-size: 14px;
    padding: 6px 8px;
  }
}

@media (max-width: 1100px) {
  .nav a {
    font-size: 13px;
    padding: 5px 6px;
  }
}

/* Slider: ensure Bootstrap carousel shows correctly inside slider-section wrapper */
.slider-section #main_banner {
  width: 100%;
}

.slider-section #main_banner .carousel-inner {
  border-radius: 10px;
  overflow: hidden;
}

.slider-section #main_banner img {
  width: 100%;
  max-height: 420px;
  object-fit: cover;
  display: block;
}

@media (max-width: 1024px) {
  .slider-section #main_banner img {
    max-height: 300px;
  }
}

@media (max-width: 600px) {
  .slider-section #main_banner img {
    max-height: 175px;
    border-radius: 10px;
  }
}

/* ============================================================
   SCROLLABLE PRODUCTS ROW
   4 cards fill the visible area exactly. Extras scroll into view.
   Uses fixed px widths — % would be relative to total scroll width.
   ============================================================ */

/* Max-width container is 1200px, padding 24px each side = 1152px usable.
   4 cards + 3 gaps (16px each) = card width = (1152 - 48) / 4 = 276px   */
.products-row-scroll {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  overflow-x: auto;
  overflow-y: visible;
  gap: 16px;
  /* border-box: padding inside max-width; 4 cards (1152px) fill visible area, minimal peek */
  box-sizing: border-box;
  padding: 4px 24px 20px 24px;
  /* scroll-snap makes each swipe land cleanly on a card boundary */
  scroll-snap-type: x mandatory;
  scroll-padding-left: 24px;
  scroll-padding-right: 24px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  -ms-overflow-style: none;
  /* constrain to same max-width as .container */
  max-width: var(--max-w);
  margin-left: auto;
  margin-right: auto;
  /*
   * RTL: scroll container follows page direction (right-to-left).
   * scrollLeft is 0 at the right edge and goes negative when scrolling left.
   */
  direction: rtl;
}

/* Restore RTL for card content inside the LTR scroll container */
.products-row-scroll .product-card {
  direction: rtl;
}

.products-row-scroll::-webkit-scrollbar {
  display: none;
}

/* Desktop (>1024px): 4 cards fill the visible area exactly (276px each) */
.products-row-scroll .product-card {
  flex: 0 0 276px;
  min-width: 276px;
  width: 276px;
  scroll-snap-align: start;
}

/* Tablet (601–1024px): 2 cards — (viewport - 48px padding - 16px gap) / 2 */
@media (max-width: 1024px) and (min-width: 601px) {
  .products-row-scroll {
    padding: 4px 24px 16px 24px;
    gap: 16px;
    scroll-padding-left: 24px;
    scroll-padding-right: 24px;
  }
  .products-row-scroll .product-card {
    flex: 0 0 calc((100vw - 64px) / 2);
    min-width: calc((100vw - 64px) / 2);
    width: calc((100vw - 64px) / 2);
  }
}

/* Mobile (≤600px): 2 compact cards — (viewport - 42px padding - 10px gap) / 2 */
@media (max-width: 600px) {
  .products-row-scroll {
    gap: 10px;
    padding: 4px 14px 14px 14px;
    scroll-padding-left: 14px;
    scroll-padding-right: 14px;
  }
  .products-row-scroll .product-card {
    flex: 0 0 calc((100vw - 52px) / 2);
    min-width: calc((100vw - 52px) / 2);
    width: calc((100vw - 52px) / 2);
  }
}
/* ============================================================
   HERO SLIDER — custom slider (replaces jssor/bootstrap carousel)
   ============================================================ */
/* Base: full width, no overflow */
.slider-section {
  width: 100%;
  background: #fff;
  padding: 0;
  overflow: visible;
}

/* Wrapper clips the slides and sizes to full width (wider than sections) */
.slider-section .slider-wrapper {
  width: calc(100% - 48px);
  max-width: 100%;
  margin: 0 auto;
  padding: 0;
  position: relative;
}

/* Inner is the clipping box */
.slider-section .slider-inner {
  position: relative;
  width: 100%;
  overflow: hidden;
  border-radius: 10px;
  height: 550px;
}

.slider-section .slide {
  display: none;
  width: 100%;
  height: 100%;
}

.slider-section .slide.active {
  display: block;
}

/* Images fill the box */
.slider-section .slide img,
.slider-section .slide a img {
  width: 100%;
  height: 550px;
  object-fit: cover;
  object-position: center;
  display: block;
  border-radius: 10px;
}

/* Dots sit below the wrapper */
.slider-section .slider-dots {
  padding: 12px 0 4px;
}

@media (max-width: 1024px) {
  .slider-section .slider-wrapper {
    width: calc(100% - 48px);
    margin: 0 auto;
  }
  .slider-section .slider-inner {
    height: 400px;
  }
  .slider-section .slide img,
  .slider-section .slide a img {
    height: 400px;
  }
}

@media (max-width: 600px) {
  .slider-section .slider-wrapper {
    width: calc(100% - 28px);
    margin: 0 auto;
  }
  .slider-section .slider-inner {
    height: 280px;
  }
  .slider-section .slide img,
  .slider-section .slide a img {
    height: 280px;
  }
}

/* ============================================================
   FOOTER — RTL/LTR text alignment
   ============================================================ */
/* Every footer column inherits right-align in RTL */
html[dir="rtl"] .footer {
  direction: rtl;
}
html[dir="rtl"] .footer-inner {
  direction: rtl;
}
html[dir="rtl"] .footer-col {
  text-align: right;
}
html[dir="rtl"] .footer-col h4 {
  text-align: right !important;
}
html[dir="rtl"] .footer-col p,
html[dir="rtl"] .footer-desc {
  text-align: right !important;
}
html[dir="rtl"] .footer-col-center {
  text-align: right;
}
html[dir="rtl"] .footer-links-wrapper,
html[dir="rtl"] .footer-links-wrapper ul,
html[dir="rtl"] .footer-links-wrapper li,
html[dir="rtl"] .footer-links-wrapper a {
  text-align: right !important;
  direction: rtl;
}

html[dir="ltr"] .footer {
  direction: ltr;
}
html[dir="ltr"] .footer-col {
  text-align: left;
}
html[dir="ltr"] .footer-col h4 {
  text-align: left !important;
}
html[dir="ltr"] .footer-col-center {
  text-align: left;
}
html[dir="ltr"] .footer-links-wrapper,
html[dir="ltr"] .footer-links-wrapper ul,
html[dir="ltr"] .footer-links-wrapper li,
html[dir="ltr"] .footer-links-wrapper a {
  text-align: left !important;
  direction: ltr;
}

/* Footer pages module wrapper (rules above at .footer-links-wrapper) */

/* ============================================================
   DISCOUNT BADGE — pulse animation
   ============================================================ */
.badge-offer {
  animation: badgePulse 2.5s ease-in-out infinite;
}

@keyframes badgePulse {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.1);
  }
}

/* First (offers) section: warm bg on image */
.section-offers .products-row-scroll .product-card {
  border-color: #ffaaaa;
}

.section-offers .products-row-scroll .product-card .product-img-wrap {
  background: linear-gradient(135deg, #fff8f8 0%, #fff0f0 100%);
}

/* ============================================================
   MISC OVERRIDES
   ============================================================ */
/* Prevent AOS from interfering */
[data-aos] {
  opacity: 1 !important;
  transform: none !important;
}

/* Hidden utility */
.hidden {
  display: none !important;
}

/* Dropdown positioning */
.header-icons .dropdown-menu {
  position: absolute;
  top: 100%;
  right: 0;
  left: auto;
  margin-top: 8px;
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
  border: 1px solid #e0e0e0;
}
html[dir="ltr"] .header-icons .dropdown-menu {
  right: auto;
  left: 0;
}
.header-icons .dropdown-item {
  padding: 10px 16px;
  font-size: 14px;
  color: #444;
}
.header-icons .dropdown-item:hover {
  background: #f5f7fa;
  color: #1a6fb5;
}

/* Active nav */
.nav a.nav-active {
  background: var(--blue);
  color: var(--white);
}

/* Nav no-wrap */
.nav {
  flex-wrap: nowrap;
  overflow: hidden;
}
.nav a {
  white-space: nowrap;
  flex-shrink: 0;
}
@media (max-width: 1200px) {
  .nav a {
    font-size: 14px;
    padding: 6px 8px;
  }
}
@media (max-width: 1100px) {
  .nav a {
    font-size: 13px;
    padding: 5px 6px;
  }
}

/* Modal z-index */
.modal {
  z-index: 10000;
}
.modal-backdrop {
  z-index: 9999;
}

/* ============================================================
   GLOBAL FORM CONTROLS — new design overrides
   ============================================================ */
input.form-control,
select.form-control,
textarea.form-control {
  border-radius: 10px !important;
  border: 1.5px solid #e0e0e0 !important;
  padding: 10px 14px !important;
  font-family: var(--font) !important;
  font-size: 15px !important;
  transition: border-color 0.18s !important;
}

input.form-control:focus,
select.form-control:focus,
textarea.form-control:focus {
  border-color: var(--blue) !important;
  box-shadow: 0 0 0 3px rgba(26, 111, 181, 0.12) !important;
  outline: none !important;
}

/* ============================================================
   PAGE TITLE (for inner pages)
   ============================================================ */
.pageTitle {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: 20px;
  text-align: right;
}

/* ============================================================
   PRODUCT DETAIL PAGE
   ============================================================ */
#product_details_data h5 {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-dark);
  line-height: 1.4;
}

#product_detail {
  margin-top: 20px;
  padding: 16px;
  background: #f9fafb;
  border-radius: 12px;
  border: 1px solid #e0e0e0;
}

#product_detail h6 {
  font-weight: 700;
  margin-bottom: 10px;
  color: var(--blue);
}

/* Product detail image carousel */
#product_details_banner .item img {
  border-radius: 14px;
  object-fit: contain;
  max-height: 400px;
  width: 100%;
}

/* ============================================================
   USER PANEL
   ============================================================ */
#formPage .card {
  border-radius: 16px;
  border: 1.5px solid #e0e0e0;
  overflow: hidden;
}

#formPage .card-header {
  background: var(--blue);
  color: #fff;
  padding: 18px 24px;
}

#formPage .card-header h2 {
  font-size: 18px;
  font-weight: 700;
  margin: 0;
}

/* Sidebar menu */
.list-group-item {
  border-radius: 10px !important;
  margin-bottom: 4px;
  font-weight: 600;
  transition:
    background 0.15s,
    color 0.15s;
}

.list-group-item.active,
.list-group-item:hover {
  background: var(--blue) !important;
  color: #fff !important;
  border-color: var(--blue) !important;
}

/* Orders table */
.table-hover tbody tr:hover {
  background: rgba(26, 111, 181, 0.05);
}

/* ============================================================
   CART ITEMS in qty controls (from cart.js)
   ============================================================ */
.qty-input {
  width: 52px;
  text-align: center;
  border: 1.5px solid #e0e0e0;
  border-radius: 8px;
  padding: 6px 8px;
  font-size: 14px;
  font-weight: 700;
  font-family: var(--font);
}

/* ============================================================
   PAGINATION
   ============================================================ */
.pagination {
  display: flex;
  justify-content: center;
  gap: 6px;
  flex-wrap: wrap;
}

.pagination > li > a,
.pagination > li > span {
  border-radius: 8px !important;
  border: 1.5px solid #e0e0e0 !important;
  color: var(--blue) !important;
  padding: 8px 14px !important;
  font-weight: 600 !important;
  transition:
    background 0.15s,
    color 0.15s !important;
}

.pagination > li.active > a,
.pagination > li.active > span {
  background: var(--blue) !important;
  border-color: var(--blue) !important;
  color: #fff !important;
}

.pagination > li > a:hover {
  background: var(--blue) !important;
  color: #fff !important;
}

/* ============================================================
   FLASH MESSAGE / sys_msg
   ============================================================ */
.alert {
  border-radius: 12px !important;
  border: none !important;
  font-weight: 600 !important;
  padding: 14px 20px !important;
}

.alert-success {
  background: #e8f5e9 !important;
  color: #2e7d32 !important;
}

.alert-danger,
.alert-error {
  background: #ffebee !important;
  color: #c62828 !important;
}

.alert-info {
  background: #e3f2fd !important;
  color: #1565c0 !important;
}

/* ============================================================
   OLD .btn_blue .LinkStyle1 COMPAT
   Map to new button styles so old module buttons look right
   ============================================================ */
.btn_blue,
.btn-primary,
a.add-to-cart.LinkStyle1 {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--blue) !important;
  color: #fff !important;
  border: none !important;
  border-radius: 10px !important;
  padding: 10px 20px !important;
  font-weight: 700 !important;
  font-size: 15px !important;
  font-family: var(--font) !important;
  cursor: pointer;
  text-decoration: none !important;
  transition: background 0.18s !important;
}

.btn_blue:hover,
.btn-primary:hover,
a.add-to-cart.LinkStyle1:hover {
  background: var(--blue-hover) !important;
  color: #fff !important;
}

.btn_red,
.btn-danger {
  background: var(--red-badge) !important;
  color: #fff !important;
  border: none !important;
  border-radius: 10px !important;
  padding: 10px 20px !important;
  font-weight: 700 !important;
}

/* ============================================================
   MOBILE RESPONSIVE — inner pages
   ============================================================ */
@media (max-width: 600px) {
  .container {
    padding-left: 14px !important;
    padding-right: 14px !important;
  }
  .pageTitle {
    font-size: 18px;
  }
  #product_details_data h5 {
    font-size: 17px;
  }
  .product-detail-actions .qty-control {
    padding: 4px 10px;
  }
  .product-detail-actions .btn-add,
  .product-detail-actions .btn-buy {
    font-size: 13px;
    padding: 10px 8px;
  }
}
/* ============================================================
   PRODUCT.CSS — صفحة المنتج
   ============================================================ */

.product-main {
  padding: 28px 0 48px;
}

/* ========================
   PRODUCT LAYOUT — gallery fixed, details = 2×200+10 = 410px
   ======================== */
/* Desktop: flex layout so the gallery column can be sticky over the whole details height */
.product-layout {
  display: flex;
  gap: 40px;
  align-items: flex-start;
  margin-bottom: 56px;
}

.product-gallery {
  flex: 0 0 420px;
  align-self: flex-start;
}

.gallery-sticky {
  position: sticky;
  top: 90px;
  align-self: flex-start;
}

.product-details {
  flex: 1 1 auto;
  min-width: 0;
}

.product-actions {
  width: 100%;
  max-width: 420px;
}

/* ========================
   PRODUCT DETAILS (right col)
   ======================== */
.product-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #fff;
  color: var(--red-badge);
  border: 2px solid var(--red-badge);
  font-size: 15px;
  font-weight: 800;
  padding: 6px 16px 6px 10px;
  border-radius: 999px;
  margin-bottom: 14px;
  letter-spacing: 0.02em;
  position: static;
}

.product-badge::before {
  content: '';
  display: inline-block;
  width: 18px;
  height: 18px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23e53935' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.426 2.426 0 0 0 3.42 0l6.58-6.58a2.426 2.426 0 0 0 0-3.42z'/%3E%3Ccircle cx='7.5' cy='7.5' r='1.2' fill='%23e53935' stroke='none'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-size: contain;
  flex-shrink: 0;
}

.product-title {
  font-size: 28px;
  font-weight: 700;
  color: var(--text-dark);
  line-height: 1.4;
  margin-bottom: 16px;
  direction: rtl;
}

.product-price-row {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 18px;
  direction: ltr;
  justify-content: flex-end;
}

.pd-new-price {
  font-size: 36px;
  font-weight: 800;
  color: var(--blue);
  display: flex;
  align-items: center;
  gap: 6px;
}

.pd-new-price .riyal-blue { height: 24px; }

.pd-old-price {
  font-size: 18px;
  font-weight: 500;
  color: var(--text-light);
  text-decoration: line-through;
  display: flex;
  align-items: center;
  gap: 5px;
}

.pd-old-price .riyal-grey { height: 14px; }

.product-desc {
  font-size: 15px;
  color: var(--text-mid);
  margin-bottom: 18px;
  line-height: 1.6;
}

/* Features list */
.product-features {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 9px;
  margin-bottom: 28px;
  border-top: 1px solid var(--border);
  padding-top: 18px;
}

.product-features li {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14.5px;
  color: var(--text-mid);
}

.product-features .check {
  color: #2e7d32;
  font-size: 15px;
  font-weight: 700;
  flex-shrink: 0;
}

.product-features svg {
  flex-shrink: 0;
}

/* Qty + Buttons */
.product-actions {
  border-top: 1px solid var(--border);
  padding-top: 22px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 100%;
  max-width: 420px;
}

.pd-qty-row {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
}

/* "الكمية" label — 70px */
.qty-label {
  font-size: 20px;
  font-weight: 600;
  color: var(--text-dark);
  flex-shrink: 0;
  width: 70px;
  text-align: center;
}

/* الـ qty control يملأ الباقي = 410 - 200 - 12 gap = 198px ≈ زرار شراء الآن */
.pd-qty {
  flex: 1;
  padding: 7px 14px;
  gap: 12px;
  border: 1.5px solid #8FD2FF;
  border-radius: 10px;
  justify-content: space-between;
}

.pd-qty .qty-btn { font-size: 20px; width: 26px; height: 26px; }
.pd-qty .qty-val { font-size: 18px; min-width: 26px; text-align: center; }

.pd-btns {
  display: flex;
  gap: 10px;
}

.pd-btns .btn-add,
.pd-btns .btn-buy {
  flex: none !important;
  width: 200px !important;
}

.pd-btn-add {
  background: var(--blue-light);
  color: var(--blue);
  font-size: 22px;
  font-weight: 800;
  padding: 13px 12px;
  border-radius: 10px;
  text-align: center;
  transition: transform 0.18s, box-shadow 0.18s;
  cursor: pointer;
  border: none;
  font-family: var(--font);
  width: 200px;
}

.pd-btn-add:hover {
  transform: scale(1.03);
  box-shadow: 0 4px 14px rgba(26,111,181,0.15);
}

.pd-btn-buy {
  background: var(--blue);
  color: #fff;
  font-size: 22px;
  font-weight: 800;
  padding: 13px 12px;
  border-radius: 10px;
  text-align: center;
  transition: transform 0.18s, box-shadow 0.18s;
  cursor: pointer;
  border: none;
  font-family: var(--font);
  width: 200px;
}

.pd-btn-buy:hover {
  transform: scale(1.03);
  box-shadow: 0 4px 14px rgba(26,111,181,0.28);
}

/* ========================
   GALLERY (left col) — مربع
   ======================== */
.product-gallery {
  display: flex;
  flex-direction: column;
  gap: 12px;
  position: sticky;
  top: 90px;
}

.gallery-main {
  background: #f4f8fb;
  border: 1.5px solid var(--blue-light);
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  aspect-ratio: 1 / 1;
  overflow: hidden;
}

.gallery-main img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: transform 0.3s, opacity 0.12s ease;
}

.gallery-main img:hover { transform: scale(1.05); }

.gallery-thumbs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  width: 100%;
}

/* لو في أكثر من 4 صور — slider أفقي */
.gallery-thumbs.has-slider {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  gap: 8px;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.gallery-thumbs.has-slider::-webkit-scrollbar { display: none; }

.thumb {
  width: 100%;
  aspect-ratio: 1 / 1;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  background: #f9fafb;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px;
  cursor: pointer;
  transition: border-color 0.18s;
  overflow: hidden;
  flex-shrink: 0;
  scroll-snap-align: start;
}

.gallery-thumbs.has-slider .thumb {
  width: calc(25% - 6px);
  min-width: calc(25% - 6px);
}

.thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.thumb:hover { border-color: var(--blue-light); }
.thumb.active { border-color: var(--blue); border-width: 2px; }

/* ========================
   RELATED SECTION
   ======================== */
.related-section {
  border-top: 1px solid var(--border);
  padding-top: 36px;
}

.related-section .section-title {
  margin-bottom: 20px;
}

/* ========================
   RESPONSIVE — TABLET
   ======================== */
@media (max-width: 1024px) and (min-width: 601px) {
  .product-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-bottom: 36px;
  }

  .product-title { font-size: 22px; }
  .pd-new-price { font-size: 28px; }
  .pd-new-price .riyal-blue { height: 19px; }
  .pd-old-price { font-size: 16px; }
  .gallery-main { min-height: 280px; padding: 20px; }
  .gallery-main img { max-height: 240px; }
  .product-gallery { top: 76px; }
}

/* ========================
   RESPONSIVE — MOBILE
   ======================== */
@media (max-width: 600px) {
  .product-main { padding: 16px 0 28px; }

  /* Stack: gallery on top, details below, actions last */
  .product-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
    margin-bottom: 28px;
  }

  .product-gallery,
  .product-details,
  .product-actions,
  .gallery-sticky {
    grid-column: auto;
    grid-row: auto;
    position: static;
  }

  .product-gallery {
    position: static;
  }

  .gallery-main {
    padding: 20px;
    border-radius: 12px;
  }

  .gallery-main img { max-height: 100%; }

  .gallery-thumbs { gap: 6px; }
  .thumb { aspect-ratio: 1/1; width: 100%; border-radius: 8px; }

  .product-title { font-size: 20px; margin-bottom: 12px; }
  .pd-new-price { font-size: 28px; }
  .pd-new-price .riyal-blue { height: 19px; }
  .pd-old-price { font-size: 15px; }
  .product-price-row { margin-bottom: 14px; }

  .product-features li { font-size: 13.5px; }
  .product-features { gap: 8px; }

  .pd-qty-row { justify-content: space-between; }
  .pd-btn-buy, .pd-btn-add { font-size: 14px; padding: 12px 8px; }

  .related-section { padding-top: 24px; }
}
/* ============================================================
   PAGES.CSS — السلة، الـ Checkout، تسجيل الدخول
   ============================================================ */

/* ========================
   CART PAGE
   ======================== */
.cart-main {
  padding: 28px 0 48px;
  min-height: 60vh;
}

.cart-layout {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 36px;
  align-items: start;
}

/* Cart table header */
.cart-table-header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 16px;
  background: var(--bg-light);
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-mid);
  margin-bottom: 12px;
}

.ct-product { flex: 1 1 0%; min-width: 0; text-align: right; }
.ct-qty     { width: 120px; text-align: center; flex-shrink: 0; }
.ct-price   { width: 140px; text-align: center; flex-shrink: 0; }
.ct-del     { width: 36px; flex-shrink: 0; }

[dir="ltr"] .ct-product { text-align: left; }

/* Cart item */
.cart-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  margin-bottom: 12px;
  background: #fff;
}

.cart-item-product {
  flex: 1 1 0%;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 14px;
}

.cart-item-thumb {
  width: 80px;
  height: 80px;
  border-radius: 10px;
  background: #f4f8fb;
  border: 1px solid var(--blue-light);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px;
  flex-shrink: 0;
}

.cart-item-thumb img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.cart-item-info {
  flex: 1 1 0%;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.cart-item-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--blue);
  text-decoration: none;
  word-break: break-word;
  white-space: normal;
}

.cart-item-name:hover { text-decoration: underline; }

.cart-item-sub {
  font-size: 12px;
  color: var(--text-light);
}

.cart-item-qty {
  width: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 4px 10px;
  flex-shrink: 0;
}

.cart-item-price {
  width: 140px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  flex-shrink: 0;
  gap: 3px;
}

.cart-item-price .cart-old-price,
.cart-item-price del {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-light, #888);
  text-decoration: line-through;
  display: block;
  line-height: 1.2;
}

.cart-item-price .new-price {
  font-size: 20px;
  font-weight: 800;
  color: var(--blue);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  line-height: 1.2;
  align-self: center;
}

.cart-item-price .new-price b {
  font-size: 18px;
  font-weight: 700;
}

.cart-item-del {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  color: var(--text-light);
  padding: 6px;
  border-radius: 6px;
  transition: color 0.15s, background 0.15s;
  flex-shrink: 0;
  border: none;
  cursor: pointer;
}

.cart-item-del:hover { color: #e53935; background: #fff5f5; }

/* Alert links visible from start */
.alert a { color: var(--blue); text-decoration: underline; font-weight: 700; }

/* Cart summary */
.cart-summary {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 22px;
  position: sticky;
  top: 90px;
}

.cart-summary-title {
  font-size: 17px;
  font-weight: 700;
  margin-bottom: 16px;
  color: var(--text-dark);
}

.cart-summary-table {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 16px;
}

.cs-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 14px;
  color: var(--text-mid);
}

.cs-row:first-child { font-weight: 700; color: var(--text-dark); }

.cs-price {
  display: flex;
  align-items: center;
  gap: 4px;
  color: var(--blue);
  font-weight: 600;
}

.cs-coupon {
  display: flex;
  gap: 8px;
  margin-top: 4px;
  flex-wrap: wrap;
}

.coupon-input {
  flex: 1;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 12px;
  font-family: var(--font);
  font-size: 14px;
  color: var(--text-dark);
  background: #fafafa;
  text-align: right;
  direction: rtl;
}

.coupon-input:focus {
  outline: 2px solid var(--blue-light);
  border-color: var(--blue);
}

.coupon-btn {
  background: var(--blue);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 8px 16px;
  font-family: var(--font);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: filter 0.15s;
}

.coupon-btn:hover { filter: brightness(0.9); }

.cs-delivery-note {
  font-size: 12px;
  color: var(--text-light);
  margin-top: 4px;
}

.cs-total-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 15px;
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: 16px;
}

.cs-total-price {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 20px;
  font-weight: 800;
  color: var(--blue);
}

.cs-checkout-btn {
  display: block;
  width: 100%;
  background: var(--blue);
  color: #fff;
  font-family: var(--font);
  font-size: 16px;
  font-weight: 800;
  padding: 14px;
  border-radius: 10px;
  text-align: center;
  text-decoration: none;
  margin-bottom: 10px;
  transition: filter 0.18s;
}

.cs-checkout-btn:hover { filter: brightness(0.9); }

.cs-back-btn {
  display: block;
  width: 100%;
  background: #fff;
  color: var(--text-mid);
  border: 1px solid var(--border);
  font-family: var(--font);
  font-size: 15px;
  font-weight: 600;
  padding: 12px;
  border-radius: 10px;
  text-align: center;
  text-decoration: none;
  transition: background 0.15s;
}

.cs-back-btn:hover { background: var(--bg-light); }


/* ========================
   CHECKOUT PAGE
   ======================== */
.checkout-main {
  padding: 28px 0 48px;
  min-height: 60vh;
}

.checkout-layout {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 36px;
  align-items: start;
}

/* Step */
.checkout-step {
  border: 1px solid var(--border);
  border-radius: 14px;
  margin-bottom: 14px;
  overflow: hidden;
  background: #fff;
}

.checkout-step.active { border-color: var(--blue); }
.checkout-step.completed { opacity: 0.85; }

.step-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  cursor: pointer;
}

.step-num {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--bg-light);
  border: 1.5px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  flex-shrink: 0;
}

.checkout-step.active .step-num {
  background: var(--blue);
  color: #fff;
  border-color: var(--blue);
}

.step-check {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #e8f5e9;
  color: #2e7d32;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  flex-shrink: 0;
}

.step-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-dark);
}

.step-done-text {
  font-size: 13.5px;
  color: var(--text-mid);
  padding: 0 20px 14px;
}

.step-body {
  padding: 4px 20px 20px;
}

.step-sub {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-mid);
  margin-bottom: 10px;
}

/* Address options */
.address-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  margin-bottom: 8px;
  font-size: 14px;
  color: var(--text-dark);
}

.address-option.selected {
  border-color: var(--blue);
  background: #f0f8ff;
}

.address-option label { flex: 1; line-height: 1.4; }
.address-option small { font-size: 12px; color: var(--text-light); display: block; }

.address-update, .address-edit {
  background: none;
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: 5px 12px;
  font-family: var(--font);
  font-size: 13px;
  color: var(--blue);
  cursor: pointer;
  transition: background 0.15s;
}

.address-update:hover, .address-edit:hover { background: var(--bg-light); }

.address-warning {
  background: #fff3e0;
  border: 1px solid #ffb74d;
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 13px;
  color: #e65100;
  margin-bottom: 8px;
  line-height: 1.5;
}

.address-add-new {
  background: none;
  border: none;
  color: var(--blue);
  font-family: var(--font);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  padding: 8px 0;
  display: block;
  margin-bottom: 4px;
}

/* Shipping options */
.shipping-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  margin-bottom: 8px;
}

.shipping-option.selected { border-color: var(--blue); background: #f0f8ff; }

.so-info {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  color: var(--text-dark);
}

.so-info div { display: flex; flex-direction: column; gap: 2px; }
.so-info small { font-size: 12px; color: var(--text-light); }

.so-price {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 16px;
  font-weight: 700;
  color: var(--blue);
}

.step-save-btn {
  width: 100%;
  background: var(--blue);
  color: #fff;
  font-family: var(--font);
  font-size: 15px;
  font-weight: 700;
  padding: 13px;
  border-radius: 10px;
  border: none;
  cursor: pointer;
  margin-top: 16px;
  transition: filter 0.15s;
}

.step-save-btn:hover { filter: brightness(0.9); }

/* Payment */
.payment-body { display: flex; flex-direction: column; gap: 10px; }

.payment-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
}

.payment-option.selected { border-color: var(--blue); background: #f0f8ff; }
.payment-option label { flex: 1; font-size: 15px; font-weight: 600; cursor: pointer; }

/* Checkout order summary */
.checkout-order-summary {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 22px;
  position: sticky;
  top: 90px;
}

.checkout-order-summary h3 {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 16px;
}

.cos-items {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}

.cos-item {
  position: relative;
  width: 68px;
  height: 68px;
}

.cos-item img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border: 1.5px solid var(--blue-light);
  border-radius: 10px;
  background: #f4f8fb;
  padding: 6px;
}

.cos-badge {
  position: absolute;
  top: -6px;
  right: -6px;
  background: var(--blue);
  color: #fff;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #fff;
}

.cos-note-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--text-mid);
  cursor: pointer;
  margin-bottom: 14px;
  padding: 10px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.cos-discount {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
  width: 100%;
  overflow: hidden;
}

.cos-discount .coupon-input {
  flex: 1;
  min-width: 0;  /* بيمنع الـ input من الامتداد خارج الـ container */
  font-size: 13px;
  padding: 9px 10px;
}

.cos-discount .coupon-btn {
  flex-shrink: 0;
  font-size: 13px;
  padding: 9px 14px;
  white-space: nowrap;
}

.cos-line {
  font-size: 14px;
  font-weight: 600;
  color: var(--blue);
  text-decoration: underline;
  cursor: pointer;
  margin-bottom: 4px;
}

.cos-return-note {
  font-size: 12px;
  color: var(--text-light);
  margin-bottom: 16px;
}

.cos-totals {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 14px;
}

.cos-total-row {
  display: flex;
  justify-content: space-between;
  font-size: 13.5px;
  color: var(--text-mid);
}

.cos-amount {
  display: flex;
  align-items: center;
  gap: 3px;
  color: var(--blue);
  font-weight: 600;
}

.cos-grand-total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 15px;
  font-weight: 700;
  color: var(--text-dark);
}

.cos-grand-price {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 20px;
  font-weight: 800;
  color: var(--blue);
}


/* ========================
   LOGIN PAGE
   ======================== */
.login-main {
  min-height: calc(100vh - 200px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 16px;
  background: #f4f8fb;
}

.login-modal-wrap {
  width: 100%;
  max-width: 520px;
}

.login-modal {
  background: #fff;
  border-radius: 20px;
  border: 2px solid var(--blue-light);
  padding: 36px 32px 32px;
  position: relative;
  text-align: center;
}

.login-close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background 0.15s;
}

.login-close:hover { background: #fff5f5; }

.login-title {
  font-size: 26px;
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: 8px;
}

.login-sub {
  font-size: 15px;
  color: var(--text-light);
  margin-bottom: 24px;
}

.login-phone-wrap {
  display: flex;
  border: 2px solid var(--blue);
  border-radius: 14px;
  overflow: hidden;
  margin-bottom: 16px;
  direction: ltr;
}

.login-code {
  background: #f0f4f8;
  padding: 14px 18px;
  font-size: 16px;
  font-weight: 600;
  color: var(--text-dark);
  border-left: 1px solid var(--border);
  white-space: nowrap;
}

.login-phone-input {
  flex: 1;
  border: none;
  padding: 14px 16px;
  font-family: var(--font);
  font-size: 16px;
  color: var(--text-dark);
  text-align: right;
  direction: ltr;
  letter-spacing: 1px;
}

.login-phone-input:focus { outline: none; }

.login-whatsapp-btn {
  width: 100%;
  background: var(--blue);
  color: #fff;
  font-family: var(--font);
  font-size: 16px;
  font-weight: 700;
  padding: 15px;
  border-radius: 14px;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 12px;
  transition: filter 0.18s;
}

.login-whatsapp-btn:hover { filter: brightness(0.9); }

.login-sms-btn {
  width: 100%;
  background: #fff;
  color: var(--blue);
  border: 1.5px solid var(--blue);
  font-family: var(--font);
  font-size: 15px;
  font-weight: 600;
  padding: 14px;
  border-radius: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: background 0.15s;
}

.login-sms-btn:hover { background: #f0f8ff; }

/* OTP */
.otp-desc {
  font-size: 14px;
  color: var(--text-mid);
  margin-bottom: 16px;
}

.otp-inputs {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin-bottom: 16px;
  direction: ltr;
}

.otp-box {
  width: 48px;
  height: 56px;
  border: 2px solid var(--border);
  border-radius: 10px;
  font-family: var(--font);
  font-size: 22px;
  font-weight: 700;
  text-align: center;
  color: var(--text-dark);
  transition: border-color 0.15s;
}

.otp-box:focus { outline: none; border-color: var(--blue); }

.otp-resend {
  font-size: 13px;
  color: var(--text-light);
  margin-top: 12px;
}

.otp-resend-btn {
  background: none;
  border: none;
  color: var(--blue);
  font-family: var(--font);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: underline;
}

/* ========================
   RESPONSIVE — TABLET
   ======================== */
@media (max-width: 1024px) and (min-width: 601px) {
  .cart-layout { grid-template-columns: 1fr 320px; gap: 24px; }
  .checkout-layout { grid-template-columns: 1fr 300px; gap: 24px; }
}

/* ========================
   RESPONSIVE — MOBILE
   ======================== */
@media (max-width: 600px) {
  .cart-layout { grid-template-columns: 1fr; }
  .cart-summary { position: static; }
  .cart-table-header { display: none; }
  .cart-item {
    flex-wrap: wrap;
    gap: 12px;
    padding: 12px;
  }
  .cart-item-product {
    width: 100%;
    flex: 1 1 100%;
  }
  .cart-item-thumb { width: 64px; height: 64px; }
  .cart-item-qty {
    width: auto;
    flex: 0 0 auto;
  }
  .cart-item-price {
    width: auto;
    flex: 1 1 auto;
    align-items: center;
    min-width: 60px;
  }
  .cart-item-del {
    flex-shrink: 0;
  }

  .checkout-layout { grid-template-columns: 1fr; }
  .checkout-order-summary { position: static; order: -1; }

  .login-modal { padding: 28px 18px 24px; }
  .login-title { font-size: 22px; }
  .otp-box { width: 40px; height: 48px; font-size: 18px; }
}

/* ========================
   CHECKOUT EXTRA STYLES
   ======================== */
.checkout-step.locked {
  opacity: 0.5;
  pointer-events: none;
}

.checkout-step.locked .step-header { cursor: default; }

.checkout-step.completed .step-num { display: none; }
.checkout-step.completed .step-check { display: flex !important; }

.step-field {
  margin-bottom: 14px;
}

.step-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-mid);
  margin-bottom: 6px;
}

.step-input {
  width: 100%;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  padding: 11px 14px;
  font-family: var(--font);
  font-size: 15px;
  color: var(--text-dark);
  background: #fafafa;
  transition: border-color 0.15s;
  text-align: right;
  direction: rtl;
}

.step-input:focus {
  outline: none;
  border-color: var(--blue);
  background: #fff;
}

.phone-row {
  display: flex;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  transition: border-color 0.15s;
}

.phone-row:focus-within { border-color: var(--blue); }

.phone-code {
  background: #f0f4f8;
  padding: 11px 16px;
  font-size: 15px;
  font-weight: 600;
  color: var(--text-dark);
  border-left: 1px solid var(--border);
  white-space: nowrap;
  direction: ltr;
}

.phone-inp {
  flex: 1;
  border: none;
  border-radius: 0;
  direction: ltr;
  text-align: left;
}

.phone-inp:focus { outline: none; background: #fff; }

/* Cart empty state */
.cart-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  gap: 16px;
  color: var(--text-light);
}

.cart-empty p { font-size: 16px; font-weight: 500; }

/* Order success */
.order-success-main {
  min-height: 60vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
}

.order-success-box {
  text-align: center;
  max-width: 480px;
}

.success-icon {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: #e8f5e9;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 24px;
  font-size: 36px;
}

.success-title {
  font-size: 28px;
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: 10px;
}

.success-sub {
  font-size: 16px;
  color: var(--text-mid);
  margin-bottom: 32px;
  line-height: 1.6;
}

.success-order-num {
  background: var(--bg-light);
  border-radius: 12px;
  padding: 14px 24px;
  font-size: 15px;
  color: var(--text-mid);
  margin-bottom: 28px;
  display: inline-block;
}

.success-order-num strong { color: var(--blue); font-size: 18px; }

/* Address form in checkout step 2 */
.address-form {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin-bottom: 12px;
}

/* ============================================================
   TOAST PREMIUM NOTIFICATION � custom rewrite
   ============================================================ */
.toast-premium {
  background: var(--white);
  border: 1.5px solid var(--blue-light);
  border-radius: 16px;
  width: 320px;
  max-width: 100%;
  box-shadow: 0 10px 30px rgba(26, 111, 181, 0.15);
  padding: 16px;
  animation: toastPremiumIn 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  transition: opacity 0.3s, transform 0.3s;
  pointer-events: auto;
}

.toast-premium.toast-out {
  opacity: 0;
  transform: translateY(-10px);
}

.toast-premium-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.toast-premium-title {
  font-size: 14px;
  font-weight: 700;
  color: #2e7d32;
}

.toast-premium-product {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
  background: var(--bg-light);
  padding: 10px;
  border-radius: 10px;
}

.toast-product-img {
  width: 50px;
  height: 50px;
  object-fit: contain;
  background: var(--white);
  border-radius: 8px;
  border: 1px solid var(--border);
  padding: 4px;
  flex-shrink: 0;
}

.toast-product-info {
  flex: 1;
  min-width: 0;
}

.toast-product-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-dark);
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.toast-premium-actions {
  display: flex;
  justify-content: flex-end;
}

.toast-cart-btn {
  background: var(--blue);
  color: var(--white) !important;
  font-size: 13px;
  font-weight: 700;
  padding: 8px 16px;
  border-radius: 8px;
  text-decoration: none;
  transition: background 0.15s;
  text-align: center;
  width: 100%;
}

.toast-cart-btn:hover {
  background: var(--blue-hover);
}

@keyframes toastPremiumIn {
  from { opacity: 0; transform: translateY(15px); }
  to   { opacity: 1; transform: translateY(0); }
}

.toast-content {
  display: flex;
  align-items: center;
  gap: 10px;
}

.toast-icon-success {
  color: #2e7d32;
}

.toast-icon-error {
  color: #c62828;
}

.toast-msg {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-dark);
}

/* ============================================================
   PHONE (+966) FIELD — address forms (modal_address / myaddress)
   ============================================================ */
.phone-wrap {
  border-radius: 12px;
}

.phone-wrap > .form-control {
  height: 46px;
  border-radius: 0 12px 12px 0 !important; /* input sits on the right in RTL */
  border: 1.5px solid #dfe3e8;
  padding: 0 14px;
}

.phone-wrap .phone-prefix {
  height: 46px;
  display: flex;
  align-items: center;
  background: var(--blue) !important;
  color: #fff;
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.4px;
  border: none !important;
  padding: 0 16px;
  min-width: 62px;
  justify-content: center;
  border-radius: 12px 0 0 12px !important; /* +966 sits on the left in RTL */
  white-space: nowrap;
}

.phone-wrap:focus-within > .form-control {
  border-color: var(--blue);
  box-shadow: 0 0 0 2.5px rgba(26, 111, 181, 0.14);
}

@media (max-width: 600px) {
  /* Keep long product prices compact on mobile cards and detail pages. */
  .product-card .new-price,
  .product-card .new-price.only-price {
    font-size: 21px;
    gap: 3px;
  }
  .product-card .old-price {
    font-size: 13px;
    gap: 3px;
  }
  .product-card .riyal-blue {
    height: 15px;
  }
  .product-card .riyal-grey {
    height: 11px;
  }
  .pd-new-price {
    font-size: 23px;
  }
  .pd-new-price .riyal-blue {
    height: 17px;
  }
  .pd-old-price {
    font-size: 14px;
  }
}
