/* ==========================================================================
   BAHAR COSMETICS (لوازم آرایشی و بهداشتی بهار)
   Advanced 3D & Master Animation Stylesheet
   Three.js 3D Viewport, Card 3D Depth Physics, Holographic Sheen, GSAP FX
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. CUSTOM LUXURY CURSOR POINTER (Replaces OS cursor completely)
   -------------------------------------------------------------------------- */
@media (pointer: fine) {
  html,
  body,
  a,
  button,
  input,
  select,
  textarea,
  [role="button"],
  label,
  div,
  span,
  img,
  svg,
  *,
  *::before,
  *::after {
    cursor: none !important;
  }
}

html.custom-cursor-active,
html.custom-cursor-active * {
  cursor: none !important;
}

/* Precision Center Spark Pointer (Cute Strawberry / Cherry Blossom Pink) */
.mc-cursor-dot {
  position: fixed;
  top: 0;
  left: 0;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  pointer-events: none;
  z-index: 99999999;
  background: radial-gradient(circle, #ffffff 0%, #ff4081 55%, #c2185b 100%);
  border: 1.5px solid #ffffff;
  box-shadow: 0 0 14px rgba(255, 64, 129, 0.9), 0 0 4px #ffffff;
  opacity: 0;
  transition: opacity 0.2s ease, background 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
  will-change: transform;
}

/* Adaptive Theme on Light / Cream Backgrounds: Crisp Vibrant Berry-Rose */
.mc-cursor-dot.on-light-bg {
  background: #d81b60 !important;
  border: 1.5px solid #ffffff !important;
  box-shadow: 0 0 12px rgba(216, 27, 96, 0.6), 0 0 3px #d81b60 !important;
}

/* Dynamic Interactive Follower Ring & Context Pill */
.mc-cursor-ring {
  position: fixed;
  top: 0;
  left: 0;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  pointer-events: none;
  z-index: 99999998;
  border: 1.5px solid rgba(255, 64, 129, 0.85);
  background: rgba(255, 64, 129, 0.08);
  box-shadow: 0 0 16px rgba(255, 64, 129, 0.25);
  opacity: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.74rem;
  font-weight: 700;
  color: #ffffff;
  white-space: nowrap;
  transition: width 0.2s cubic-bezier(0.16, 1, 0.3, 1),
              height 0.2s cubic-bezier(0.16, 1, 0.3, 1),
              border-radius 0.2s ease,
              background 0.25s ease,
              border-color 0.25s ease,
              box-shadow 0.25s ease,
              opacity 0.2s ease;
  will-change: transform, width, height;
}

/* Follower Ring on Light Backgrounds: Vibrant Rose */
.mc-cursor-ring.on-light-bg {
  border-color: #d81b60 !important;
  background: rgba(216, 27, 96, 0.08) !important;
  box-shadow: 0 0 14px rgba(216, 27, 96, 0.2) !important;
}

.mc-cursor-ring.on-light-bg.active {
  background: rgba(216, 27, 96, 0.16) !important;
  border-color: #d81b60 !important;
}

/* Hover on interactive targets: smooth circular expansion */
.mc-cursor-ring.active {
  width: 54px;
  height: 54px;
  border-color: #ff4081;
  background: rgba(255, 64, 129, 0.18);
  box-shadow: 0 0 24px rgba(255, 64, 129, 0.45);
}

/* Click state */
.mc-cursor-ring.clicked {
  width: 24px;
  height: 24px;
  border-color: #ffffff;
  background: rgba(255, 64, 129, 0.45);
}

/* Stardust Micro-Trail Particle */
.mc-stardust-trail {
  position: fixed;
  pointer-events: none;
  z-index: 99999990;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #ff4081;
  box-shadow: 0 0 8px #ff4081;
  transform: translate(-50%, -50%);
  animation: stardustFade 0.55s linear forwards;
}

.mc-stardust-trail.on-light-bg {
  background: #d81b60;
  box-shadow: 0 0 8px rgba(216, 27, 96, 0.6);
}

@keyframes stardustFade {
  0% { opacity: 0.9; transform: translate(-50%, -50%) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -50%) scale(0.2); }
}

/* --------------------------------------------------------------------------
   1.5 OFFICIAL NAFIS BRANDS GRID (Strict Single-Row Equal-Height Alignment)
   -------------------------------------------------------------------------- */
.mc-brands-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 22px;
  align-items: stretch;
  margin-bottom: 36px;
}

.mc-brand-card-item {
  background: #ffffff;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(0, 0, 0, 0.08);
  padding: 24px 22px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 18px;
  height: 100%;
  box-sizing: border-box;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.03);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.25s ease, border-color 0.25s ease;
  will-change: transform;
}

.mc-brand-card-item:hover {
  transform: translateY(-5px);
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.09);
}

@media (max-width: 1024px) {
  .mc-brands-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 576px) {
  .mc-brands-grid {
    grid-template-columns: 1fr;
  }
}

/* --------------------------------------------------------------------------
   2. INTERACTIVE 3D PRODUCT SHOWCASE SECTION (Three.js WebGL)
   -------------------------------------------------------------------------- */
.mc-3d-experience-section {
  padding: 80px 0;
  background: radial-gradient(circle at 50% 20%, #361225 0%, #1f0815 70%, #13040d 100%);
  color: #ffffff;
  position: relative;
  overflow: hidden;
  border-top: 1px solid rgba(224, 79, 127, 0.25);
  border-bottom: 1px solid rgba(224, 79, 127, 0.25);
}

/* Ambient Cosmetic Droplet Grid in Background */
.mc-3d-bg-glow {
  position: absolute;
  width: 600px;
  height: 600px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(240, 98, 146, 0.18) 0%, rgba(0, 0, 0, 0) 70%);
  filter: blur(60px);
  pointer-events: none;
  z-index: 1;
}

.mc-3d-experience-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 40px;
  align-items: center;
  position: relative;
  z-index: 2;
}

/* 3D WebGL Stage Container */
.mc-3d-stage-card {
  background: rgba(43, 14, 29, 0.65);
  border: 1px solid rgba(224, 79, 127, 0.35);
  border-radius: var(--radius-xl);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.15);
  position: relative;
  overflow: hidden;
  height: 520px;
  display: flex;
  flex-direction: column;
}

.mc-3d-canvas-wrap {
  width: 100%;
  height: 100%;
  cursor: grab;
  position: relative;
}

.mc-3d-canvas-wrap:active {
  cursor: grabbing;
}

#bahar-3d-showcase-canvas {
  width: 100% !important;
  height: 100% !important;
  display: block;
}

/* Controls & Badges Over 3D Stage */
.mc-3d-stage-header {
  position: absolute;
  top: 18px;
  left: 18px;
  right: 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  pointer-events: none;
  z-index: 10;
}

.mc-3d-pill-badge {
  pointer-events: auto;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(36, 11, 24, 0.85);
  border: 1px solid rgba(224, 79, 127, 0.4);
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  font-size: 0.78rem;
  font-weight: 700;
  color: #ff8da1;
  box-shadow: 0 4px 16px rgba(0,0,0,0.3);
}

.mc-3d-pill-badge span.pulse-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #ff8da1;
  box-shadow: 0 0 10px #ff8da1;
  animation: pulseLight 1.8s infinite;
}

@keyframes pulseLight {
  0% { transform: scale(0.9); opacity: 0.7; }
  50% { transform: scale(1.3); opacity: 1; }
  100% { transform: scale(0.9); opacity: 0.7; }
}

.mc-3d-hint-badge {
  pointer-events: auto;
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.75);
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.12);
  padding: 5px 12px;
  border-radius: var(--radius-pill);
  display: flex;
  align-items: center;
  gap: 6px;
}

.mc-3d-stage-footer {
  position: absolute;
  bottom: 16px;
  left: 18px;
  right: 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 10;
  pointer-events: none;
}

.mc-3d-tools {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 8px;
}

.mc-3d-tool-btn {
  background: rgba(36, 11, 24, 0.85);
  border: 1px solid rgba(224, 79, 127, 0.35);
  color: #ffffff;
  padding: 6px 12px;
  border-radius: var(--radius-pill);
  font-size: 0.76rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: all 0.2s ease;
}

.mc-3d-tool-btn:hover,
.mc-3d-tool-btn.active {
  background: linear-gradient(135deg, #e04f7f 0%, #f06292 100%);
  color: #ffffff;
  border-color: transparent;
  transform: translateY(-2px);
  box-shadow: 0 4px 14px rgba(224, 79, 127, 0.4);
}

/* 3D Showcase Information Card */
.mc-3d-info-col {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.mc-3d-tabs-nav {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(224, 79, 127, 0.2);
  padding: 5px;
  border-radius: var(--radius-pill);
  overflow-x: auto;
}

.mc-3d-tab-btn {
  flex: 1;
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.75);
  padding: 8px 16px;
  border-radius: var(--radius-pill);
  font-size: 0.84rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.25s ease;
}

.mc-3d-tab-btn.active {
  background: linear-gradient(135deg, #e04f7f 0%, #f06292 100%);
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(224, 79, 127, 0.4);
}

.mc-3d-details-pane {
  background: rgba(43, 14, 29, 0.65);
  border: 1px solid rgba(224, 79, 127, 0.3);
  border-radius: var(--radius-lg);
  padding: 28px;
  backdrop-filter: blur(10px);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.mc-3d-product-title {
  font-size: 1.55rem;
  font-weight: 800;
  line-height: 1.4;
  margin-bottom: 12px;
  color: #ffffff;
}

.mc-3d-price-tag {
  font-size: 1.45rem;
  font-weight: 800;
  color: #ff8da1;
  margin-bottom: 16px;
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.mc-3d-price-tag small {
  font-size: 0.85rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.65);
}

.mc-3d-benefits-list {
  list-style: none;
  padding: 0;
  margin: 0 0 24px 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.mc-3d-benefits-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.88rem;
  color: rgba(255, 255, 255, 0.85);
}

.mc-3d-benefits-list li span.bullet {
  color: var(--accent-gold-light);
  font-size: 1.1rem;
}

/* --------------------------------------------------------------------------
   3. TRUE 3D DEPTH ON ALL PRODUCT CARDS & HOLOGRAPHIC SHEEN
   -------------------------------------------------------------------------- */
.mc-product-card {
  perspective: 1000px !important;
  transform-style: preserve-3d !important;
  transition: transform 0.18s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.25s ease !important;
  position: relative !important;
  will-change: transform;
}

.mc-product-card:hover {
  box-shadow: 0 22px 40px rgba(20, 25, 18, 0.18), 0 0 0 1px rgba(223, 190, 126, 0.45) !important;
}

/* Dynamic Holographic Specular Gloss Sheen */
.mc-product-sheen {
  position: absolute;
  inset: 0;
  border-radius: var(--radius-lg);
  pointer-events: none;
  opacity: 0;
  z-index: 7;
  background: radial-gradient(circle at var(--sheen-x, 50%) var(--sheen-y, 50%), rgba(255, 255, 255, 0.45) 0%, rgba(223, 190, 126, 0.2) 35%, transparent 65%);
  mix-blend-mode: overlay;
  transition: opacity 0.3s ease;
}

.mc-product-card:hover .mc-product-sheen {
  opacity: 1;
}

/* 3D Depth Layer Separations */
.mc-product-card .mc-product-img-wrap {
  transform: translateZ(25px);
  transform-style: preserve-3d;
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.mc-product-card:hover .mc-product-img-wrap {
  transform: translateZ(45px);
}

.mc-product-card .mc-product-img {
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), filter 0.35s ease;
}

.mc-product-card:hover .mc-product-img {
  transform: scale(1.08);
  filter: drop-shadow(0 14px 18px rgba(0, 0, 0, 0.18));
}

.mc-product-card .mc-discount-badge,
.mc-product-card .mc-out-of-stock-badge {
  transform: translateZ(55px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.25);
  transition: transform 0.3s ease;
}

.mc-product-card .mc-product-body {
  transform: translateZ(20px);
}

/* Floating 3D Quick-View Action Button on Every Card */
.mc-card-3d-btn {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 10;
  background: rgba(24, 30, 22, 0.85);
  border: 1px solid rgba(223, 190, 126, 0.45);
  color: var(--accent-gold-light);
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  font-size: 0.72rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  opacity: 0;
  transform: translateY(-6px) translateZ(50px);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.mc-product-card:hover .mc-card-3d-btn {
  opacity: 1;
  transform: translateY(0) translateZ(50px);
}

.mc-card-3d-btn:hover {
  background: var(--accent-gold);
  color: var(--dark-olive);
  border-color: var(--accent-gold);
  transform: scale(1.06) translateZ(55px);
}

/* --------------------------------------------------------------------------
   4. INTERACTIVE 3D QUICK-VIEW MODAL (Three.js Viewer for Any Product)
   -------------------------------------------------------------------------- */
.mc-3d-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(36, 11, 24, 0.82);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  z-index: 99990;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.mc-3d-modal-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

.mc-3d-modal-dialog {
  background: linear-gradient(145deg, #321223, #1f0815);
  border: 1px solid rgba(224, 79, 127, 0.35);
  border-radius: 28px;
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.7);
  width: 100%;
  max-width: 920px;
  max-height: 90vh;
  overflow: hidden;
  position: relative;
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  transform: scale(0.94) translateY(20px);
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.mc-3d-modal-backdrop.open .mc-3d-modal-dialog {
  transform: scale(1) translateY(0);
}

.mc-3d-modal-close {
  position: absolute;
  top: 18px;
  left: 18px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #ffffff;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 20;
  font-size: 1.2rem;
  transition: all 0.2s ease;
}

.mc-3d-modal-close:hover {
  background: #ff4081;
  border-color: #ff4081;
  transform: rotate(90deg);
}

.mc-3d-modal-canvas-side {
  position: relative;
  height: 480px;
  background: radial-gradient(circle at center, rgba(240, 98, 146, 0.15) 0%, rgba(0,0,0,0) 70%);
  cursor: grab;
}

.mc-3d-modal-canvas-side:active {
  cursor: grabbing;
}

#bahar-modal-3d-canvas {
  width: 100% !important;
  height: 100% !important;
  display: block;
}

.mc-3d-modal-info-side {
  padding: 36px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  color: #ffffff;
  border-right: 1px solid rgba(224, 79, 127, 0.2);
}

/* --------------------------------------------------------------------------
   5. FLYING ADD-TO-CART PARTICLE EFFECT
   -------------------------------------------------------------------------- */
.mc-flying-cart-particle {
  position: fixed;
  z-index: 999999;
  pointer-events: none;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 2px solid #ffffff;
  background: linear-gradient(135deg, #ff4081, #f50057);
  box-shadow: 0 0 20px rgba(255, 64, 129, 0.85), 0 8px 24px rgba(245, 0, 87, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-weight: 800;
  font-size: 1.2rem;
}

/* Cart Badge Bounce Animation */
@keyframes cartBounce {
  0% { transform: scale(1); }
  35% { transform: scale(1.65) rotate(12deg); }
  65% { transform: scale(0.9) rotate(-6deg); }
  100% { transform: scale(1) rotate(0deg); }
}

.mc-badge-bounce {
  animation: cartBounce 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275) !important;
}

/* --------------------------------------------------------------------------
   6. MAGNETIC BUTTON MECHANICS & MICRO-ANIMATIONS
   -------------------------------------------------------------------------- */
.mc-magnetic-btn {
  display: inline-flex;
  transition: transform 0.2s cubic-bezier(0.2, 0, 0, 1);
  will-change: transform;
}

/* Golden Shimmer on CTA Buttons */
.mc-btn-pill {
  position: relative;
  overflow: hidden;
}

.mc-btn-pill::after {
  content: '';
  position: absolute;
  top: -50%;
  left: -60%;
  width: 40%;
  height: 200%;
  background: linear-gradient(
    60deg,
    rgba(255, 255, 255, 0) 20%,
    rgba(255, 255, 255, 0.45) 50%,
    rgba(255, 255, 255, 0) 80%
  );
  transform: rotate(25deg);
  pointer-events: none;
  animation: buttonShine 4s infinite cubic-bezier(0.19, 1, 0.22, 1);
}

@keyframes buttonShine {
  0%, 65% { left: -70%; }
  100% { left: 140%; }
}

/* Responsive adjustments */
@media (max-width: 991px) {
  .mc-3d-experience-grid,
  .mc-3d-modal-dialog {
    grid-template-columns: 1fr;
  }
  .mc-3d-stage-card {
    height: 400px;
  }
  .mc-3d-modal-dialog {
    max-height: 85vh;
    overflow-y: auto;
  }
  .mc-3d-modal-canvas-side {
    height: 320px;
  }
}
