/* ==========================================================================
   MR International — UI polish layer
   Loaded last. Refines the look of the whole store without changing behaviour.
   (Hero banner slider is intentionally untouched.)
   ========================================================================== */

:root {
  --mri-navy: #2A2657;
  --mri-ink: #0A1435;
  --mri-red: #B9242A;
  --mri-line: #E9EBF2;
  --mri-soft: #F6F7FB;
  --mri-ease: cubic-bezier(.16, 1, .3, 1);
  --mri-shadow-sm: 0 1px 2px rgba(16, 24, 40, .04), 0 1px 3px rgba(16, 24, 40, .04);
  --mri-shadow-lg: 0 24px 48px -20px rgba(42, 38, 87, .28), 0 8px 16px -8px rgba(42, 38, 87, .10);
}

/* ---------- Global foundations (low priority so page styles still win) ---------- */
@layer base {
  html { -webkit-text-size-adjust: 100%; }
  body {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
  }
  a, button, [role="button"], summary { -webkit-tap-highlight-color: transparent; }
  ::selection { background: rgba(42, 38, 87, .14); color: inherit; }
  img { image-rendering: auto; }
}

/* Clear keyboard focus ring everywhere (mouse clicks don't show it) */
:where(a, button, [role="button"], input, select, textarea, summary):focus-visible {
  outline: 2px solid var(--mri-navy);
  outline-offset: 2px;
  border-radius: 10px;
}

/* Form fields: consistent, calm focus state */
:where(input:not([type="checkbox"]):not([type="radio"]):not([type="range"]), select, textarea) {
  transition: border-color .2s ease, box-shadow .2s ease, background-color .2s ease;
}
:where(input:not([type="checkbox"]):not([type="radio"]):not([type="range"]), select, textarea):focus {
  border-color: var(--mri-navy) !important;
  box-shadow: 0 0 0 4px rgba(42, 38, 87, .10) !important;
  outline: none;
}
input::placeholder, textarea::placeholder { color: #9AA3B5; opacity: 1; }

/* Buttons: tactile press feedback */
button:not(:disabled):active, [role="button"]:active { transform: translateY(1px); }
button:disabled { cursor: not-allowed; }

/* Thin, tidy scrollbars on desktop */
@media (hover: hover) and (pointer: fine) {
  * { scrollbar-width: thin; scrollbar-color: #C9CDDA transparent; }
  *::-webkit-scrollbar { width: 10px; height: 10px; }
  *::-webkit-scrollbar-thumb { background: #C9CDDA; border-radius: 10px; border: 3px solid transparent; background-clip: padding-box; }
  *::-webkit-scrollbar-thumb:hover { background-color: #A9AEC2; }
  *::-webkit-scrollbar-track { background: transparent; }
}

/* ---------- Product cards (home, shop, related, suggestions) ---------- */
.product-card {
  border-radius: 20px !important;
  border: 1px solid var(--mri-line) !important;
  box-shadow: var(--mri-shadow-sm) !important;
  background: #fff;
  isolation: isolate;
  display: flex;
  flex-direction: column;
}
.product-card > :last-child { flex: 1 1 auto; display: flex; flex-direction: column; }
.product-card > :last-child > :last-child { margin-top: auto; }
@media (hover: hover) {
  .product-card:hover {
    transform: translateY(-6px) !important;
    box-shadow: var(--mri-shadow-lg) !important;
    border-color: rgba(42, 38, 87, .16) !important;
  }
}
@media (hover: none) {
  .product-card:hover { transform: none !important; }
}

/* Image area: soft studio background, product fully visible and centred */
.product-card .aspect-square {
  background: radial-gradient(120% 90% at 50% 15%, #FFFFFF 0%, #F4F5FA 60%, #EDEFF6 100%) !important;
}
.product-card .aspect-square img {
  object-fit: contain !important;
  padding: 7% !important;
  mix-blend-mode: multiply; /* white product backgrounds blend into the card */
  transition: transform .7s var(--mri-ease), opacity .5s ease !important;
}
@media (hover: hover) {
  .product-card:hover .aspect-square img { transform: scale(1.06) !important; }
}
/* Dark "Click to view" veil was heavy — make it a light frosted hint */
.product-card .aspect-square .bg-black\/35:not(.pointer-events-none) {
  background: rgba(255, 255, 255, .18) !important;
  backdrop-filter: blur(1px);
}

/* Badges (discount / out of stock / tag) */
.product-card .absolute.top-3.left-3 {
  border-radius: 999px;
  font-size: 10px !important;
  letter-spacing: .02em;
  padding: 4px 9px !important;
  box-shadow: 0 6px 14px -6px rgba(185, 36, 42, .55);
}
.product-card .absolute.top-3.left-3.bg-red-500 {
  background: linear-gradient(135deg, #EF4444, #B9242A) !important;
}

/* Wishlist / quick-add icons: always visible on touch screens (no hover there) */
@media (hover: none) {
  .product-card .absolute.top-3.right-3 { opacity: 1 !important; transform: none !important; }
}
.product-card .absolute.top-3.right-3 button {
  backdrop-filter: blur(6px);
  background: rgba(255, 255, 255, .92) !important;
  box-shadow: 0 4px 14px -4px rgba(16, 24, 40, .25) !important;
}

/* Text: category, name (always 2 lines tall so prices line up), price */
.product-card h3 {
  letter-spacing: -.005em;
  min-height: 2.6em;
  line-height: 1.3 !important;
}
.product-card p.uppercase { letter-spacing: .12em !important; opacity: .9; }
.product-card .line-through { color: #A3AABB !important; }

/* Add button */
.product-card button.rounded-full:not(:disabled) {
  box-shadow: 0 6px 14px -8px rgba(42, 38, 87, .7);
  transition: transform .2s var(--mri-ease), box-shadow .2s ease, background-color .2s ease, opacity .2s ease !important;
}
@media (hover: hover) {
  .product-card button.rounded-full:not(:disabled):hover { transform: translateY(-1px); box-shadow: 0 10px 20px -10px rgba(42, 38, 87, .8); }
}

@media (max-width: 639px) {
  .product-card { border-radius: 16px !important; }
  .product-card .aspect-square img { padding: 6% !important; }
  .product-card h3 { font-size: 12.5px !important; }
}

/* ---------- Footer ---------- */
.mri-footer {
  background:
    radial-gradient(60% 80% at 100% 0%, rgba(185, 36, 42, .10), transparent 60%),
    radial-gradient(50% 70% at 0% 100%, rgba(99, 91, 255, .10), transparent 60%),
    #150F2D !important;
}
/* Logo is navy — give it a white plate so it's visible on the dark footer */
.mri-footer-logo {
  display: inline-flex;
  background: #fff;
  border-radius: 16px;
  padding: 10px 16px;
  box-shadow: 0 10px 30px -12px rgba(0, 0, 0, .5);
}
.mri-footer-logo img { height: 56px !important; }
.mri-footer-social {
  background: rgba(255, 255, 255, .08) !important;
  border: 1px solid rgba(255, 255, 255, .12);
}
.mri-footer-social svg { color: #fff !important; }
.mri-footer-social:hover { background: var(--mri-red) !important; border-color: var(--mri-red); }
.mri-footer a { transition: color .2s ease, transform .2s ease; }
.mri-footer ul a:hover { color: #fff !important; }

/* Phones & tablets: brand and contact full width, link lists side by side */
@media (max-width: 1023px) {
  .mri-footer-grid { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; column-gap: 1.25rem !important; row-gap: 2.25rem !important; }
  .mri-footer-grid > :first-child, .mri-footer-grid > :last-child { grid-column: 1 / -1; }
}
@media (max-width: 639px) {
  .mri-footer-grid ul a, .mri-footer-grid li { font-size: 13px; }
}

/* ---------- Product page: mobile sticky buy bar ---------- */
.mri-sticky-buy {
  position: fixed;
  left: 10px;
  right: 10px;
  bottom: calc(10px + env(safe-area-inset-bottom, 0px));
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 8px 8px 10px;
  background: rgba(255, 255, 255, .94);
  backdrop-filter: saturate(1.4) blur(14px);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  border: 1px solid var(--mri-line);
  border-radius: 18px;
  box-shadow: 0 18px 40px -16px rgba(16, 24, 40, .35);
  transform: translateY(140%);
  opacity: 0;
  pointer-events: none;
  transition: transform .35s var(--mri-ease), opacity .25s ease;
}
.mri-sticky-buy.is-visible { transform: none; opacity: 1; pointer-events: auto; }
.mri-sticky-buy__img {
  width: 44px; height: 44px; flex: none;
  border-radius: 12px; object-fit: contain;
  background: var(--mri-soft); padding: 3px; mix-blend-mode: multiply;
}
.mri-sticky-buy__info { min-width: 0; flex: 1; }
.mri-sticky-buy__name {
  font-size: 12px; font-weight: 600; color: #4B5368;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.mri-sticky-buy__price { font-size: 15px; font-weight: 800; color: var(--mri-ink); line-height: 1.2; }
.mri-sticky-buy__btn {
  flex: none;
  height: 44px;
  padding: 0 18px;
  border-radius: 999px;
  background: linear-gradient(135deg, #3A3578, var(--mri-navy));
  color: #fff;
  font-weight: 700;
  font-size: 14px;
  box-shadow: 0 10px 20px -10px rgba(42, 38, 87, .9);
}
.mri-sticky-buy__btn:disabled { opacity: .85; }
@media (min-width: 1024px) { .mri-sticky-buy { display: none; } }
@media (max-width: 1023px) { body.mri-sticky-on .mri-wa-float { bottom: 88px !important; transition: bottom .3s var(--mri-ease); } }

/* ---------- Shop toolbar & sidebar ---------- */
.mri-shop-hero { position: relative; }
@media (min-width: 640px) {
  .mri-shop-title { letter-spacing: -.02em; }
}

/* ---------- Motion preferences ---------- */
@media (prefers-reduced-motion: reduce) {
  .product-card, .product-card *, .mri-sticky-buy { transition: none !important; animation: none !important; }
  .product-card:hover { transform: none !important; }
}
