.store-subscribe-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(4px);
  z-index: 1400;
  display: none;
  padding: 0;
}

.store-subscribe-overlay.show {
  display: block;
}

.store-subscribe-modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(320px, calc(100vw - 32px));
  max-height: min(88vh, 520px);
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 20px 48px rgba(0, 0, 0, 0.22);
  overflow: hidden;
  animation: storeSubscribeIn 0.28s ease;
}

@keyframes storeSubscribeIn {
  from { opacity: 0; transform: translate(-50%, calc(-50% + 12px)) scale(0.98); }
  to { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

.store-subscribe-head {
  background: linear-gradient(135deg, #48cae4 0%, #0096c7 50%, #013af3 100%);
  color: #fff;
  padding: 14px 16px 12px;
  text-align: center;
}

.store-subscribe-head h2 {
  margin: 0 0 4px;
  font-size: 1.05rem;
  line-height: 1.35;
}

.store-subscribe-head p {
  margin: 0;
  font-size: 0.8rem;
  opacity: 0.95;
  line-height: 1.4;
}

.store-subscribe-body {
  padding: 12px 14px 14px;
}

.store-subscribe-field {
  margin-bottom: 8px;
}

.store-subscribe-field label {
  display: block;
  margin-bottom: 4px;
  font-weight: 700;
  color: #334155;
  font-size: 0.82rem;
}

.store-subscribe-field input[type="text"],
.store-subscribe-field input[type="tel"] {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  padding: 9px 11px;
  font-size: 0.92rem;
  direction: ltr;
  text-align: left;
}

.store-subscribe-field input:focus {
  outline: none;
  border-color: #0096c7;
  box-shadow: 0 0 0 3px rgba(0, 150, 199, 0.15);
}

.store-subscribe-consent {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  margin: 10px 0 12px;
  font-size: 0.76rem;
  color: #475569;
  line-height: 1.4;
}

.store-subscribe-consent input {
  margin-top: 3px;
  flex-shrink: 0;
}

.store-subscribe-actions {
  display: flex;
  gap: 8px;
}

.store-subscribe-actions button {
  flex: 1;
  border: none;
  border-radius: 10px;
  padding: 9px 10px;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
}

.store-subscribe-submit {
  background: linear-gradient(135deg, #22c55e, #16a34a);
  color: #fff;
}

.store-subscribe-submit:disabled {
  opacity: 0.65;
  cursor: wait;
}

.store-subscribe-later {
  background: #f1f5f9;
  color: #475569;
}

.store-subscribe-msg {
  min-height: 1.1em;
  margin-top: 8px;
  font-size: 0.8rem;
  text-align: center;
}

@media (max-width: 480px) {
  .store-subscribe-modal {
    width: min(300px, calc(100vw - 24px));
    border-radius: 14px;
  }

  .store-subscribe-head {
    padding: 12px 14px 10px;
  }

  .store-subscribe-head h2 {
    font-size: 0.98rem;
  }

  .store-subscribe-body {
    padding: 10px 12px 12px;
  }
}

body.store-subscribe-open #mobileBottomDock,
body.store-subscribe-open .photo-mode-toggle:not(#mobileBottomDock .photo-mode-toggle) {
  visibility: hidden;
  pointer-events: none;
}
.store-subscribe-msg.ok { color: #15803d; }
.store-subscribe-msg.err { color: #b91c1c; }

.store-subscribe-hp {
  position: absolute;
  left: -9999px;
  opacity: 0;
  pointer-events: none;
}

.store-subscribe-header-btn {
  display: none;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid rgba(255, 255, 255, 0.45);
  border-radius: 999px;
  padding: 7px 12px;
  min-height: 2.1rem;
  font-size: 0.82rem;
  font-weight: 700;
  font-family: inherit;
  color: #fff;
  background: rgba(255, 255, 255, 0.16);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.12);
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.2s ease, transform 0.15s ease;
}

.store-subscribe-header-btn:hover {
  background: rgba(255, 255, 255, 0.28);
  transform: translateY(-1px);
}

.store-subscribe-header-btn.show {
  display: inline-flex;
}

.store-subscribe-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 0;
}

.store-subscribe-svg {
  width: 1.15rem;
  height: 1.15rem;
  display: block;
}

.store-subscribe-header-label {
  line-height: 1;
}

#mobileBottomDock .store-subscribe-header-btn,
#mobileBottomDock .store-share-header-btn {
  position: static !important;
  left: auto !important;
  right: auto !important;
  top: auto !important;
  bottom: auto !important;
  transform: none !important;
}

#mobileBottomDock .store-subscribe-header-label {
  display: none !important;
}

.store-subscribe-mobile-dock {
  overflow: hidden;
  max-width: 44px;
  max-height: 44px;
  width: 44px;
  height: 44px;
  min-height: 44px;
  padding: 0;
  border-radius: 50%;
  font-size: 1.05rem;
  border: none;
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.96), rgba(22, 163, 74, 0.92));
  color: #fff;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.28);
}

.store-subscribe-mobile-dock:hover {
  background: linear-gradient(135deg, rgba(34, 197, 94, 1), rgba(22, 163, 74, 0.98));
  transform: translateY(-2px) scale(1.03);
}

/* جوال: الأزرار داخل mobile-bottom-dock — لا تثبيت منفصل */
@media (max-width: 768px) {
  body:has(#mobileBottomDock) #storeSubscribeFab.store-subscribe-header-btn.show {
    position: static !important;
    left: auto !important;
    bottom: auto !important;
    transform: none !important;
  }

  body:has(#photoModeToggle):not(:has(#mobileBottomDock)) #storeSubscribeFab.store-subscribe-header-btn.show {
    position: fixed !important;
    left: calc(10px + 44px + 10px) !important;
    right: auto !important;
    top: auto !important;
    bottom: calc(10px + env(safe-area-inset-bottom, 0px)) !important;
    z-index: 1251 !important;
    width: 44px !important;
    height: 44px !important;
    min-height: 44px !important;
    padding: 0 !important;
    margin: 0 !important;
    border-radius: 50% !important;
    border: none !important;
    font-size: 1.05rem !important;
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.96), rgba(22, 163, 74, 0.92)) !important;
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.28) !important;
    transform: none !important;
  }

  body:has(#photoModeToggle) #storeSubscribeFab.store-subscribe-header-btn.show:hover {
    transform: translateY(-2px) scale(1.03) !important;
    background: linear-gradient(135deg, rgba(34, 197, 94, 1), rgba(22, 163, 74, 0.98)) !important;
  }

  body:has(#photoModeToggle) #storeSubscribeFab .store-subscribe-header-label {
    display: none !important;
  }
}

@media (max-width: 768px) {
  body:not(:has(#photoModeToggle)) .store-subscribe-header-btn.show {
    width: 2.1rem;
    height: 2.1rem;
    padding: 0;
    border-radius: 50%;
    font-size: 1.05rem;
  }

  body:not(:has(#photoModeToggle)) .store-subscribe-header-btn .store-subscribe-header-label {
    display: none;
  }
}
