/* ===== PROFILE PAGE ===== */

/* Loading state */
.perfil-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 60vh;
  gap: 16px;
  color: var(--text-muted);
  font-size: 0.95rem;
}
.perfil-loading-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Not logged in */
.perfil-not-logged {
  padding-top: 120px;
}
.perfil-empty {
  text-align: center;
  padding: 80px 24px;
  max-width: 440px;
  margin: 0 auto;
}
.perfil-empty-icon {
  font-size: 3.5rem;
  display: block;
  margin-bottom: 16px;
}
.perfil-empty h2 {
  font-family: var(--font-heading);
  font-size: 1.6rem;
  font-weight: 800;
  margin-bottom: 10px;
}
.perfil-empty p {
  color: var(--text-muted);
  margin-bottom: 24px;
  font-size: 1rem;
}

/* Profile main */
.perfil-main {
  padding-top: 110px;
  padding-bottom: 60px;
  min-height: 70vh;
}

/* Profile header */
.perfil-header {
  display: flex;
  align-items: center;
  gap: 28px;
  margin-bottom: 40px;
  padding: 36px 40px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
}
.perfil-avatar-wrap {
  position: relative;
  width: 80px;
  height: 80px;
  flex-shrink: 0;
}
.perfil-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 2rem;
}
.perfil-avatar-img {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  object-fit: cover;
  position: absolute;
  top: 0;
  left: 0;
}
.perfil-avatar-upload {
  position: absolute;
  bottom: -2px;
  right: -2px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border: 2px solid var(--bg);
  transition: transform 0.2s;
}
.perfil-avatar-upload:hover {
  transform: scale(1.1);
}
  font-family: var(--font-heading);
  flex-shrink: 0;
}
.perfil-header-info {
  flex: 1;
}
.perfil-certified-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff;
  padding: 6px 16px;
  border-radius: 20px;
  font-size: 0.78rem;
  font-weight: 700;
  margin-bottom: 10px;
}
.perfil-name {
  font-family: var(--font-heading);
  font-size: 2rem;
  font-weight: 800;
  margin-bottom: 8px;
  color: var(--text);
}
.perfil-meta {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
}
.perfil-meta-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.9rem;
  color: var(--text-muted);
  font-weight: 600;
}

/* Profile body */
.perfil-body {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 28px;
  align-items: start;
}
.perfil-col-main,
.perfil-col-side {
  display: flex;
  flex-direction: column;
  gap: 24px;
}
.perfil-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px;
  box-shadow: var(--shadow);
}
.perfil-card h3 {
  font-family: var(--font-heading);
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 24px;
  color: var(--text);
}
.perfil-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}
.perfil-card-header h3 {
  margin-bottom: 0;
}
.perfil-edit-btn {
  background: var(--primary-lighter);
  color: var(--primary);
  border: none;
  padding: 6px 16px;
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  font-family: var(--font-body);
}
.perfil-edit-btn:hover {
  background: var(--primary);
  color: #fff;
}

/* Info grid */
.perfil-info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
.perfil-info-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.perfil-info-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
}
.perfil-info-value {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
}

/* Edit grid */
.perfil-edit-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.perfil-edit-actions {
  display: flex;
  gap: 12px;
  margin-top: 20px;
}

/* Stats */
.perfil-stats-card h3 {
  margin-bottom: 20px;
}
.perfil-stat-row {
  display: flex;
  gap: 20px;
  margin-bottom: 20px;
}
.perfil-stat {
  flex: 1;
  text-align: center;
  padding: 16px 8px;
  background: var(--bg);
  border-radius: var(--radius);
}
.perfil-stat-number {
  display: block;
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--primary);
  margin-bottom: 4px;
}
.perfil-stat-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 600;
}
.perfil-stats-note {
  font-size: 0.82rem;
  color: var(--text-soft);
  text-align: center;
  font-style: italic;
  line-height: 1.5;
}

/* Pending badge */
.perfil-pending-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #fff3e0;
  color: #e65100;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 0.82rem;
  font-weight: 700;
  margin-bottom: 6px;
}

/* Completion card */
.perfil-completion-card h3 {
  margin-bottom: 12px;
}
.completion-bar {
  height: 8px;
  background: var(--border);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 6px;
}
.completion-fill {
  height: 100%;
  background: linear-gradient(90deg, #e65100, #4b7462);
  border-radius: 4px;
  width: 0;
  transition: width 0.5s ease;
}
.completion-text {
  display: block;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 14px;
}
.completion-checklist {
  list-style: none;
  padding: 0;
  margin: 0 0 16px 0;
}
.completion-checklist li {
  font-size: 0.85rem;
  padding: 5px 0;
  display: flex;
  align-items: center;
  gap: 8px;
}
.completion-checklist li.comp-done {
  color: var(--primary);
  font-weight: 600;
}
.completion-checklist li.comp-pending {
  color: var(--text-muted);
}
.completion-visit-notice {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  background: #e8f5e9;
  padding: 14px;
  border-radius: 10px;
  border-left: 4px solid var(--primary);
}
.completion-visit-notice svg {
  flex-shrink: 0;
  color: var(--primary);
  margin-top: 2px;
}
.completion-visit-notice strong {
  display: block;
  font-size: 0.85rem;
  margin-bottom: 4px;
}
.completion-visit-notice p {
  font-size: 0.8rem;
  color: var(--text-soft);
  margin: 0;
  line-height: 1.4;
}

/* Plan card */
.perfil-plan-card {
  text-align: center;
}
.plan-current-badge {
  display: inline-block;
  color: #fff;
  padding: 8px 20px;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 700;
  margin-bottom: 12px;
}
.perfil-plan-card h3 {
  margin-bottom: 16px;
}
.plan-checklist {
  text-align: left;
  margin-bottom: 20px;
}
.plan-checklist li {
  padding: 6px 0;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  gap: 8px;
}
.plan-checklist li.plan-on {
  color: var(--text);
}
.plan-checklist li.plan-off {
  color: var(--text-muted);
  opacity: 0.5;
}
.plan-upgrade-btn {
  margin-top: 4px;
}

/* Photo gallery */
.photo-count-badge {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--bg);
  padding: 2px 10px;
  border-radius: 12px;
  margin-left: 6px;
}
.photo-upload-label {
  cursor: pointer;
}
.photo-upload-label.disabled {
  opacity: 0.4;
  pointer-events: none;
}
.photo-upload-progress {
  margin-bottom: 16px;
}
.photo-progress-bar {
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 6px;
}
.photo-progress-fill {
  height: 100%;
  background: var(--primary);
  border-radius: 2px;
  width: 0;
  transition: width 0.3s ease;
}
.photo-progress-text {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 600;
}
.photo-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 12px;
}
.photo-empty {
  grid-column: 1 / -1;
  text-align: center;
  color: var(--text-soft);
  font-size: 0.9rem;
  padding: 24px;
  font-style: italic;
}
.photo-thumb {
  position: relative;
  border-radius: 10px;
  overflow: hidden;
  aspect-ratio: 1;
  cursor: pointer;
}
.photo-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}
.photo-thumb:hover img {
  transform: scale(1.05);
}
.photo-delete {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(0,0,0,.6);
  color: #fff;
  border: none;
  font-size: 1rem;
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  line-height: 1;
}
.photo-thumb:hover .photo-delete {
  display: flex;
}

/* Lightbox */
.lightbox-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(0,0,0,.85);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.lightbox-close {
  position: absolute;
  top: 20px;
  right: 24px;
  background: none;
  border: none;
  color: #fff;
  font-size: 2.5rem;
  cursor: pointer;
  line-height: 1;
}
.lightbox-img {
  max-width: 90vw;
  max-height: 85vh;
  border-radius: 8px;
  object-fit: contain;
}

/* Description */
.perfil-description {
  font-size: 0.92rem;
  line-height: 1.6;
  color: var(--text-soft);
  margin: 0;
}
.perfil-textarea {
  resize: vertical;
  min-height: 80px;
  font-family: inherit;
}

/* Services & Prices */
.service-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  gap: 12px;
}
.service-item:last-child { border-bottom: none; }
.service-name {
  font-weight: 600;
  font-size: 0.9rem;
  flex: 1;
}
.service-price {
  font-weight: 700;
  color: var(--primary);
  font-size: 0.9rem;
  white-space: nowrap;
}
.service-delete {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.2rem;
  cursor: pointer;
  padding: 0 4px;
  opacity: 0;
  transition: opacity 0.2s;
}
.service-item:hover .service-delete { opacity: 1; }
.add-service-form {
  padding-top: 12px;
  border-top: 1px solid var(--border);
  margin-top: 8px;
}

/* Share Card */
.perfil-share-card h3 { margin-bottom: 12px; }
.share-buttons {
  display: flex;
  gap: 10px;
}
.share-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}
.share-whatsapp { color: #25d366; }
.share-whatsapp:hover { background: #25d366; color: #fff; border-color: #25d366; }
.share-copy { color: var(--text); }
.share-copy:hover { background: var(--primary); color: #fff; border-color: var(--primary); }
.share-copied {
  display: block;
  text-align: center;
  font-size: 0.78rem;
  color: var(--primary);
  font-weight: 700;
  margin-top: 8px;
}

/* QR Card */
.perfil-qr-card { text-align: center; }
.perfil-qr-card canvas {
  display: block;
  margin: 12px auto 0;
  border-radius: 8px;
}
.qr-subtitle {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin: 4px 0 0;
}

/* Badge Card */
.perfil-badge-card { text-align: center; }
.badge-preview {
  margin: 16px auto;
  padding: 20px 24px;
  background: #fff;
  border: 2px solid var(--primary);
  border-radius: 14px;
  display: inline-block;
}
.badge-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
.badge-text {
  font-size: 1rem;
  font-weight: 800;
  color: var(--primary);
}
.badge-brand {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
}

/* Reviews Section */
.perfil-reviews-section {
  margin-top: 28px;
}
.review-count-badge {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--bg);
  padding: 2px 10px;
  border-radius: 12px;
  margin-left: 6px;
}
.review-summary {
  text-align: center;
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 16px;
}
.review-avg-number {
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--text);
  display: block;
}
.review-avg-stars { margin: 4px 0 6px; }
.review-avg-count {
  font-size: 0.82rem;
  color: var(--text-muted);
}
.star { font-size: 1.1rem; }
.star-filled { color: #f5a623; }
.star-empty { color: #ddd; }

.review-item {
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
}
.review-item:last-child { border-bottom: none; }
.review-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}
.review-author {
  font-weight: 700;
  font-size: 0.9rem;
}
.review-date {
  font-size: 0.78rem;
  color: var(--text-muted);
}
.review-stars { margin-bottom: 6px; }
.review-text {
  font-size: 0.88rem;
  color: var(--text-soft);
  line-height: 1.5;
  margin: 0;
}

/* Review Form */
.review-form-wrap {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}
.review-form-wrap h4 {
  margin-bottom: 12px;
  font-size: 1rem;
}
.review-stars-input {
  display: flex;
  gap: 6px;
  margin-bottom: 12px;
}
.star-input {
  font-size: 2rem;
  color: #ddd;
  cursor: pointer;
  transition: color 0.15s, transform 0.15s;
  user-select: none;
}
.star-input.active, .star-input.hover { color: #f5a623; }
.star-input:hover { transform: scale(1.2); }
.review-form-wrap .reg-input { margin-bottom: 10px; }

/* Public contact card */
.perfil-whatsapp-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: #25d366;
  border-color: #25d366;
  font-size: 1rem;
  padding: 14px 24px;
}
.perfil-whatsapp-btn:hover {
  background: #1da851;
  border-color: #1da851;
  box-shadow: 0 4px 15px rgba(37,211,102,.35);
}
.perfil-contact-note {
  text-align: center;
  font-size: 0.82rem;
  color: var(--text-soft);
  margin-top: 12px;
}

/* Responsive */
@media (max-width: 768px) {
  .perfil-header {
    flex-direction: column;
    text-align: center;
    padding: 28px 24px;
  }
  .perfil-meta {
    justify-content: center;
  }
  .perfil-body {
    grid-template-columns: 1fr;
  }
  .photo-gallery {
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  }
  .perfil-info-grid,
  .perfil-edit-grid {
    grid-template-columns: 1fr;
  }
  .perfil-name {
    font-size: 1.5rem;
  }
  .perfil-stat-row {
    flex-direction: column;
  }
}
