/* ===== CSS CUSTOM PROPERTIES ===== */
:root {
  --softpink: #FFF0F5;
  --rosegold: #b76e79;
  --rosegold-light: #d4a0a8;
  --rosegold-dark: #9a5b64;
  --charcoal: #2d2d2d;
  --charcoal-light: #4a4a4a;
  --nude: #f5e6d3;
  --nude-light: #faf0e6;
}

/* ===== BASE ===== */
html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  color: var(--charcoal);
  background-color: #fcfcfc;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ===== TAILWIND CUSTOM EXTENSIONS ===== */
.bg-softpink { background-color: var(--softpink); }
.text-rosegold { color: var(--rosegold); }
.text-rosegold-light { color: var(--rosegold-light); }
.bg-rosegold { background-color: var(--rosegold); }
.text-charcoal { color: var(--charcoal); }
.bg-charcoal { background-color: var(--charcoal); }
.border-rosegold { border-color: var(--rosegold); }
.shadow-rosegold { box-shadow: 0 4px 14px -2px rgba(183, 110, 121, 0.3); }

/* ===== ANIMATIONS ===== */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* SPA view entrance */
.spa-view-fade {
  animation: fadeInSlideUp 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
@keyframes fadeInSlideUp {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes pulse-slow {
  0%, 100% { opacity: 0.4; transform: scale(1); }
  50%      { opacity: 0.7; transform: scale(1.05); }
}

@keyframes shimmer {
  0%   { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

@keyframes toastIn {
  0%   { opacity: 0; transform: translate(-50%, 20px); }
  100% { opacity: 1; transform: translate(-50%, 0); }
}

@keyframes toastOut {
  0%   { opacity: 1; transform: translate(-50%, 0); }
  100% { opacity: 0; transform: translate(-50%, 20px); }
}

.animate-pulse-slow {
  animation: pulse-slow 4s ease-in-out infinite;
}

/* ===== PRODUCT CARD ANIMATIONS ===== */
.product-card {
  animation: fadeInUp 0.5s ease-out both;
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

.product-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
}

.product-card:nth-child(1)  { animation-delay: 0.00s; }
.product-card:nth-child(2)  { animation-delay: 0.05s; }
.product-card:nth-child(3)  { animation-delay: 0.10s; }
.product-card:nth-child(4)  { animation-delay: 0.15s; }
.product-card:nth-child(5)  { animation-delay: 0.20s; }
.product-card:nth-child(6)  { animation-delay: 0.25s; }
.product-card:nth-child(7)  { animation-delay: 0.30s; }
.product-card:nth-child(8)  { animation-delay: 0.35s; }
.product-card:nth-child(9)  { animation-delay: 0.40s; }
.product-card:nth-child(10) { animation-delay: 0.45s; }
.product-card:nth-child(11) { animation-delay: 0.50s; }
.product-card:nth-child(12) { animation-delay: 0.55s; }

/* ===== SHIMMER LOADING ===== */
.shimmer-block {
  background: linear-gradient(90deg, #f0f0f0 25%, #fafafa 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s ease-in-out infinite;
}

/* ===== ORDER ITEMS SCROLLBAR ===== */
#orderItemsList::-webkit-scrollbar { width: 4px; }
#orderItemsList::-webkit-scrollbar-track { background: transparent; }
#orderItemsList::-webkit-scrollbar-thumb { background: var(--rosegold-light); border-radius: 99px; }

/* ===== ORDER SUMMARY DETAILS TOGGLE ===== */
#toggleCartDetailsBtn { cursor: pointer; }
#toggleCartDetailsBtn[aria-expanded="true"] .toggle-icon {
  transform: rotate(180deg);
}

/* ===== CART ITEM QUANTITY INPUT ===== */
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
input[type="number"] { -moz-appearance: textfield; }

/* ===== STAR RATING ===== */
.star-rating .star {
  color: #d4a0a8;
  font-size: 14px;
}
.star-rating .star.filled {
  color: var(--rosegold);
}

/* ===== PRODUCT CARD TEXT TRUNCATION ===== */
.line-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ===== IMAGE FALLBACK ===== */
.img-fallback.img-error {
  display: none !important;
}
.fallback-icon {
  display: none;
}

/* ===== AUTH MODAL ===== */
#modal-auth { opacity: 0; pointer-events: none; transition: opacity 0.3s; }
#modal-auth.open { opacity: 1; pointer-events: auto; }
#modal-auth .auth-card { max-width: 28rem; width: 100%; max-height: 92vh; overflow-y: auto; background: white; border-radius: 1.5rem; box-shadow: 0 25px 60px rgba(0,0,0,0.2); transform: scale(0.92) translateY(12px); transition: transform 0.3s cubic-bezier(0.34,1.56,0.64,1); }
#modal-auth.open .auth-card { transform: scale(1) translateY(0); }
#modal-auth .auth-tab-btn { position: relative; font-size: 0.9rem; font-weight: 600; padding: 0.5rem 0; color: rgba(45,45,45,0.4); transition: color 0.2s; }
#modal-auth .auth-tab-btn.active { color: var(--rosegold); }
#modal-auth .auth-tab-btn::after { content: ''; position: absolute; bottom: -1px; left: 0; width: 100%; height: 2px; background: var(--rosegold); transform: scaleX(0); transition: transform 0.25s; }
#modal-auth .auth-tab-btn.active::after { transform: scaleX(1); }

/* Profile tab buttons */
.profile-tab-btn { position: relative; font-size: 0.8rem; font-weight: 600; padding: 0.5rem 0; color: rgba(45,45,45,0.4); transition: color 0.2s; background: none; border: none; cursor: pointer; }
.profile-tab-btn.active { color: var(--rosegold); }
.profile-tab-btn::after { content: ''; position: absolute; bottom: -1px; left: 0; width: 100%; height: 2px; background: var(--rosegold); transform: scaleX(0); transition: transform 0.25s; }
.profile-tab-btn.active::after { transform: scaleX(1); }

/* Profile tab panels */
.prof-tab-panel { display: block; }

/* Order status badges */
.order-badge { display: inline-flex; align-items: center; gap: 0.25rem; padding: 0.2rem 0.6rem; border-radius: 999px; font-size: 0.7rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; }
.order-badge.pending_confirmation { background: #fef3c7; color: #92400e; }
.order-badge.pending { background: #fef3c7; color: #92400e; }
.order-badge.shipped { background: #dbeafe; color: #1e40af; }
.order-badge.delivered_paid { background: #d1fae5; color: #065f46; }
.order-badge.delivered { background: #d1fae5; color: #065f46; }
.order-badge.cancelled { background: #fee2e2; color: #991b1b; }

/* Floating label input */
.float-label-wrap { position: relative; }
.float-label-wrap input, .float-label-wrap textarea { width: 100%; padding: 1.25rem 1rem 0.4rem; border: 1px solid rgba(183,110,121,0.15); border-radius: 0.875rem; font-size: 0.875rem; color: var(--charcoal); background: #fafafa; outline: none; transition: border-color 0.2s, box-shadow 0.2s, background 0.2s; }
.float-label-wrap input:focus, .float-label-wrap textarea:focus { border-color: var(--rosegold); box-shadow: 0 0 0 3px rgba(183,110,121,0.1); background: white; }
.float-label-wrap input.input-error, .float-label-wrap textarea.input-error { border-color: #ef4444; box-shadow: 0 0 0 3px rgba(239,68,68,0.1); }
.float-label-wrap label { position: absolute; left: 1rem; top: 1.05rem; font-size: 0.875rem; color: rgba(45,45,45,0.4); pointer-events: none; transition: all 0.2s; transform-origin: left; }
.float-label-wrap input:focus ~ label, .float-label-wrap textarea:focus ~ label,
.float-label-wrap input.not-empty ~ label, .float-label-wrap textarea.not-empty ~ label { top: 0.35rem; font-size: 0.65rem; font-weight: 600; color: var(--rosegold); text-transform: uppercase; letter-spacing: 0.05em; }

/* ===== RTL-SAFE RATING NUMBER ===== */
.rtl-ltr {
  direction: ltr;
  display: inline-block;
  unicode-bidi: embed;
}

/* ===== ADD TO CART BUTTON PULSE ===== */
@keyframes addPulse {
  0%   { transform: scale(1); }
  50%  { transform: scale(1.05); }
  100% { transform: scale(1); }
}

.btn-added {
  animation: addPulse 0.3s ease;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 640px) {
  .product-card:nth-child(n) {
    animation-delay: 0s;
  }
  .product-card .add-to-cart {
    font-size: 0.7rem;
    padding: 0.6rem 0.75rem;
  }
}

/* Inline card quantity stepper (home + shop product cards) */
.product-card .qty-stepper {
  flex-shrink: 0;
}

/* Toast animation classes */
.toast-visible {
  opacity: 1 !important;
  transform: translate(-50%, 0) !important;
  pointer-events: auto !important;
}

.toast-hidden {
  opacity: 0 !important;
  transform: translate(-50%, 20px) !important;
  pointer-events: none !important;
}

/* ===== CART OVERLAY TRANSITION ===== */
.cart-overlay-visible {
  opacity: 1 !important;
  pointer-events: auto !important;
}

.cart-drawer-visible {
  transform: translateX(0) !important;
}

/* ===== ARABIC / RTL SUPPORT ===== */
body.lang-ar {
  font-family: 'Tajawal', sans-serif;
}

/* Flip arrow SVGs in RTL */
[dir="rtl"] .flip-x {
  transform: scaleX(-1);
}

/* Language Switcher Button */
.lang-switcher {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  border: 1px solid rgba(183, 110, 121, 0.2);
  color: rgba(45, 45, 45, 0.5);
  background: transparent;
  cursor: pointer;
  transition: all 0.2s;
}
.lang-switcher:hover {
  color: var(--rosegold);
  border-color: var(--rosegold);
}

/* ===== PROMOTIONS ===== */
.promo-slide {
  width: 100%;
  position: relative;
  border-radius: 1rem;
  overflow: hidden;
  min-height: 240px;
  aspect-ratio: 16 / 5;
}
@media (max-width: 639px) {
  .promo-slide { min-height: 200px; aspect-ratio: 16 / 7; }
}
.promo-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  position: absolute;
  inset: 0;
}
.promo-slide .promo-content h3,
.promo-slide .promo-content p {
  text-shadow: 0 1px 6px rgba(0,0,0,0.25);
}
.promo-slide .promo-content {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 2rem 3rem;
  color: white;
  z-index: 1;
}
@media (max-width: 639px) {
  .promo-slide .promo-content { padding: 1.25rem; }
}
.promo-slide .promo-content h3 {
  font-family: 'Playfair Display', serif;
  font-size: 1.75rem;
  font-weight: 700;
  max-width: 80%;
  line-height: 1.2;
}
@media (min-width: 768px) {
  .promo-slide .promo-content h3 { font-size: 2.5rem; }
}
@media (max-width: 639px) {
  .promo-slide .promo-content h3 { font-size: 1.25rem; max-width: 100%; }
}
.promo-slide .promo-content p {
  margin-top: 0.5rem;
  font-size: 0.875rem;
  opacity: 0.85;
  max-width: 60%;
  line-height: 1.5;
}
@media (max-width: 639px) {
  .promo-slide .promo-content p { font-size: 0.75rem; max-width: 100%; }
}
.promo-slide .promo-countdown {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  margin-top: 1rem;
  padding: 0.375rem 0.875rem;
  background: rgba(255,255,255,0.15);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
  align-self: flex-start;
}
.promo-slide .promo-countdown svg {
  width: 0.875rem;
  height: 0.875rem;
}
.promo-dot {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 9999px;
  background: rgba(183, 110, 121, 0.2);
  border: none;
  cursor: pointer;
  transition: all 0.3s;
}
.promo-dot.active {
  width: 1.5rem;
  background: var(--rosegold);
}

/* ===== PROMO SIDE ARROWS ===== */
.promo-side-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 9999px;
  background: rgba(255,255,255,0.9);
  backdrop-filter: blur(4px);
  border: 1px solid rgba(183,110,121,0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(45,45,45,0.6);
  cursor: pointer;
  transition: all 0.25s;
  opacity: 0;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}
#promoCarousel:hover .promo-side-arrow { opacity: 1; }
.promo-side-arrow:hover {
  background: white;
  color: var(--rosegold);
  border-color: var(--rosegold);
  box-shadow: 0 4px 14px rgba(183,110,121,0.25);
}
@media (max-width: 639px) {
  .promo-side-arrow { width: 2rem; height: 2rem; opacity: 1; }
  .promo-side-arrow svg { width: 1rem; height: 1rem; }
}

/* ===== PROMO CLAIM BUTTON ===== */
.claim-offer-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 1rem;
  padding: 0.625rem 1.5rem;
  background: var(--rosegold);
  color: white;
  font-size: 0.8125rem;
  font-weight: 600;
  border: none;
  border-radius: 9999px;
  cursor: pointer;
  transition: all 0.3s;
  align-self: flex-start;
  box-shadow: 0 4px 14px rgba(183,110,121,0.35);
}
.claim-offer-btn:hover {
  background: var(--rosegold-dark, #9a5b64);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(183,110,121,0.45);
}
.claim-offer-btn:active {
  transform: translateY(0);
}

/* ===== ADMIN PROMO BADGE ===== */
.promo-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.2rem 0.6rem;
  background: linear-gradient(135deg, rgba(183,110,121,0.15), rgba(147,51,234,0.12));
  color: var(--rosegold);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  border: 1px solid rgba(183,110,121,0.25);
  border-radius: 9999px;
  white-space: nowrap;
  text-transform: uppercase;
}

/* ===== MOBILE SIDEBAR ===== */
#mobile-sidebar {
  transition: transform 0.3s ease-in-out;
}

/* ===== TICKER MARQUEE ===== */
@keyframes marquee {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}
.animate-marquee {
  animation: marquee var(--marquee-duration, 20s) linear infinite;
}
@media (min-width: 768px) {
  .animate-marquee {
    animation: none;
  }
}

/* ===== SHOP FILTER BUTTONS ===== */
.shop-filter-btn {
  display: inline-flex;
  align-items: center;
  padding: 0.5rem 1.25rem;
  border-radius: 9999px;
  font-size: 0.8125rem;
  font-weight: 500;
  border: 1px solid #e5e7eb;
  background-color: #fff;
  color: #374151;
  transition: all 0.2s ease;
  cursor: pointer;
  white-space: nowrap;
}
.shop-filter-btn:hover {
  border-color: #f472b6;
  color: #db2777;
}
.shop-filter-btn.shop-filter-active {
  background-color: #db2777;
  color: #fff;
  border-color: #db2777;
}

/* ===== SHOP SEARCH INPUT ===== */
.shop-search-input {
  width: 100%;
  max-width: 20rem;
  border: 1px solid #e5e7eb;
  border-radius: 9999px;
  padding: 0.625rem 1.25rem;
  font-size: 0.875rem;
  color: #1e293b;
  background-color: #f9fafb;
  outline: none;
  transition: all 0.2s ease;
}
.shop-search-input:focus {
  border-color: #b76e79;
  background-color: #fff;
  box-shadow: 0 0 0 3px rgba(183, 110, 121, 0.15);
}
.shop-search-input::placeholder {
  color: #9ca3af;
}

/* ===== MOBILE: always show add-to-cart (no hover on touch) ===== */
@media (max-width: 640px) {
  .product-card .add-to-cart {
    opacity: 1 !important;
  }
}

/* ===== HERO SLIDER ENTRY ANIMATIONS ===== */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
.animate-fade-up {
  animation: fadeInUp 0.8s cubic-bezier(0.25, 1, 0.5, 1) forwards;
}

/* ===== ORDER PRINT ===== */
@media print {
  body.printing * {
    visibility: hidden !important;
  }
  body.printing #order-print-area,
  body.printing #order-print-area * {
    visibility: visible !important;
  }
  body.printing #order-print-area {
    display: block !important;
    position: absolute;
    inset: 0;
    width: 100%;
    background: #fff;
  }
  body.printing #floating-cart-bar,
  body.printing #modal-order-summary,
  body.printing #toast {
    display: none !important;
  }
}
