/* ==========================================
   Add Product Modal
   ========================================== */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.5);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-md);
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-normal);
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal {
  background: var(--white);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 500px;
  max-height: min(90vh, calc(100dvh - (var(--space-md) * 2)));
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transform: translateY(20px) scale(0.95);
  transition: transform var(--transition-normal);
}

.modal-overlay.active .modal {
  transform: translateY(0) scale(1);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-lg);
  border-bottom: 1px solid var(--light-gray);
  position: sticky;
  top: 0;
  background: var(--white);
  z-index: 1;
}

.modal-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--dark-gray);
}

.modal-close {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-gray);
  transition: all var(--transition-fast);
}

.modal-close:hover {
  background: var(--light-gray);
  color: var(--dark-gray);
}

.modal-body {
  padding: var(--space-lg);
  overflow-y: auto;
  flex: 1 1 auto;
  min-height: 0;
  -webkit-overflow-scrolling: touch;
  padding-bottom: calc(var(--space-lg) + env(safe-area-inset-bottom, 0) + 24px);
}

.modal-footer {
  display: flex;
  gap: var(--space-md);
  padding: var(--space-lg);
  border-top: 1px solid var(--light-gray);
  position: sticky;
  bottom: 0;
  background: var(--white);
  flex-shrink: 0;
  padding-bottom: calc(var(--space-lg) + env(safe-area-inset-bottom, 0));
}

.android-app-modal-overlay {
  backdrop-filter: blur(8px);
  background:
    radial-gradient(circle at top, rgba(27, 160, 88, 0.18), transparent 36%),
    rgba(4, 15, 11, 0.72);
}

.android-app-modal {
  max-width: 460px;
  border: 1px solid rgba(5, 66, 57, 0.08);
  box-shadow: 0 24px 60px rgba(4, 15, 11, 0.28);
}

.android-app-modal-header {
  align-items: flex-start;
  gap: var(--space-md);
}

.android-app-modal-badge {
  width: 56px;
  height: 56px;
  border-radius: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: linear-gradient(135deg, #34d06f, var(--primary-green));
  color: var(--white);
  box-shadow: 0 14px 28px rgba(5, 66, 57, 0.2);
}

.android-app-modal-badge svg {
  width: 28px;
  height: 28px;
}

.android-app-modal-subtitle {
  margin-top: 6px;
  color: var(--text-gray);
  font-size: 0.92rem;
}

.android-app-modal-body {
  display: grid;
  gap: var(--space-md);
}

.android-app-modal-text {
  line-height: 1.8;
  color: var(--dark-gray);
}

.android-app-modal-features {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
}

.android-app-modal-features span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(5, 66, 57, 0.06);
  color: var(--primary-green);
  font-size: 0.88rem;
  font-weight: 700;
}

.android-app-modal-reminder {
  margin: 0 var(--space-lg) calc(-1 * var(--space-sm));
  color: var(--text-gray);
  font-size: 0.82rem;
  text-align: center;
}

.android-app-modal-footer {
  flex-direction: column;
}

.android-app-modal-footer .btn {
  min-height: 48px;
  width: 100%;
}

.android-app-modal-apk-btn {
  order: 2;
}

.android-app-modal-footer .btn-ghost {
  order: 3;
  min-height: auto;
  padding: var(--space-xs);
}

.btn-playstore {
  order: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: #000000;
  color: var(--white);
  border-radius: var(--radius-md);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.28);
}

.btn-playstore:hover {
  background: #1a1a1a;
}

.btn-playstore-icon {
  width: 26px;
  height: 26px;
  flex-shrink: 0;
}

.btn-playstore-text {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  line-height: 1.25;
}

.btn-playstore-text small {
  font-size: 0.62rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  opacity: 0.85;
}

.btn-playstore-text strong {
  font-size: 1rem;
  font-weight: 700;
}

/* Image Upload */
.image-upload {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-sm);
  margin-bottom: var(--space-md);
}

.media-upload-summary {
  margin-bottom: var(--space-md);
  color: var(--primary-green);
  font-size: 0.85rem;
  font-weight: 600;
}

.my-product-card {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.my-product-actions-inline {
  display: flex;
  justify-content: flex-end;
  gap: var(--space-sm);
  flex-wrap: wrap;
}

.image-upload-item {
  aspect-ratio: 1;
  border: 2px dashed var(--light-gray);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-fast);
  overflow: hidden;
  position: relative;
}

.image-upload-item:hover {
  border-color: var(--primary-green-accent);
}

.image-upload-item.has-image {
  border: none;
}

.image-upload-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.image-upload-item video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.image-upload-placeholder {
  color: var(--text-gray);
  font-size: 1.5rem;
}

.image-upload-remove {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 24px;
  height: 24px;
  background: rgba(0,0,0,0.6);
  color: var(--white);
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  opacity: 0;
  transition: opacity var(--transition-fast);
}

.image-upload-item:hover .image-upload-remove {
  opacity: 1;
}

.image-upload-meta {
  position: absolute;
  left: 6px;
  bottom: 6px;
  background: rgba(0, 0, 0, 0.7);
  color: var(--white);
  padding: 4px 8px;
  border-radius: var(--radius-full);
  font-size: 0.72rem;
}

.cover-image-picker {
  margin-bottom: var(--space-md);
  padding: var(--space-md);
  background: var(--off-white);
  border-radius: var(--radius-md);
}

.cover-image-picker-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--dark-gray);
  margin-bottom: var(--space-sm);
}

.cover-image-options {
  display: flex;
  gap: var(--space-sm);
  flex-wrap: wrap;
}

.cover-image-option {
  width: 84px;
  border: 2px solid transparent;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--white);
  transition: all var(--transition-fast);
}

.cover-image-option.active {
  border-color: var(--primary-green);
  box-shadow: 0 0 0 3px rgba(66, 129, 119, 0.12);
}

.cover-image-option button {
  width: 100%;
  display: block;
}

.cover-image-option img {
  width: 100%;
  height: 68px;
  object-fit: cover;
  display: block;
}

.cover-image-option span {
  display: block;
  padding: 6px 4px;
  text-align: center;
  font-size: 0.75rem;
  color: var(--medium-gray);
}
