/* ============================================
   TADAFUQ THEME — Flow Identity
   Tech-forward e-commerce with cinematic motion
   ============================================ */

/* ===== Reset & Base ===== */
.loading {
  pointer-events: none;
}

[data-qumra-loading="true"] {
  pointer-events: none;
}

.removing {
  transform: translateX(-100%);
  opacity: 0;
  transition: all 0.3s ease;
}

[x-cloak] {
  display: none !important;
}

.line-clamp-1 {
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.line-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.line-clamp-3 {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ===== Body ===== */
.tdq-body {
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ===== Scroll Progress ===== */
.tdq-progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: linear-gradient(90deg, var(--color-primary), var(--color-secondary));
  transform-origin: left;
  transform: scaleX(0);
  z-index: 9999;
  pointer-events: none;
}

[dir="rtl"] .tdq-progress-bar {
  transform-origin: right;
}

/* ===== Header ===== */
.tdq-header {
  position: relative;
  z-index: 50;
}

/* ===== Buttons — Pill shaped with depth ===== */

.c-button--gooey {
  border: 4px solid var(--cta-border);
}

.c-button {
  color: #000;
  font-weight: 700;
  font-size: 16px;
  text-decoration: none;
  padding: 0.9em 1.6em;
  cursor: pointer;
  display: inline-block;
  position: relative;
  z-index: 1;
}

.c-button--gooey {
  color: var(--cta-text);
  text-transform: uppercase;
  letter-spacing: 2px;
  border: 4px solid var(--cta-border);
  position: relative;
  transition: all 700ms ease;
}

.c-button--gooey .c-button__blobs {
  height: 100%;
  filter: url(#goo);
  position: absolute;
  inset: 0;
  z-index: -1;
}

.c-button--gooey .c-button__blobs div {
  background-color: var(--cta-bg);
  width: 34%;
  height: 100%;
  border-radius: 100%;
  position: absolute;
  transform: scale(1.4) translateY(125%);
  transition: all 700ms ease;
}

.c-button--gooey:hover {
  color: var(--cta-hover-text);
}

.c-button--gooey:hover .c-button__blobs div {
  transform: scale(1.4) translateY(0);
}

/* =============== */

.btn-primary {
  background-color: var(--color-primary);
  color: #fff;
  padding: 0.75rem 2rem;
  border-radius: 9999px;
  font-weight: 600;
  font-size: 0.875rem;
  transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  border: none;
  cursor: pointer;
}

.btn-primary:hover {
  background-color: var(--color-primary-dark);
  box-shadow: 0 8px 25px color-mix(in srgb, var(--color-primary) 30%, transparent);
  transform: translateY(-1px);
}

.btn-secondary {
  background-color: transparent;
  color: var(--color-primary);
  border: 1.5px solid var(--color-border);
  padding: 0.75rem 2rem;
  border-radius: 9999px;
  font-weight: 600;
  font-size: 0.875rem;
  transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  cursor: pointer;
}

.btn-secondary:hover {
  background-color: var(--color-primary);
  color: #fff;
  border-color: var(--color-primary);
  transform: translateY(-1px);
}


/* ===== Section Headers — Bold left-aligned ===== */
.section-header {
  text-align: center;
  margin-bottom: 2.5rem;
}

.section-header h2 {
  font-size: clamp(1.5rem, 3vw, 2.25rem);
  font-weight: 800;
  color: var(--color-text);
  letter-spacing: -0.03em;
  line-height: 1.15;
  margin-bottom: 0.5rem;
}

.section-header p {
  color: var(--color-text-secondary);
  font-size: 1rem;
}

/* ===== Swiper — Minimal pills ===== */
.swiper-pagination-bullet {
  background: var(--color-primary) !important;
  opacity: 0.3;
  width: 8px !important;
  height: 8px !important;
  border-radius: 4px !important;
  transition: all 0.4s ease !important;
}

.swiper-pagination-bullet-active {
  opacity: 1 !important;
  width: 28px !important;
}

.swiper-button-next,
.swiper-button-prev {
  color: var(--color-text) !important;
  background: #fff !important;
  width: 44px !important;
  height: 44px !important;
  border-radius: 12px !important;
  border: 1px solid var(--color-border) !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04) !important;
  transition: all 0.3s ease !important;
}

.swiper-button-next::after,
.swiper-button-prev::after {
  font-size: 14px !important;
  font-weight: bold;
}

.swiper-button-next:hover,
.swiper-button-prev:hover {
  background: var(--color-primary) !important;
  color: #fff !important;
  border-color: var(--color-primary) !important;
  box-shadow: 0 6px 20px color-mix(in srgb, var(--color-primary) 25%, transparent) !important;
}

.swiper-outside-pagination .swiper-wrapper {
  align-items: stretch;
}

.swiper-outside-pagination .swiper-slide {
  height: auto;
}

.swiper-outside-pagination {
  overflow-x: clip;
  overflow-y: visible;
}

.swiper-outside-pagination>.swiper-pagination {
  position: relative !important;
  bottom: auto !important;
  margin-top: 1.5rem;
}

/* ===== Scrollbar ===== */
.custom-scrollbar::-webkit-scrollbar {
  width: 4px;
}

.custom-scrollbar::-webkit-scrollbar-track {
  background: transparent;
}

.custom-scrollbar::-webkit-scrollbar-thumb {
  background: var(--color-border);
  border-radius: 2px;
}

.custom-scrollbar::-webkit-scrollbar-thumb:hover {
  background: var(--color-text-secondary);
}

.scrollbar-hide {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

.scrollbar-hide::-webkit-scrollbar {
  display: none;
}

::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--color-border);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--color-text-secondary);
}

/* ===== Toast ===== */
.toast {
  padding: 0.75rem 1.25rem;
  border-radius: 12px;
  color: #fff;
  font-size: 0.875rem;
  font-weight: 500;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  pointer-events: auto;
  animation: toastIn 0.3s ease;
  backdrop-filter: blur(8px);
}

.toast-success {
  background-color: #10b981;
}

.toast-error {
  background-color: #ef4444;
}

.toast-warning {
  background-color: #f59e0b;
}

.toast-info {
  background-color: var(--color-primary);
}

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ===== Unified Panel System ===== */
.tdq-overlay {
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.35);
  z-index: 40;
}

.tdq-panel {
  position: fixed;
  top: 0;
  bottom: 0;
  width: 100%;
  max-width: 420px;
  background: var(--color-background);
  z-index: 50;
  display: flex;
  flex-direction: column;
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.tdq-panel-header {
  flex-shrink: 0;
  padding: 1.25rem 1.25rem 1rem;
  border-bottom: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.tdq-panel-body {
  flex: 1;
  overflow-y: auto;
}

.tdq-panel-footer {
  flex-shrink: 0;
  border-top: 1px solid var(--color-border);
}

/* Direction */
html[dir="rtl"] .tdq-panel-start {
  right: 0;
  transform: translateX(100%);
}

html[dir="ltr"] .tdq-panel-start {
  left: 0;
  transform: translateX(-100%);
}

html[dir="rtl"] .tdq-panel-end {
  left: 0;
  transform: translateX(-100%);
}

html[dir="ltr"] .tdq-panel-end {
  right: 0;
  transform: translateX(100%);
}

.tdq-panel.open {
  transform: translateX(0) !important;
}

/* Cart panel — GSAP handles all motion */
#cart-panel {
  transition: none;
}

#cart-panel.open {
  transform: translateX(0);
}

#cart-overlay {
  opacity: 0;
}

/* Legacy compat */
.overlay {
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.35);
  z-index: 40;
}

.drawer {
  position: fixed;
  top: 0;
  bottom: 0;
  width: 100%;
  max-width: 420px;
  background: #fff;
  z-index: 50;
  overflow-y: auto;
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

html[dir="rtl"] .drawer-start {
  right: 0;
  transform: translateX(100%);
}

html[dir="ltr"] .drawer-start {
  left: 0;
  transform: translateX(-100%);
}

html[dir="rtl"] .drawer-end {
  left: 0;
  transform: translateX(-100%);
}

html[dir="ltr"] .drawer-end {
  right: 0;
  transform: translateX(100%);
}

.drawer.open {
  transform: translateX(0) !important;
}

/* ===== Animations ===== */
@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.animate-fade-in {
  animation: fadeIn 0.3s ease;
}

.animate-slide-up {
  animation: slideUp 0.4s ease;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.animate-spin {
  animation: spin 0.8s linear infinite;
}

@keyframes checkPop {
  0% {
    transform: scale(0);
    opacity: 0;
  }

  50% {
    transform: scale(1.3);
  }

  100% {
    transform: scale(1);
    opacity: 1;
  }
}

.animate-check {
  animation: checkPop 0.4s ease;
}

@keyframes cartItemEnter {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.cart-item-enter {
  animation: cartItemEnter 0.3s ease-out;
}

/* ===== Rating Stars ===== */
.stars {
  display: inline-flex;
  gap: 2px;
}

.stars .star-filled {
  color: #fbbf24;
}

.stars .star-empty {
  color: var(--color-border);
}

/* ===== Price Range Slider ===== */
.price-slider {
  position: relative;
  height: 28px;
  display: flex;
  align-items: center;
}

.price-slider .slider-track {
  position: absolute;
  width: 100%;
  height: 5px;
  background: var(--color-border);
  border-radius: 9999px;
}

.price-slider .slider-range {
  position: absolute;
  height: 5px;
  background: var(--color-primary);
  border-radius: 9999px;
}

.price-slider input[type="range"] {
  position: absolute;
  width: 100%;
  -webkit-appearance: none;
  appearance: none;
  background: transparent;
  pointer-events: none;
  margin: 0;
  padding: 0;
  height: 5px;
  outline: none;
}

.price-slider input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  pointer-events: auto;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: white;
  border: 2.5px solid var(--color-primary);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.price-slider input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.15);
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.18);
}

.price-slider input[type="range"]::-webkit-slider-thumb:active {
  transform: scale(1.2);
}

.price-slider input[type="range"]::-moz-range-thumb {
  pointer-events: auto;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: white;
  border: 2.5px solid var(--color-primary);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
  cursor: pointer;
}

.price-slider input[type="range"]::-moz-range-track {
  background: transparent;
  border: none;
}

/* ===== Selection ===== */
::selection {
  background: color-mix(in srgb, var(--color-primary) 12%, transparent);
  color: var(--color-text);
}

/* ===== Hero (Tadafuq) ===== */
.tdq-hero {
  position: relative;
  background: var(--color-dark-bg);
}

/* Ensure hero images are visible even if GSAP doesn't run */
[data-tdq-hero-img] {
  opacity: 1 !important;
}

.gsap-ready [data-tdq-hero-img] {
  opacity: unset !important;
}

/* ===== Page Transition — "Flow" wipe ===== */
.tdq-transition {
  position: fixed;
  inset: 0;
  z-index: 99999;
  pointer-events: none;
  overflow: hidden;
}

.tdq-transition-layer {
  position: absolute;
  inset: 0;
  transform: translateY(100%);
  will-change: transform;
}

.tdq-transition-layer:nth-child(1) {
  background: var(--color-primary);
}

.tdq-transition-layer:nth-child(2) {
  background: var(--color-dark-bg);
}

/* ===== Cart Page ===== */
.cart-flow-line {
  animation: cartFlowLine 3s linear infinite;
}

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

  100% {
    background-position: -200% 0;
  }
}

.cart-checkout-glow {
  animation: cartCheckoutGlow 2s ease-in-out infinite;
}

@keyframes cartCheckoutGlow {

  0%,
  100% {
    opacity: 0.15;
  }

  50% {
    opacity: 0.3;
  }
}

/* ===== Custom Cursor ===== */
#tdq-cursor {
  transition: width 0.3s, height 0.3s, border-color 0.3s, background 0.3s;
}

#tdq-cursor.cursor-hover {
  width: 48px;
  height: 48px;
  background: var(--color-primary);
  border-color: var(--color-primary);
  mix-blend-mode: normal;
}

#tdq-cursor.cursor-text {
  width: 4px;
  height: 4px;
  background: var(--color-primary);
  border-color: var(--color-primary);
}

/* ===== Image Reveal (clip-path) ===== */
[data-tdq-img-reveal] {
  clip-path: inset(100% 0 0 0);
  transition: clip-path 0.9s cubic-bezier(0.16, 1, 0.3, 1);
}

[data-tdq-img-reveal].revealed {
  clip-path: inset(0 0 0 0);
}

/* ===== Text Split ===== */
.tdq-word {
  display: inline-block;
  overflow: hidden;
  vertical-align: bottom;
}

.tdq-word-inner {
  display: inline-block;
}