/* ===========================================
   RZG Design System — WhiteTail Clone
   Brand: رزق - Organic Products Store
   Colors: Primary Green #183833, Orange #d38302
   =========================================== */

/* --- Self-hosted Tajawal (fallback for hosts that block Google Fonts) --- */
@font-face {
  font-family: 'Tajawal';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/tajawal/tajawal-400-arabic.woff2') format('woff2');
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC;
}
@font-face {
  font-family: 'Tajawal';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/tajawal/tajawal-400-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Tajawal';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('../fonts/tajawal/tajawal-500-arabic.woff2') format('woff2');
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC;
}
@font-face {
  font-family: 'Tajawal';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('../fonts/tajawal/tajawal-500-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Tajawal';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('../fonts/tajawal/tajawal-700-arabic.woff2') format('woff2');
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC;
}
@font-face {
  font-family: 'Tajawal';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('../fonts/tajawal/tajawal-700-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Tajawal';
  font-style: normal;
  font-weight: 800;
  font-display: swap;
  src: url('../fonts/tajawal/tajawal-800-arabic.woff2') format('woff2');
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC;
}
@font-face {
  font-family: 'Tajawal';
  font-style: normal;
  font-weight: 800;
  font-display: swap;
  src: url('../fonts/tajawal/tajawal-800-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* --- Self-hosted Aref Ruqaa (fallback for hosts that block Google Fonts) --- */
@font-face {
  font-family: 'Aref Ruqaa';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/aref-ruqaa/aref-ruqaa-400.woff2') format('woff2');
}
@font-face {
  font-family: 'Aref Ruqaa';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('../fonts/aref-ruqaa/aref-ruqaa-700.woff2') format('woff2');
}

/* --- Base & Reset Helpers --- */
html { scroll-behavior: smooth; }
*, *::before, *::after { box-sizing: border-box; }
body { font-family: 'Tajawal', sans-serif; }
img { max-width: 100%; height: auto; }
a { text-decoration: none; color: inherit; }

/* --- Scrollbar --- */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: #f9fafb; }
::-webkit-scrollbar-thumb { background: #183833; border-radius: 3px; }

/* --- Buttons --- */
.btn-primary-rzg {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  padding: 0.75rem 2rem; background: #183833; color: #fff; font-weight: 700;
  border-radius: 9999px; border: 2px solid #183833; cursor: pointer;
  transition: all .25s ease; font-family: inherit; font-size: 0.85rem;
  text-transform: uppercase; letter-spacing: 0.05em;
}
.btn-primary-rzg:hover { background: #ff5c35; border-color: #ff5c35; color: #fff; }

.btn-outline-rzg {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  padding: 0.75rem 2rem; background: transparent; color: #183833; font-weight: 700;
  border-radius: 9999px; border: 2px solid #183833; cursor: pointer;
  transition: all .25s ease; font-family: inherit; font-size: 0.85rem;
  text-transform: uppercase; letter-spacing: 0.05em;
}
.btn-outline-rzg:hover { background: #183833; color: #fff; }

.btn-orange-rzg {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  padding: 0.75rem 2rem; background: #d38302; color: #fff; font-weight: 700;
  border-radius: 9999px; border: 2px solid #d38302; cursor: pointer;
  transition: all .25s ease; font-family: inherit; font-size: 0.85rem;
}
.btn-orange-rzg:hover { background: #b06e01; border-color: #b06e01; color: #fff; }

.btn-sm { padding: 0.5rem 1.25rem; font-size: 0.8rem; }
.btn-lg { padding: 0.9rem 2.4rem; font-size: 1rem; }

/* --- Script Subtitle (Cursive accent text above headings) --- */
.script-subtitle {
  font-family: 'Aref Ruqaa', serif;
  color: #ff5c35;
  font-size: 2.35rem;
  font-weight: 400;
  display: block;
  margin-bottom: 0.25rem;
}

/* --- Section Title --- */
.section-title-rzg {
  font-size: 1.75rem; font-weight: 800; color: #1f2937;
  text-transform: uppercase; letter-spacing: 0.02em;
  position: relative; display: inline-block;
}
.section-title-rzg::after { display: none; }
.section-title-rzg.centered { text-align: center; }

/* --- Product Card (WhiteTail Style) --- */
.product-card {
  background: #fff; border-radius: 0; overflow: hidden;
  transition: all .3s ease; position: relative;
}
.product-card:hover {
  box-shadow: none; transform: none;
}
.product-card-img {
  position: relative; overflow: hidden; aspect-ratio: 1 / 1; background: #fff;
  padding: 1rem;
}
.product-card-img img {
  width: 100%; height: 100%; object-fit: contain; transition: transform .5s ease;
}
.product-card:hover .product-card-img img { transform: scale(1.04); }

/* Hover actions (vertical strip on right edge) */
.product-card-actions {
  position: absolute; top: 0.75rem; left: 0.75rem;
  display: flex; flex-direction: column; gap: 0.4rem;
  opacity: 0; transition: opacity .3s ease; background: transparent;
  inset: auto;
}
.product-card:hover .product-card-actions { opacity: 1; }
.product-card-actions a,
.product-card-actions button {
  width: 34px; height: 34px; border-radius: 50%; background: #fff;
  display: flex; align-items: center; justify-content: center;
  color: #374151; border: 1px solid #e5e7eb; cursor: pointer; transition: all .2s;
  font-size: 0.8rem; box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}
.product-card-actions a:hover,
.product-card-actions button:hover { background: #183833; color: #fff; border-color: #183833; }

.product-card-badges {
  position: absolute; top: 0.75rem; right: 0.75rem;
  display: flex; flex-direction: column; gap: 0.35rem; z-index: 2;
}

.product-card-body {
  padding: 0.75rem 1rem 1rem;
  display: flex; flex-direction: column; gap: 0.35rem;
}

/* Cart icon button on product card */
.product-card-cart-btn {
  width: 38px; height: 38px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: #fff; border: 1px solid #e5e7eb; cursor: pointer;
  color: #374151; font-size: 0.85rem; transition: all .2s;
  flex-shrink: 0;
}
.product-card-cart-btn:hover { background: #183833; color: #fff; border-color: #183833; }

/* --- Badge Labels --- */
.badge-sale {
  background: #d38302; color: #fff; padding: 0.2rem 0.65rem;
  border-radius: 9999px; font-size: 0.7rem; font-weight: 700;
}
.badge-out {
  background: transparent; color: #1f2937; padding: 0.25rem 0.75rem;
  border-radius: 0.25rem; font-size: 0.7rem; font-weight: 600;
  border: 1px solid #d1d5db;
}

/* --- Star Rating --- */
.product-ratting ul {
  display: flex; gap: 2px; list-style: none; padding: 0; margin: 0;
}
.product-ratting ul li a,
.product-ratting ul li { color: #f59e0b; font-size: 0.75rem; }
.product-ratting ul li a { text-decoration: none; }
.product-ratting .review-total a { color: #6b7280; font-size: 0.8rem; }

/* --- Quantity Plus/Minus --- */
.cart-plus-minus {
  display: inline-flex; align-items: center;
  border: 1px solid #e5e7eb; border-radius: 0.25rem; overflow: hidden;
}
.cart-plus-minus .qtybutton {
  width: 36px; height: 38px; display: flex; align-items: center;
  justify-content: center; cursor: pointer; background: #f9fafb;
  font-weight: 600; user-select: none; transition: background .2s;
  font-size: 1rem; color: #374151;
}
.cart-plus-minus .qtybutton:hover { background: #183833; color: #fff; }
.cart-plus-minus .cart-plus-minus-box {
  width: 52px; height: 38px; text-align: center; border: none;
  border-inline: 1px solid #e5e7eb; font-size: 0.9rem;
  font-weight: 600; outline: none; font-family: inherit;
  -moz-appearance: textfield;
}
.cart-plus-minus .cart-plus-minus-box::-webkit-outer-spin-button,
.cart-plus-minus .cart-plus-minus-box::-webkit-inner-spin-button {
  -webkit-appearance: none; margin: 0;
}

/* --- Swiper Custom --- */
.swiper-pagination-bullet { background: #fff !important; opacity: 0.5; width: 10px; height: 10px; }
.swiper-pagination-bullet-active { opacity: 1 !important; }
.swiper-button-next, .swiper-button-prev { color: #fff !important; }
.swiper-button-next::after, .swiper-button-prev::after { font-size: 1.25rem !important; }

/* --- Bootstrap Modal Compat --- */
.modal {
  position: fixed; inset: 0; z-index: 1055; display: none;
  overflow-x: hidden; overflow-y: auto; outline: 0;
}
.modal.show { display: block; }
.modal-dialog {
  position: relative; width: auto; margin: 1.75rem auto;
  max-width: 500px; pointer-events: none;
}
.modal-dialog-centered { display: flex; align-items: center; min-height: 100vh; }
.modal-lg { max-width: 800px; }
.modal-md { max-width: 500px; }
.modal-content {
  position: relative; display: flex; flex-direction: column; width: 100%;
  pointer-events: auto; background: #fff; border-radius: 0.75rem;
  box-shadow: 0 10px 40px rgba(0,0,0,0.15); outline: 0;
}
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1rem 1.25rem; border-bottom: 1px solid #f3f4f6;
}
.modal-body { position: relative; flex: 1 1 auto; padding: 1.25rem; }
.modal-footer {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end;
  gap: 0.5rem; padding: 1rem 1.25rem; border-top: 1px solid #f3f4f6;
}
.modal-backdrop { position: fixed; inset: 0; z-index: 1050; background: #000; }
.modal-backdrop.show { opacity: 0.5; }
.modal-backdrop.fade { opacity: 0; transition: opacity .15s linear; }
body.modal-open { overflow: hidden; }
.fade { transition: opacity .15s linear; }
.fade:not(.show) { opacity: 0; }
.modal.fade .modal-dialog { transform: translateY(-30px); transition: transform .2s ease-out; }
.modal.show .modal-dialog { transform: translateY(0); }
.btn-close {
  background: transparent url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23000'%3e%3cpath d='M.293.293a1 1 0 0 1 1.414 0L8 6.586 14.293.293a1 1 0 1 1 1.414 1.414L9.414 8l6.293 6.293a1 1 0 0 1-1.414 1.414L8 9.414l-6.293 6.293a1 1 0 0 1-1.414-1.414L6.586 8 .293 1.707a1 1 0 0 1 0-1.414z'/%3e%3c/svg%3e") center/1em auto no-repeat;
  border: 0; border-radius: .375rem; width: 1.5em; height: 1.5em;
  padding: .25em; cursor: pointer; opacity: .5;
}
.btn-close:hover { opacity: 1; }
.close {
  background: none; border: none; font-size: 1.5rem; cursor: pointer;
  line-height: 1; padding: 0.25rem; opacity: 0.5;
}
.close:hover { opacity: 1; }

/* --- Alert --- */
.alert {
  position: relative; padding: 0.75rem 1rem; border-radius: 0.5rem;
  font-size: 0.9rem;
}
.alert-danger { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }
.alert-success { background: #f0fdf4; color: #166534; border: 1px solid #bbf7d0; }
.alert-warning { background: #fffbeb; color: #92400e; border: 1px solid #fde68a; }
.alert-info { background: #eff6ff; color: #1e40af; border: 1px solid #bfdbfe; }
.alert-dismissible { padding-inline-end: 3rem; }
.alert-dismissible .btn-close {
  position: absolute; top: 50%; transform: translateY(-50%);
  inset-inline-end: 0.75rem;
}

/* --- Tab System --- */
.rzg-tab-btn {
  padding: 0.5rem 1.25rem; font-weight: 600; font-size: 0.9rem;
  border-radius: 9999px; cursor: pointer; transition: all .2s;
  background: transparent; color: #6b7280; border: 2px solid transparent;
  font-family: inherit;
}
.rzg-tab-btn:hover { color: #183833; }
.rzg-tab-btn.active { background: #183833; color: #fff; border-color: #183833; }

/* --- Mini Cart Sidebar --- */
.mini-cart-item { display: flex; gap: 0.75rem; padding: 0.75rem 0; border-bottom: 1px solid #f3f4f6; }
.mini-cart-img { position: relative; width: 64px; height: 64px; flex-shrink: 0; border-radius: 0.5rem; overflow: hidden; }
.mini-cart-img img { width: 100%; height: 100%; object-fit: cover; }
.mini-cart-item-delete {
  position: absolute; top: -4px; right: -4px; width: 20px; height: 20px;
  background: #dc2626; color: #fff; border-radius: 50%; display: flex;
  align-items: center; justify-content: center; font-size: 0.6rem;
  cursor: pointer; transition: background .2s;
}
.mini-cart-item-delete:hover { background: #b91c1c; }
.mini-cart-info h6 { font-size: 0.85rem; font-weight: 600; margin: 0 0 0.15rem; line-height: 1.3; }
.mini-cart-info h6 a { color: #1f2937; }
.mini-cart-info h6 a:hover { color: #183833; }
.mini-cart-quantity { font-size: 0.8rem; color: #183833; font-weight: 600; }
.mini-cart-unit { font-size: 0.75rem; color: #9ca3af; margin: 2px 0; }
.mini-cart-sub-total { display: flex; justify-content: space-between; align-items: center; padding: 0.75rem 0; }
.mini-cart-sub-total h5 { margin: 0; font-size: 1rem; font-weight: 700; }
.mini-cart-sub-total span { color: #183833; }

/* --- Forms --- */
.rzg-input {
  width: 100%; padding: 0.7rem 1rem; border: 1.5px solid #e5e7eb;
  border-radius: 0.375rem; font-family: inherit; font-size: 0.9rem;
  transition: border-color .2s, box-shadow .2s; outline: none;
  background: #fff;
}
.rzg-input:focus { border-color: #183833; box-shadow: 0 0 0 3px rgba(24,56,51,0.1); }
.rzg-input::placeholder { color: #9ca3af; }
select.rzg-input { appearance: none; cursor: pointer; }
textarea.rzg-input { resize: vertical; min-height: 100px; }

.form-check { padding-right: 1.5em; padding-left: 0; text-align: right; direction: rtl; }
.form-check .form-check-input { float: right; margin-right: -1.5em; margin-left: 0; }
.form-check-label { padding-right: 0.5rem; }

/* --- Product Detail Image Gallery --- */
.product-gallery-thumb img {
  border-radius: 0.25rem; cursor: pointer; border: 2px solid transparent;
  transition: border-color .2s;
}
.product-gallery-thumb img:hover,
.product-gallery-thumb img.active { border-color: #183833; }

/* --- Loading Spinner --- */
@keyframes rzg-spin { to { transform: rotate(360deg); } }
.rzg-spinner {
  width: 24px; height: 24px; border: 3px solid #e5e7eb;
  border-top-color: #183833; border-radius: 50%;
  animation: rzg-spin .6s linear infinite;
}

/* --- Breadcrumb --- */
.rzg-breadcrumb { display: flex; align-items: center; gap: 0.5rem; font-size: 0.85rem; color: #6b7280; }
.rzg-breadcrumb a { color: #183833; }
.rzg-breadcrumb a:hover { text-decoration: underline; }
.rzg-breadcrumb .separator { color: #d1d5db; }

/* --- Account Sidebar --- */
.account-nav a {
  display: flex; align-items: center; gap: 0.75rem; padding: 0.75rem 1rem;
  border-radius: 0.5rem; color: #374151; font-weight: 500;
  transition: all .2s; font-size: 0.9rem;
}
.account-nav a:hover { background: #f0fdf4; color: #183833; }
.account-nav a.active { background: #183833; color: #fff; }
.account-nav a i { width: 1.25rem; text-align: center; }

/* --- Collapse --- */
.collapse { display: none; }
.collapse.show { display: block; }

/* --- Table --- */
table.table { width: 100%; border-collapse: collapse; }
table.table th, table.table td { padding: 0.75rem; text-align: right; border-bottom: 1px solid #f3f4f6; }
table.table thead th { background: #f9fafb; font-weight: 600; font-size: 0.85rem; color: #6b7280; }
table.table-sm th, table.table-sm td { padding: 0.5rem; }

/* --- Scroll Reveal Animations --- */
[data-reveal] {
  opacity: 0;
  filter: blur(6px);
  will-change: opacity, transform, filter;
  transition: opacity 0.9s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.9s cubic-bezier(0.16, 1, 0.3, 1),
              filter 0.9s cubic-bezier(0.16, 1, 0.3, 1);
}
[data-reveal="up"]        { transform: translateY(60px); }
[data-reveal="down"]      { transform: translateY(-60px); }
[data-reveal="left"]      { transform: translateX(80px); }
[data-reveal="right"]     { transform: translateX(-80px); }
[data-reveal="zoom"]      { transform: scale(0.8); }
[data-reveal="zoom-up"]   { transform: scale(0.8) translateY(40px); }
[data-reveal="flip-up"]   { transform: perspective(800px) rotateX(12deg) translateY(50px); transform-origin: bottom center; }
[data-reveal="fade"]      { transform: none; }

[data-reveal].revealed {
  opacity: 1 !important;
  transform: translate(0) scale(1) rotateX(0) !important;
  filter: blur(0) !important;
}

/* Staggered children — JS adds these dynamically */
[data-reveal-child] {
  opacity: 0;
  filter: blur(4px);
  transform: translateY(30px) scale(0.95);
  will-change: opacity, transform, filter;
  transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.7s cubic-bezier(0.16, 1, 0.3, 1),
              filter 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}
[data-reveal-child].revealed {
  opacity: 1 !important;
  transform: translateY(0) scale(1) !important;
  filter: blur(0) !important;
}

/* Hero entrance cascade */
.hero-cascade > * {
  opacity: 0;
  filter: blur(8px);
  transform: translateY(35px);
  transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.8s cubic-bezier(0.16, 1, 0.3, 1),
              filter 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}
.hero-cascade.active > *:nth-child(1) { transition-delay: 0.2s; }
.hero-cascade.active > *:nth-child(2) { transition-delay: 0.45s; }
.hero-cascade.active > *:nth-child(3) { transition-delay: 0.7s; }
.hero-cascade.active > * {
  opacity: 1; filter: blur(0); transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  [data-reveal], [data-reveal-child], .hero-cascade > * {
    opacity: 1 !important; transform: none !important;
    filter: none !important; transition: none !important;
  }
}

/* --- Utility classes --- */
.clearfix::after { content: ''; display: table; clear: both; }
.d-none { display: none !important; }
.btn { cursor: pointer; }
.btn-primary { background: #183833; color: #fff; border: none; padding: 0.5rem 1.25rem; border-radius: 0.375rem; }
.btn-primary:hover { background: #0f2a26; }
.btn-secondary { background: #6b7280; color: #fff; border: none; padding: 0.5rem 1.25rem; border-radius: 0.375rem; }
.btn-secondary:hover { background: #4b5563; }
