/**
 * Cross-browser compatibility layer
 * Chrome, Firefox, Safari, Edge, iOS Safari, Samsung Internet
 */

/* iOS Safari 100vh fix */
@supports (height: 100dvh) {
  .stedrino-drawer__panel { max-height: 100dvh; }
}

/* Tap highlight */
a, button, .stedrino-icon-btn {
  -webkit-tap-highlight-color: rgba(217, 35, 135, 0.15);
}

/* Focus visible — keyboard users */
:focus { outline: none; }
:focus-visible {
  outline: 3px solid var(--st-sky);
  outline-offset: 2px;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* Form controls — iOS zoom prevention + consistent height */
input[type="text"],
input[type="email"],
input[type="tel"],
input[type="search"],
input[type="password"],
input[type="number"],
select,
textarea {
  font-size: 16px;
  -webkit-appearance: none;
  appearance: none;
}

/* Drawer panel from end (cart) */
.stedrino-drawer--cart .stedrino-drawer__panel--end {
  inset-inline-start: auto;
  inset-inline-end: 0;
  transform: translateX(105%);
}
[dir="rtl"] .stedrino-drawer--cart .stedrino-drawer__panel--end {
  transform: translateX(-105%);
  inset-inline-end: auto;
  inset-inline-start: 0;
}
.stedrino-drawer--cart.is-open .stedrino-drawer__panel--end { transform: translateX(0); }

/* Backdrop blur with fallback */
@supports ((-webkit-backdrop-filter: blur(4px)) or (backdrop-filter: blur(4px))) {
  .stedrino-drawer__overlay {
    -webkit-backdrop-filter: blur(2px);
    backdrop-filter: blur(2px);
  }
}

/* Grid fallback for very old browsers */
@supports not (display: grid) {
  .stedrino-shop ul.products li { width: 23%; display: inline-block; vertical-align: top; }
  .stedrino-category-grid__items > * { width: 23%; display: inline-block; }
}

/* Print */
@media print {
  .stedrino-header, .stedrino-bottom-nav, .stedrino-fab, .stedrino-drawer, .stedrino-sticky-cart { display: none !important; }
  body { padding: 0; background: #fff; }
}

/* YITH Wishlist Compatibility */
.stedrino-product-card .yith-wcwl-add-to-wishlist {
  position: absolute !important;
  top: 12px !important;
  right: 12px !important;
  margin-top: 0 !important;
  z-index: 10 !important;
}
[dir="rtl"] .stedrino-product-card .yith-wcwl-add-to-wishlist {
  right: auto !important;
  left: 12px !important;
}
.stedrino-product-card .yith-wcwl-add-to-wishlist a {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 36px !important;
  height: 36px !important;
  background: #ffffff !important;
  border-radius: 50% !important;
  color: #0d3973 !important;
  box-shadow: 0 4px 10px rgba(0,0,0,0.06) !important;
  transition: transform 0.2s ease, background-color 0.2s ease !important;
  font-size: 0 !important;
}
.stedrino-product-card .yith-wcwl-add-to-wishlist a::before {
  content: "❤" !important;
  font-size: 16px !important;
  line-height: 1 !important;
}
.stedrino-product-card .yith-wcwl-add-to-wishlist a:hover {
  transform: scale(1.1) !important;
  background: #d92387 !important;
  color: #ffffff !important;
}
.stedrino-product-card .yith-wcwl-add-to-wishlist .yith-wcwl-icon {
  display: none !important;
}
.stedrino-product-card .yith-wcwl-add-to-wishlist .feedback {
  display: none !important;
}

/* JetSmartFilters Compatibility */
.jet-filter-items-dropdown__active {
  border-radius: 12px !important;
  border: 1px solid #e2e8f0 !important;
}
.jet-select__control {
  border-radius: 12px !important;
  border-color: #e2e8f0 !important;
}
.jet-smart-filters-checkboxes .jet-checkboxes-list__input:checked + .jet-checkboxes-list__decorator {
  background-color: #d92387 !important;
  border-color: #d92387 !important;
}
.jet-filter-items-dropdown__label {
  font-family: inherit !important;
}

