/* ========================================
   Profile Dropdown (navbar hover menu)
   ======================================== */

.profile-dropdown-wrap {
  position: relative;
}

.profile-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  padding-top: 6px;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  transition: opacity 0.18s, transform 0.18s, visibility 0s 0.18s;
  pointer-events: none;
}

.profile-dropdown-wrap:hover .profile-dropdown,
.profile-dropdown-wrap.dropdown-open .profile-dropdown {
  transition: opacity 0.18s, transform 0.18s, visibility 0s 0s;
}

.profile-dropdown-inner {
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.12);
  min-width: 180px;
  padding: 6px 0;
}

/* Desktop: hover to open */
@media (hover: hover) {
  .profile-dropdown-wrap:hover .profile-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
  }
}

.profile-dropdown__item {
  display: block;
  padding: 9px 16px;
  font-size: 13px;
  color: #333;
  text-decoration: none;
  transition: background 0.12s;
}
.profile-dropdown__item:hover {
  background: #f5f5f5;
}

.profile-dropdown__item--danger {
  color: #C62828;
}
.profile-dropdown__item--danger:hover {
  background: #FFF5F5;
}

.profile-dropdown__divider {
  height: 1px;
  background: #eee;
  margin: 4px 0;
}

/* ========================================
   Profile View
   ======================================== */

.profile-view {
  max-width: 900px;
  margin: 0 auto;
  padding: 40px 20px 80px;
}

.profile-header {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 32px;
}

.profile-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: #212121;
  color: #fff;
  font-size: 24px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display, 'Bebas Neue', sans-serif);
  flex-shrink: 0;
}

.profile-info h1 {
  font-family: var(--font-display, 'Bebas Neue', sans-serif);
  font-size: 1.8rem;
  letter-spacing: 1px;
  margin: 0;
}

.profile-info p {
  color: #757575;
  font-size: 13px;
  margin: 2px 0 0;
}

/* Tabs */
.profile-tabs {
  display: flex;
  gap: 0;
  border-bottom: 2px solid #f0f0f0;
  margin-bottom: 28px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.profile-tabs::-webkit-scrollbar { display: none; }

.profile-tab {
  background: none;
  border: none;
  padding: 10px 14px;
  font-size: 11px;
  font-weight: 600;
  color: #999;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: color 0.2s, border-color 0.2s;
  font-family: inherit;
  white-space: nowrap;
}

.profile-tab.active {
  color: #212121;
  border-bottom-color: #212121;
}

.profile-tab:hover:not(.active) { color: #555; }

/* Sticky tabs — inline style on element: position:sticky;top:0;z-index:100;background:#fff */

/* Tab content */
.profile-tab-content {
  display: none;
}
.profile-tab-content.active { display: block; }

/* Orders */
.profile-orders-empty,
.profile-addresses-empty {
  text-align: center;
  padding: 48px 20px;
  color: #999;
}

.profile-orders-empty svg,
.profile-addresses-empty svg {
  margin-bottom: 12px;
  opacity: 0.4;
}

.profile-order-card {
  border: 1px solid #eee;
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 12px;
  transition: box-shadow 0.2s;
}

.profile-order-card:hover {
  box-shadow: 0 2px 12px rgba(0,0,0,0.06);
}

.profile-order-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.profile-order-id {
  font-size: 12px;
  color: #999;
}

.profile-order-date {
  font-size: 12px;
  color: #999;
}

.profile-order-status {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.profile-order-status--recibido { background: #E3F2FD; color: #1565C0; }
.profile-order-status--proceso { background: #FFF3E0; color: #E65100; }
.profile-order-status--camino { background: #FFF9C4; color: #F9A825; }
.profile-order-status--entrega { background: #E0F2F1; color: #00695C; }
.profile-order-status--entregado { background: #E8F5E9; color: #2E7D32; }

.profile-order-count {
  font-size: 11px;
  color: #777;
  margin-left: 6px;
}

.profile-order-items {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.profile-order-item {
  display: flex;
  align-items: center;
  gap: 10px;
}

.profile-order-item img {
  width: 40px;
  height: 40px;
  object-fit: contain;
  border-radius: 4px;
  background: #f5f5f5;
}

.profile-order-item-info {
  font-size: 13px;
  flex: 1;
}

.profile-order-item-name {
  font-weight: 600;
}

.profile-order-item-meta {
  color: #999;
  font-size: 11px;
}

.profile-order-item-price {
  font-size: 13px;
  color: #333;
  white-space: nowrap;
}

.profile-order-footer {
  display: flex;
  justify-content: flex-end;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid #f0f0f0;
}

.profile-order-total {
  font-size: 14px;
  font-weight: 700;
}

/* Order card expand */
.profile-order-chevron {
  transition: transform 0.2s;
  color: #999;
}
.profile-order-card.expanded .profile-order-chevron {
  transform: rotate(180deg);
}

.profile-order-detail {
  overflow: hidden;
}

.order-detail-content {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid #eee;
}

.order-detail-section {
  margin-bottom: 16px;
}
.order-detail-section h4 {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #999;
  margin: 0 0 10px;
}
.order-detail-section p {
  margin: 2px 0;
  font-size: 13px;
}

.order-detail-item {
  background: #fafafa;
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 8px;
}
.order-detail-item-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}
.order-detail-item-header img {
  width: 56px;
  height: 56px;
  object-fit: contain;
  border-radius: 6px;
  background: #fff;
}
.order-detail-patch-img {
  width: 28px !important;
  height: 28px !important;
  margin-left: -6px;
}
.order-detail-item-name {
  font-weight: 600;
  font-size: 14px;
}
.order-detail-item-price {
  font-size: 13px;
  color: #666;
}

.order-detail-specs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px 16px;
}
.order-detail-spec {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  padding: 3px 0;
}
.order-detail-spec-label {
  color: #999;
}
.order-detail-spec-value {
  font-weight: 500;
  color: #333;
}

/* Addresses */
.profile-address-card {
  border: 1px solid #eee;
  border-radius: 10px;
  padding: 14px 16px;
  margin-bottom: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.profile-address-card--default {
  border-color: #212121;
}

.profile-address-label {
  font-weight: 700;
  font-size: 13px;
  margin-bottom: 2px;
}

.profile-address-detail {
  font-size: 12px;
  color: #757575;
}

.profile-address-default {
  display: inline-block;
  background: #212121;
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 3px;
  margin-left: 6px;
  text-transform: uppercase;
}

.profile-address-actions {
  display: flex;
  gap: 6px;
}

.profile-address-actions button {
  background: none;
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 11px;
  cursor: pointer;
  font-family: inherit;
}

.profile-address-actions button:hover { background: #f5f5f5; }

.profile-address-actions button.btn-danger,
.profile-address-actions button.btn-danger-sm {
  color: #C62828;
  border-color: #FFCDD2;
}
.profile-address-actions button.btn-danger-sm:hover { background: #FFF5F5; }

.profile-address-actions button.btn-outline-sm {
  color: #333;
}
.profile-address-actions button.btn-outline-sm:hover { background: #f0f0f0; }

.profile-add-btn {
  width: 100%;
  padding: 14px;
  border: 2px dashed #ddd;
  border-radius: 10px;
  background: none;
  font-size: 13px;
  font-weight: 600;
  color: #999;
  cursor: pointer;
  font-family: inherit;
  transition: border-color 0.2s, color 0.2s;
}

.profile-add-btn:hover {
  border-color: #212121;
  color: #212121;
}

/* Preferences form */
.profile-prefs-form {
  max-width: 500px;
}

.profile-prefs-form .auth-field {
  margin-bottom: 16px;
}

.profile-prefs-form .auth-field label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: #757575;
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.profile-prefs-form input,
.profile-prefs-form select {
  width: 100%;
  height: 44px;
  border: 1.5px solid #e0e0e0;
  border-radius: 8px;
  padding: 0 14px;
  font-size: 14px;
  font-family: inherit;
  outline: none;
  box-sizing: border-box;
}

.profile-prefs-form input:focus,
.profile-prefs-form select:focus {
  border-color: #212121;
}

.profile-save-btn {
  height: 44px;
  padding: 0 32px;
  background: #212121;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.profile-save-btn:hover { background: #000; }

.profile-logout-btn {
  display: inline-block;
  margin-top: 24px;
  padding: 10px 24px;
  border: 1px solid #C62828;
  border-radius: 8px;
  background: none;
  color: #C62828;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}

.profile-logout-btn:hover {
  background: #C62828;
  color: #fff;
}

.profile-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: #212121;
  color: #fff;
  padding: 10px 24px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  z-index: 99999;
  animation: profileToastIn 0.3s ease;
}

@keyframes profileToastIn {
  from { opacity: 0; transform: translateX(-50%) translateY(10px); }
  to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

@media (max-width: 600px) {
  .profile-header { gap: 14px; }
  .profile-avatar { width: 48px; height: 48px; font-size: 18px; }
  .profile-info h1 { font-size: 1.4rem; }
  .profile-order-top { flex-direction: column; align-items: flex-start; gap: 6px; }
}
