/* =========================================================
   QWIPLUS - STYLE.CSS
   Organizado por secciones, sin duplicados ni código muerto
   ========================================================= */


/* =========================================================
   1. VARIABLES
   ========================================================= */

:root {

  /* BRAND */
  --accent:  #6DA8FF;
  --accent2: #6EE7B7;

  /* UI */
  --bg:           #0B0F14;
--card:         #161B24;


  --text:  #F5F7FA;
  --muted: #94A3B8;

  /* DESIGN */
  --radius: 18px;

  --shadow-soft: 0 6px 18px rgba(0, 0, 0, 0.06);
  --shadow-card: 0 4px 14px rgba(0, 0, 0, 0.08);

}


/* =========================================================
   2. RESET
   ========================================================= */

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  background: var(--bg);
  color: var(--text);
  min-height: 100%;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.hidden {
  display: none !important;
}

.logo {
  width: 80px;
}


/* =========================================================
   3. APP LAYOUT
   ========================================================= */

#app {
  width: 100%;
  min-height: 100vh;
  background: white;
  position: relative;
}

#main {
  min-height: 100vh;
  padding-bottom: 80px;
}

.page {
  min-height: 100vh;
}


/* =========================================================
   4. HEADER
   ========================================================= */

.header {
  padding: 10px 18px;
  background: var(--bg);
}

.search-input {
  width: 100%;
  padding: 14px 20px;
  border-radius: 999px;
  border: none;
  background: white;
  font-size: 15px;
  box-shadow: var(--shadow-soft);
}

.header-actions {
  display: flex;
  gap: 12px;
  margin-top: 10px;
}


/* =========================================================
   5. BOTONES
   ========================================================= */

.btn {
  flex: 1;
  border: none;
  padding: 12px;
  border-radius: 999px;
  font-weight: 600;
  cursor: pointer;
}

.btn-primary {
  width: 100%;
  padding: 14px;
  border-radius: 12px;
  border: none;
  background: linear-gradient(90deg, #6DA8FF, #4CAF50);
  color: white;
  font-weight: 600;
  cursor: pointer;
  transition: 0.2s;
}

.btn-primary:hover {
  transform: scale(1.02);
}

.btn-primary.small {
  padding: 8px 14px;
  font-size: 13px;
}

.btn-secondary {
  margin-top: 10px;
  width: 100%;
  background: transparent;
  color: #6DA8FF;
  border: none;
  cursor: pointer;
}

.btn-ghost {
  margin-top: 10px;
  width: 100%;
  background: transparent;
  color: #94a3b8;
  border: none;
  cursor: pointer;
}

.btn-oauth {
  width: 100%;
  padding: 12px;
  border-radius: 10px;
  margin-bottom: 10px;
  border: none;
  cursor: pointer;
  font-weight: 500;
  transition: 0.2s;
}

.btn-oauth.google {
  background: white;
  color: black;
}

.btn-oauth.facebook {
  background: #1877f2;
  color: white;
}

.btn-oauth:hover {
  transform: scale(1.02);
}


/* =========================================================
   6. CARDS (ANUNCIOS)
   ========================================================= */

.ads-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  padding: 16px;
  align-items: start;
}

.card {
  width: 100%;
  background: var(--card);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  transition: 0.25s;
}

.card:hover {
  transform: translateY(-4px);
}

.card-image {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background: #f3f4f6;
}

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

.card-info {
  padding: 12px;
}

.card-title {
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 4px;
}

.card-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 4px;
}

.price {
  font-size: 18px;
  font-weight: 700;
}

/* responsive */

@media (min-width: 768px) {
  .ads-grid {
    max-width: 720px;
    margin: 0 auto;
  }

  .card-image {
    aspect-ratio: 4 / 3;
  }
}

@media (max-width: 480px) {
  .ads-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    padding: 14px;
  }
}


/* =========================================================
   7. FAVORITOS
   ========================================================= */

.fav-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  margin-top: 8px;
  border: none;
  border-radius: 50%;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
  cursor: pointer;
  transition: 0.2s;
}

.fav-btn:hover {
  transform: scale(1.08);
}

.fav-btn.active {
  background: linear-gradient(90deg, #ff6b6b, #ff3b3b);
  color: white;
}

.favorite-counter {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 14px;
  font-weight: 800;
  color: #111827;
  background: #f3f4f6;
  padding: 4px 8px;
  border-radius: 999px;
}

.heart-icon {
  font-size: 13px;
}

.fav-count {
  font-size: 13px;
}


/* =========================================================
   8. CATEGORÍAS
   ========================================================= */

.categories-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
  padding: 16px;
}

.category-card {
  position: relative;
  height: 120px;
  background: var(--card-bg);
  border: none;
  border-radius: 18px;
  overflow: hidden;
  padding: 0;
  cursor: pointer;
  text-align: left;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.06);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.category-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.10);
}

.category-card:active {
  transform: scale(0.97);
}

.category-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.category-image {
  width: 100%;
  aspect-ratio: 1 / 1;
  overflow: hidden;
}

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

.category-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to top,
    rgba(0, 0, 0, 0.38),
    rgba(0, 0, 0, 0.05)
  );
}

.category-card span {
  position: absolute;
  bottom: 10px;
  left: 12px;
  right: 12px;
  color: white;
  font-weight: 600;
  font-size: 14px;
  text-align: left;
}

.category-info {
  padding: 12px 14px 14px;
}

.category-info h3 {
  font-size: 15px;
  font-weight: 600;
  color: #2E3A55;
}

.category-title {
  font-size: 16px;
  font-weight: 600;
  color: #2E3A55;
}

.category-sub {
  font-size: 13px;
  color: #777;
  margin-top: 4px;
}


/* =========================================================
   9. SUBCATEGORÍAS
   ========================================================= */

.subcategories {
  padding: 25px 20px 120px;
}

.subcategories h3 {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 18px;
  color: var(--text);
}

.subcategory-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}

.subcategory-item {
  background: var(--card-bg);
  border: none;
  border-radius: 16px;
  padding: 14px 12px;
  text-align: center;
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.05);
  cursor: pointer;
  transition: 0.25s;
}

.subcategory-item:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.08);
}


/* =========================================================
   10. AD DETAIL
   ========================================================= */

.ad-image {
  width: 100%;
  height: 320px;
  overflow: hidden;
  background: #f2f4f8;
  position: relative;
}

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

.ad-image-wrapper {
  width: 100%;
  aspect-ratio: 1 / 1;
  background: #f5f5f5;
  overflow: hidden;
  border-radius: 16px;
  margin-bottom: 12px;
}

.ad-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.ad-body {
  padding: 16px;
}

.ad-title {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 8px;
}

.ad-price {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 12px;
}

.ad-desc {
  font-size: 14px;
  opacity: 0.8;
  margin-bottom: 20px;
}


/* =========================================================
   11. CHAT
   ========================================================= */

.messages-page {
  padding: 10px;
}

.conversation {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-bottom: 1px solid #eee;
}

.conv-img {
  width: 80px;
  height: 80px;
  min-width: 80px;
  border-radius: 12px;
  overflow: hidden;
}

.conv-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.conv-info {
  flex: 1;
}

.conv-name {
  font-weight: 600;
}

.conv-title {
  font-size: 13px;
  color: #777;
}

.conv-last {
  font-size: 14px;
}

.conv-time {
  font-size: 12px;
  color: #999;
}

.chat-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  background: white;
  border-bottom: 1px solid #eee;
}

.chat-ad-mini {
  display: flex;
  align-items: center;
  gap: 10px;
}

.chat-ad-mini img {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  object-fit: cover;
}

.chat-seller-header {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
}

.chat-seller-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  overflow: hidden;
  background: #eee;
}

.chat-seller-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.chat-seller-info {
  display: flex;
  flex-direction: column;
}

.chat-seller-name {
  font-weight: 600;
  font-size: 14px;
}

.chat-seller-ad {
  font-size: 12px;
  color: #777;
}

.chat-buy-bar {
  padding: 10px;
  background: white;
  border-bottom: 1px solid #eee;
}

.chat-buy-actions {
  display: flex;
  gap: 10px;
}

.chat-offer-btn {
  flex: 1;
  border: 2px solid var(--accent);
  background: white;
  color: var(--accent);
  padding: 12px;
  border-radius: 20px;
  font-weight: 600;
}

.chat-buy-btn {
  flex: 1;
  background: linear-gradient(90deg, #6c8cff, #58d6a3);
  color: white;
  border: none;
  padding: 12px;
  border-radius: 20px;
  font-weight: 600;
}

.chat-btn {
  width: 100%;
  padding: 12px;
  border-radius: 12px;
  font-weight: 600;
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.bubble {
  max-width: 70%;
  padding: 10px 14px;
  border-radius: 18px;
  font-size: 14px;
}

.bubble-me {
  align-self: flex-end;
  background: linear-gradient(90deg, #6c8cff, #58d6a3);
  color: white;
}

.bubble-other {
  align-self: flex-start;
  background: #f1f1f1;
}

.chat-input {
  position: sticky;
  bottom: 0;
  display: flex;
  gap: 10px;
  padding: 12px;
  background: white;
  border-top: 1px solid #eee;
}

.chat-input input {
  flex: 1;
  padding: 12px;
  border-radius: 20px;
  border: 1px solid #ddd;
}

.chat-input button {
  padding: 10px 18px;
  border-radius: 20px;
  border: none;
  background: linear-gradient(90deg, #6c8cff, #58d6a3);
  color: white;
  font-weight: 600;
}


/* =========================================================
   12. NAV INFERIOR
   ========================================================= */

.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 64px;
  background: linear-gradient(90deg, #3b82f6, #22c55e);
  display: flex;
  justify-content: space-around;
  align-items: center;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);
  z-index: 50;
}




.nav-item {
  position: relative;
  background: none;
  border: none;
  color: white;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.nav-item small {
  font-size: 11px;
}

.msg-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background: #ef4444;
  color: white;
  font-size: 10px;
  font-weight: 800;
  min-width: 18px;
  height: 18px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
}


/* =========================================================
   13. PERFIL
   ========================================================= */

.profile-page {
  max-width: 600px;
  margin: auto;
  padding: 20px;
}

.profile-pro-header {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 18px;
  margin: 12px 0 18px;
    background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(10px);
  border-radius: 22px;
}

.profile-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.profile-avatar {
  width: 82px;
  height: 82px;
  border-radius: 50%;
  overflow: hidden;
  background: #1a1f2e;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.12);
  flex-shrink: 0;
}

.profile-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.avatar-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 40px;
  color: #888;
}

.profile-user-info h1 {
  margin: 0;
  font-size: 24px;
  color: #111827;
}

.profile-user-info p {
  margin: 4px 0 8px;
  color: #6b7280;
  font-size: 14px;
}

.profile-email {
  font-size: 20px;
  font-weight: 600;
  margin-top: 8px;
}

.profile-badge {
  display: inline-flex;
  padding: 6px 10px;
  border-radius: 999px;
  background: #dbeafe;
  color: #1d4ed8;
  font-size: 12px;
  font-weight: 800;
}

.profile-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 16px;
}

.profile-stat {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 18px;
  padding: 14px;
  text-align: center;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.06);
}

.profile-stat strong {
  display: block;
  font-size: 18px;
  color: #111827;
}

.profile-stat span {
  font-size: 12px;
  color: #6b7280;
}

.profile-actions {
  display: flex;
  gap: 10px;
  margin-top: 14px;
  justify-content: center;
}

.profile-btn {
  padding: 10px 16px;
  border-radius: 20px;
  border: none;
  background: linear-gradient(135deg, #7da6ff, #6fe3c1);
  color: white;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.1);
  transition: 0.2s;
}

.profile-btn:hover {
  transform: translateY(-2px);
}

.section-title-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.profile-card-actions {
  display: flex;
  gap: 8px;
  padding: 10px;
}

.profile-card-actions button {
  flex: 1;
  border: none;
  border-radius: 12px;
  padding: 8px;
  font-weight: 700;
}

.editAdBtn {
  background: #dbeafe;
  color: #1d4ed8;
}

.deleteAd {
  background: #fee2e2;
  color: #b91c1c;
}

.profile-no-ads {
  grid-column: 1 / -1;
  text-align: center;
  padding: 30px;
}

.avatar-upload-btn {
  position: relative;
  border: none;
  padding: 0;
  cursor: pointer;
}

.avatar-edit-badge {
  position: absolute;
  right: -2px;
  bottom: -2px;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: #2563eb;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  box-shadow: 0 6px 16px rgba(37, 99, 235, 0.35);
}


/* =========================================================
   14. PROFILE MENU
   ========================================================= */

.profile-menu-page {
  max-width: 600px;
  margin: auto;
  padding: 20px;
}

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

.profile-menu-avatar {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  overflow: hidden;
  background: #eee;
  flex-shrink: 0;
}

.profile-menu-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.profile-menu-email {
  font-weight: 600;
  font-size: 16px;
}

.profile-menu-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 20px;
}

.profile-menu-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 16px 20px;
  background: linear-gradient(90deg, #3b82f6, #22c55e);
  border: none;
  border-radius: 999px;
  color: white;
  font-weight: 700;
  font-size: 15px;
  text-align: left;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(59, 130, 246, 0.25);
  transition: 0.2s;
}

.profile-menu-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(59, 130, 246, 0.35);
}


/* =========================================================
   15. LOGIN / REGISTER
   ========================================================= */

.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at top, #0f172a, #020617);
  padding: 20px;
}

.login-card {
  width: 100%;
  max-width: 380px;
  padding: 30px;
  border-radius: 20px;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(12px);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6);
  animation: fadeIn 0.4s ease;
}

.login-header {
  text-align: center;
  margin-bottom: 25px;
}

.login-header h1 {
  color: #fff;
  font-size: 28px;
  margin-bottom: 5px;
}

.login-header p {
  color: #94a3b8;
  font-size: 14px;
}

.input-group {
  position: relative;
  margin-bottom: 20px;
}

.input-group input {
  width: 100%;
  padding: 14px;
  border-radius: 10px;
  border: none;
  background: #1e293b;
  color: white;
  font-size: 14px;
}

.input-group label {
  position: absolute;
  top: 14px;
  left: 14px;
  color: #94a3b8;
  font-size: 13px;
  pointer-events: none;
  transition: 0.2s;
}

.input-group input:focus + label,
.input-group input:valid + label {
  top: -8px;
  left: 10px;
  font-size: 11px;
  color: #6DA8FF;
  background: #020617;
  padding: 0 5px;
}

.divider {
  text-align: center;
  margin: 20px 0;
  color: #64748b;
  font-size: 12px;
}

.login-error {
  margin-top: 12px;
  padding: 10px;
  border-radius: 10px;
  background: rgba(255, 0, 0, 0.1);
  color: #ff4d4f;
  font-size: 13px;
  text-align: center;
  display: none;
}


/* =========================================================
   16. ANIMACIONES BASE
   ========================================================= */

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