/* ==========================================================================
   SB STORE STOCKS — Native Material 3 & Android Mobile Frame Theme
   ========================================================================== */

:root {
  --sb-primary: #1B5E20;
  --sb-primary-light: #2E7D32;
  --sb-primary-dark: #0E3813;
  --sb-primary-container: #E8F5E9;
  --sb-on-primary-container: #0F3D17;
  --sb-secondary: #1A365D;
  --sb-secondary-container: #EBF4FF;
  --sb-background: #F8FAF8;
  --sb-surface: #FFFFFF;
  --sb-border: #E2E8F0;
  --sb-slate-text: #1F2937;
  --sb-slate-muted: #64748B;
  --sb-error: #B91C1C;
  --sb-error-container: #FEE2E2;
}

/* Base resets & font */
* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

body {
  margin: 0;
  padding: 0;
  background: #0F172A; /* Slate 900 desktop backdrop */
  font-family: 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  color: var(--sb-slate-text);
  overflow-x: hidden;
  min-height: 100vh;
}

/* Native Android Scrollbar */
::-webkit-scrollbar {
  width: 5px;
  height: 5px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.15);
  border-radius: 9999px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 0, 0, 0.25);
}

/* Device Wrapper on Desktop vs Mobile */
.android-device-wrapper {
  width: 100%;
  max-width: 440px;
  height: 890px;
  background-color: var(--sb-background);
  border-radius: 42px;
  box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.6), 0 0 0 10px #1E293B, 0 0 0 12px #334155;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Fullscreen on Mobile screen (< 768px) */
@media (max-width: 768px) {
  body {
    background-color: var(--sb-background);
    padding: 0 !important;
  }
  .android-device-wrapper {
    max-width: 100% !important;
    height: 100dvh !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    border: none !important;
  }
  .desktop-showcase-sidebar {
    display: none !important;
  }
}

/* Camera Punch Hole */
.camera-punch-hole {
  position: absolute;
  top: 6px;
  left: 50%;
  transform: translateX(-50%);
  width: 12px;
  height: 12px;
  background-color: #0F172A;
  border-radius: 50%;
  z-index: 50;
  box-shadow: inset 0 0 2px rgba(255, 255, 255, 0.2);
}

@media (max-width: 768px) {
  .camera-punch-hole {
    display: none;
  }
}

/* Status Bar */
.android-status-bar {
  background-color: var(--sb-primary);
  height: 28px;
  color: white;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 18px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.3px;
  user-select: none;
  z-index: 45;
  flex-shrink: 0;
}

/* Material 3 App Bar */
.app-top-bar {
  background-color: var(--sb-primary);
  color: white;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
  z-index: 40;
  flex-shrink: 0;
}

/* Navigation Pill */
.android-nav-pill {
  height: 20px;
  background: var(--sb-background);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.android-nav-pill .pill-bar {
  width: 130px;
  height: 4px;
  background: #CBD5E1;
  border-radius: 9999px;
}

/* Material 3 Elevation & Cards */
.m3-card {
  background-color: var(--sb-surface);
  border: 1px solid var(--sb-border);
  border-radius: 16px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05), 0 2px 6px rgba(0, 0, 0, 0.02);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.m3-card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}
.m3-card:active {
  transform: scale(0.99);
}

/* Badge Chips */
.m3-chip {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 600;
}
.m3-chip-green {
  background-color: var(--sb-primary-container);
  color: var(--sb-on-primary-container);
}
.m3-chip-navy {
  background-color: var(--sb-secondary-container);
  color: var(--sb-secondary);
}
.m3-chip-error {
  background-color: var(--sb-error-container);
  color: var(--sb-error);
}

/* Table Row Highlights */
.table-row-selected {
  background-color: #F1F8F1 !important;
}

/* Floating Action Button (FAB) */
.m3-fab {
  position: absolute;
  bottom: 24px;
  right: 20px;
  width: 56px;
  height: 56px;
  border-radius: 18px;
  background: var(--sb-primary);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 14px rgba(27, 94, 32, 0.4);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 35;
  border: none;
  cursor: pointer;
}
.m3-fab:hover {
  background: var(--sb-primary-light);
  transform: scale(1.05);
  box-shadow: 0 6px 18px rgba(27, 94, 32, 0.5);
}
.m3-fab:active {
  transform: scale(0.95);
}

/* Drawer Transitions */
.drawer-backdrop {
  position: absolute;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.6);
  z-index: 55;
  display: flex;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease-out;
}
.drawer-backdrop.active {
  opacity: 1;
  pointer-events: auto;
}
.drawer-sheet {
  width: 290px;
  height: 100%;
  transform: translateX(-100%);
  transition: transform 0.28s cubic-bezier(0.1, 0.9, 0.2, 1);
}
.drawer-backdrop.active .drawer-sheet {
  transform: translateX(0);
}

/* Modal Bottom-Sheet Transitions */
.modal-overlay {
  position: absolute;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.6);
  z-index: 60;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 0;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease-out;
}
@media (min-width: 768px) {
  .modal-overlay {
    align-items: center;
    padding: 16px;
  }
}
.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}
.modal-content {
  width: 100%;
  max-width: 380px;
  max-height: 90vh;
  overflow-y: auto;
  transform: translateY(100%);
  transition: transform 0.25s cubic-bezier(0.1, 0.9, 0.2, 1);
}
.modal-overlay.active .modal-content {
  transform: translateY(0);
}
@media (min-width: 768px) {
  .modal-content {
    transform: scale(0.95);
  }
  .modal-overlay.active .modal-content {
    transform: scale(1);
  }
}

/* Toast Notifications */
.m3-toast {
  position: absolute;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%) translateY(50px);
  background: #1E293B;
  color: white;
  padding: 10px 18px;
  border-radius: 9999px;
  font-size: 13px;
  font-weight: 500;
  box-shadow: 0 4px 14px rgba(0,0,0,0.25);
  opacity: 0;
  pointer-events: none;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 60;
  white-space: nowrap;
}
.m3-toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

/* Ripple effect on touch */
.ripple {
  position: relative;
  overflow: hidden;
}
.ripple:after {
  content: "";
  display: block;
  position: absolute;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  pointer-events: none;
  background-image: radial-gradient(circle, #000 10%, transparent 10.01%);
  background-repeat: no-repeat;
  background-position: 50%;
  transform: scale(10, 10);
  opacity: 0;
  transition: transform .3s, opacity .5s;
}
.ripple:active:after {
  transform: scale(0, 0);
  opacity: .15;
  transition: 0s;
}
