/* ==========================================================================
   DELHI KA TESSA (DELIKATESSA) B2C - DEVICE FRAME & SMARTPHONE CONTAINER
   Photorealistic Mobile Container with Dynamic Island & Status Bar
   ========================================================================== */

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: var(--font-main);
  background: radial-gradient(circle at 50% 10%, #1e293b 0%, #0f172a 60%, #080d1a 100%);
  color: var(--primary-900);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  overflow-x: hidden;
}

/* Canvas Container */
.prototype-canvas {
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
}

/* Smartphone Device Shell */
.device-frame {
  width: var(--device-width);
  height: var(--device-height);
  background: #000000;
  border-radius: 48px;
  padding: 12px;
  box-shadow: var(--shadow-device);
  position: relative;
  display: flex;
  flex-direction: column;
  border: 4px solid #334155;
  transition: all var(--transition-normal);
}

/* Screen Viewport Inside Phone */
.device-screen {
  width: 100%;
  height: 100%;
  background: var(--surface-subtle);
  border-radius: 38px;
  overflow: hidden;
  position: relative;
  display: flex;
  flex-direction: column;
}

/* Dynamic Island */
.dynamic-island {
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  width: 124px;
  height: 28px;
  background: #000000;
  border-radius: 20px;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
}

.dynamic-island .sensor {
  width: 8px;
  height: 8px;
  background: #111827;
  border-radius: 50%;
}

.dynamic-island .island-badge {
  font-size: 8px;
  font-weight: 800;
  color: var(--accent-400);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.dynamic-island .camera-lens {
  width: 9px;
  height: 9px;
  background: #111827;
  border-radius: 50%;
  border: 1px solid #1f2937;
}

/* Phone Status Bar */
.status-bar {
  height: 44px;
  padding: 12px 22px 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  font-weight: 700;
  color: var(--primary-900);
  z-index: 900;
  background: var(--surface-base);
  border-bottom: 1px solid rgba(226, 232, 240, 0.6);
}

.status-bar .status-icons {
  display: flex;
  align-items: center;
  gap: 6px;
}

.status-bar .status-icons svg {
  width: 15px;
  height: 15px;
  fill: currentColor;
}

/* App Header */
.app-header {
  height: 54px;
  background: var(--surface-base);
  border-bottom: 1px solid var(--surface-border);
  padding: 0 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  z-index: 800;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex-shrink: 1;
}

.header-btn {
  background: none;
  border: none;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary-700);
  cursor: pointer;
  transition: background var(--transition-fast);
  position: relative;
  flex-shrink: 0;
}

.header-btn:hover {
  background: var(--primary-100);
}

.header-brand {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
}

.header-brand-logo {
  height: 18px;
  width: auto;
  max-width: 108px;
  object-fit: contain;
  display: block;
}

.brand-name {
  font-size: 15px;
  font-weight: 800;
  letter-spacing: -0.3px;
  color: var(--primary-900);
  line-height: 1.1;
}

.brand-name span {
  color: var(--accent-600);
}

.brand-sub {
  font-size: 8px;
  font-weight: 600;
  color: var(--primary-500);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 108px;
  line-height: 1.1;
  margin-top: 1px;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

/* Language Pill Switcher in Header */
.header-lang-pill {
  display: flex;
  align-items: center;
  background: var(--primary-100);
  border: 1px solid var(--primary-200);
  border-radius: var(--radius-full);
  padding: 2px 3px;
  cursor: pointer;
  user-select: none;
  flex-shrink: 0;
}

.header-lang-opt {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 5px;
  border-radius: var(--radius-full);
  color: var(--primary-600);
  transition: all var(--transition-fast);
  line-height: 1.2;
}

.header-lang-opt.active {
  background: var(--accent-600);
  color: #ffffff;
  box-shadow: 0 1px 3px rgba(5, 150, 105, 0.3);
}

/* Header Badges */
.cart-badge-count, .wish-badge-count {
  position: absolute;
  top: 1px;
  right: 1px;
  background: var(--accent-600);
  color: #ffffff;
  font-size: 9.5px;
  font-weight: 800;
  min-width: 16px;
  height: 16px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  border: 2px solid var(--surface-base);
  transition: transform var(--transition-fast);
}

.badge-bounce {
  animation: badgeBounce 350ms cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes badgeBounce {
  0% { transform: scale(1); }
  50% { transform: scale(1.4); }
  100% { transform: scale(1); }
}

/* Screen Views Container */
.app-screen-container {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  position: relative;
  background: var(--surface-subtle);
  -webkit-overflow-scrolling: touch;
}

/* Screen View Panels */
.screen-view {
  display: none;
  min-height: 100%;
  padding: 14px 16px 24px;
  animation: fadeIn 200ms ease-out forwards;
}

.screen-view.active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Bottom Navigation Bar */
.bottom-nav-bar {
  height: 60px;
  background: var(--surface-base);
  border-top: 1px solid var(--surface-border);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  align-items: center;
  z-index: 800;
}

.nav-tab-btn {
  background: none;
  border: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  color: var(--primary-400);
  font-size: 10px;
  font-weight: 700;
  cursor: pointer;
  position: relative;
  height: 100%;
  transition: color var(--transition-fast);
}

.nav-tab-btn svg {
  width: 20px;
  height: 20px;
  transition: transform var(--transition-fast);
}

.nav-tab-btn.active {
  color: var(--accent-600);
}

.nav-tab-btn.active svg {
  transform: translateY(-2px);
}

.nav-tab-badge {
  position: absolute;
  top: 8px;
  right: calc(50% - 18px);
  background: var(--accent-600);
  color: #fff;
  font-size: 9px;
  font-weight: 800;
  min-width: 15px;
  height: 15px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 3px;
  border: 1px solid #fff;
}

/* Home Indicator Bar */
.home-indicator {
  width: 130px;
  height: 4px;
  background: var(--primary-300);
  border-radius: 2px;
  margin: 6px auto 4px;
  flex-shrink: 0;
}

/* Slide-out Side Drawer */
.drawer-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  z-index: 1100;
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-normal);
}

.drawer-backdrop.active {
  opacity: 1;
  visibility: visible;
}

.side-drawer {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 300px;
  background: var(--surface-base);
  z-index: 1200;
  transform: translateX(-100%);
  transition: transform var(--transition-smooth);
  display: flex;
  flex-direction: column;
  box-shadow: 10px 0 25px rgba(0, 0, 0, 0.2);
}

.side-drawer.active {
  transform: translateX(0);
}

.side-drawer-header {
  padding: 38px 18px 16px;
  background: var(--primary-900);
  color: #ffffff;
  position: relative;
}

.side-drawer-close {
  position: absolute;
  top: 14px;
  right: 14px;
  background: rgba(255, 255, 255, 0.15);
  border: none;
  color: #fff;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
}

.drawer-user-info {
  margin-top: 6px;
}

.drawer-user-name {
  font-size: 15px;
  font-weight: 800;
}

.drawer-user-email {
  font-size: 11px;
  color: var(--primary-400);
}

.drawer-tier-pill {
  display: inline-block;
  background: rgba(16, 185, 129, 0.2);
  color: var(--accent-300);
  border: 1px solid var(--accent-500);
  border-radius: var(--radius-full);
  font-size: 9px;
  font-weight: 800;
  padding: 2px 8px;
  margin-top: 6px;
  text-transform: uppercase;
}

.side-drawer-nav {
  flex: 1;
  padding: 12px 10px;
  overflow-y: auto;
}

.drawer-nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  color: var(--primary-700);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
  margin-bottom: 2px;
}

.drawer-nav-item:hover, .drawer-nav-item.active {
  background: var(--primary-100);
  color: var(--accent-700);
}

.drawer-nav-item svg {
  width: 18px;
  height: 18px;
  color: inherit;
}

.side-drawer-footer {
  padding: 14px 18px;
  border-top: 1px solid var(--surface-border);
  background: var(--surface-subtle);
}

/* Modals & Overlays */
.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(4px);
  z-index: 1500;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.modal-backdrop.active {
  display: flex;
}

.modal-card {
  width: 100%;
  max-width: 360px;
  background: var(--surface-base);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  overflow: hidden;
  animation: modalPop 200ms ease-out forwards;
  display: flex;
  flex-direction: column;
  max-height: 85%;
}

@keyframes modalPop {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

.modal-header {
  padding: 14px 16px;
  border-bottom: 1px solid var(--surface-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-title {
  font-size: 14px;
  font-weight: 800;
  color: var(--primary-900);
}

.modal-close {
  background: none;
  border: none;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  color: var(--primary-500);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
}

.modal-close:hover {
  background: var(--primary-100);
}

.modal-body {
  padding: 16px;
  overflow-y: auto;
  flex: 1;
}

.modal-footer {
  padding: 12px 16px;
  border-top: 1px solid var(--surface-border);
  display: flex;
  gap: 10px;
  background: var(--surface-subtle);
}

/* Toast Container */
.toast-container {
  position: absolute;
  top: 58px;
  left: 16px;
  right: 16px;
  z-index: 2000;
  pointer-events: none;
  display: flex;
  justify-content: center;
}

.toast {
  background: var(--primary-900);
  color: #ffffff;
  padding: 9px 16px;
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  transform: translateY(-10px);
  transition: all var(--transition-normal);
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.toast.active {
  opacity: 1;
  transform: translateY(0);
}

.toast.success { background: #064e3b; border-color: var(--accent-400); color: #ecfdf5; }
.toast.info { background: #1e3a8a; border-color: #60a5fa; color: #eff6ff; }
.toast.warning { background: #78350f; border-color: #fbbf24; color: #fffbeb; }

/* Responsive adjustments for direct mobile viewing */
@media (max-width: 480px) {
  body {
    padding: 0;
    background: #000;
  }
  .prototype-canvas {
    height: 100vh;
  }
  .device-frame {
    width: 100vw;
    height: 100vh;
    border-radius: 0;
    border: none;
    padding: 0;
    box-shadow: none;
  }
  .device-screen {
    border-radius: 0;
  }
}
