html {
  font-size: 14px;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

.btn:focus, .btn:active:focus, .btn.nav-link:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem var(--primary-color, #258cfb);
}

html {
  position: relative;
  min-height: 100%;
}

.hover-primary:hover {
  color: var(--primary-color) !important;
  transition: color 0.2s ease;
}

/* Admin Settings Floating Button */
.btn-primary.position-fixed {
  transition: all 0.3s ease;
  animation: slideInLeft 0.5s ease;
}

.btn-primary.position-fixed:hover {
  transform: translateX(5px);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2) !important;
}

@keyframes slideInLeft {
  from {
    transform: translateX(-100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* Tag Links Hover Effects */
.hover-bg-primary:hover {
  background-color: var(--bs-primary) !important;
  color: white !important;
  border-color: var(--bs-primary) !important;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.transition-all {
  transition: all 0.3s ease;
}

/* Offcanvas Animation */
.offcanvas {
  transition: transform 0.3s ease-in-out;
}

/* Loading Spinner */
.spinner-border-sm {
  width: 1rem;
  height: 1rem;
  border-width: 0.15em;
}

/* User Menu Offcanvas - Full Height */
#userMenuOffcanvas {
    height: 100vh !important;
    display: flex !important;
    flex-direction: column !important;
}

/* ── Stacking order ──────────────────────────────────────────────────────────
   One scale for everything that floats above the page. Overlays kept picking
   Tailwind values like z-50 or z-[200] that look large but sit far below the
   sticky header, so panels slid in *behind* it.

     1000  sticky header            (.hdr-auto-shell, headers.css)
     1100  header nav dropdowns     (.hdr-nav-dropdown, headers.css)
     1190  overlay backdrop         .o-overlay
     1200  overlay panel / modal    .o-overlay-panel
     1300  lightbox (image viewer)  .o-lightbox
     1400  cookie consent bar       — must stay reachable over everything

   Anything full-screen belongs on this scale. Alpine's x-teleport moves several
   panels to <body>, where they compete with the header directly, which is exactly
   how the user menu ended up underneath it. */

.o-overlay {
    z-index: 1190 !important;
}

.o-overlay-panel {
    z-index: 1200 !important;
}

.o-lightbox {
    z-index: 1300 !important;
}

/* Consent must stay on top of everything — it gates the rest of the page legally. */
.o-consent {
    z-index: 1400 !important;
}

/* The cart panel is loaded over fetch and carries its own ids rather than the
   classes above (see _CartOffcanvas.cshtml).
   NOTE: an earlier rule here targeted a non-existent #cartOffcanvas, which is why
   the fix it was written for never actually applied. */
#cartPanel {
    z-index: 1200 !important;
}

#cartBackdrop {
    z-index: 1190 !important;
}

#userMenuOffcanvas .offcanvas-header {
    flex-shrink: 0;
}

#userMenuOffcanvas .offcanvas-body {
    overflow-y: auto;
    flex: 1 1 auto;
    min-height: 0;
}

/* Cart View Detail Button - Theme-aware styling */
.cart-view-detail-btn {
    background-color: transparent !important;
    border: 1px solid var(--border-color) !important;
    color: var(--text-secondary) !important;
    transition: all 0.3s ease !important;
}

.cart-view-detail-btn:hover {
    background-color: var(--background-secondary, rgba(0, 0, 0, 0.05)) !important;
    border-color: var(--primary-color) !important;
    color: var(--primary-color) !important;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.cart-view-detail-btn:active {
    transform: translateY(0);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
}

/* Product detail, below lg: gallery → title/price/add-to-cart → description tabs.
   The markup keeps gallery and tabs in one left column for the desktop two-column layout, which
   on phones pushed the title and "Sepete Ekle" ~1100px down, below the whole description. */
@media (max-width: 1023.98px) {
    .pd-grid { display: flex; flex-direction: column; gap: 1.5rem; }
    .pd-left { display: contents; }
    .pd-gallery { order: 1; }
    .pd-buy { order: 2; }
    .pd-tabs { order: 3; }
    .pd-buy .sticky { position: static; }
}

/* Cookie banner on phones: the three buttons stacked made it ~1/3 of the screen, covering the
   product page's sticky "Sepete Ekle" bar for every first-time visitor. One row instead. */
@media (max-width: 639.98px) {
    .o-consent > div { padding-top: 0.75rem; padding-bottom: 0.75rem; }
    .o-consent .o-consent-actions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.375rem; }
    .o-consent .o-consent-actions > button { padding: 0.5rem 0.25rem; font-size: 11px; line-height: 1.2; }
}
