/* OAU Mart — 3D cube avatar, card lift, and small UI polish */
/* ---------- 3D accents ---------- */
.avatar3d {
  width: 62px; height: 62px; flex: none;
  perspective: 520px;
  display: inline-block;
  filter: drop-shadow(0 10px 18px rgba(18, 6, 34, 0.28));
}
.avatar3d-cube {
  display: block;
  position: relative; width: 100%; height: 100%;
  transform-style: preserve-3d;
  animation: cubeSpin 16s linear infinite;
}
.avatar3d .f {
  position: absolute; inset: 0;
  display: grid; place-items: center;
  border-radius: 16px;
  background: linear-gradient(150deg, #ffffff 0%, #efe6ff 62%, #ddc9ff 100%);
  color: var(--purple-700);
  font-size: 15px; font-weight: 800; letter-spacing: -0.2px;
  box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, 0.85), inset 0 -8px 16px rgba(120, 76, 190, 0.18);
  backface-visibility: hidden;
}
.avatar3d .f .ic { width: 22px; height: 22px; }
.avatar3d .f1 { transform: translateZ(31px); }
.avatar3d .f2 { transform: rotateY(90deg) translateZ(31px); }
.avatar3d .f3 { transform: rotateY(180deg) translateZ(31px); }
.avatar3d .f4 { transform: rotateY(-90deg) translateZ(31px); }
.avatar3d .f5 { transform: rotateX(90deg) translateZ(31px); }
.avatar3d .f6 { transform: rotateX(-90deg) translateZ(31px); }
@keyframes cubeSpin {
  from { transform: rotateX(-16deg) rotateY(0deg); }
  to   { transform: rotateX(-16deg) rotateY(360deg); }
}

/* product cards keep their entrance but get a 3D lift where a mouse exists */
@keyframes cardIn {
  from { opacity: 0; translate: 0 12px; }
  to   { opacity: 1; translate: 0 0; }
}
.product-grid .product-card { animation: cardIn 0.34s var(--ease-spring) both; }
@media (hover: hover) and (pointer: fine) {
  .product-grid { perspective: 900px; }
  .product-card {
    transform-style: preserve-3d;
    transition: transform 0.35s var(--ease-spring), box-shadow 0.35s ease;
  }
  .product-card:hover {
    transform: translateY(-5px) rotateX(7deg) rotateY(-5deg);
    box-shadow: 0 18px 40px rgba(43, 23, 69, 0.18);
  }
  .product-card:hover .product-thumb img { transform: scale(1.06); }
}
@media (prefers-reduced-motion: reduce) {
  .avatar3d-cube { animation: none; transform: rotateX(-14deg) rotateY(-26deg); }
  .product-grid .product-card { animation: none; }
}

/* ---------- UI polish ---------- */
/* A clear keyboard ring for buttons, links and fields (mouse clicks stay clean). */
:where(button, a, input, select, textarea):focus-visible {
  outline: 3px solid rgba(109, 40, 217, 0.5);
  outline-offset: 2px;
  border-radius: 10px;
}
/* Photos that fail to load keep the purple tile instead of a broken icon. */
.product-thumb img, .gal-slide img { background: var(--purple-50); }
img.img-failed { opacity: 0; }
