/* styles.css - adaptado para Bori Shop
   Incluye estilos para:
   - auth-container (login)
   - app-container / nav / main
   - product-form (crear productos)
   - catalog + product-card
   - carrito flotante (cart-section)
   - profile-section
   - utilidades responsivas y botones
*/

/* Reset / base */
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: 'Segoe UI', Arial, sans-serif;
  background: linear-gradient(180deg,#0a2733 0%, #136791 100%);
  color: #111;
  -webkit-font-smoothing:antialiased;
  -moz-osx-font-smoothing:grayscale;
}

/* Centered login screen */
.centered {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 2rem;
}
#auth-container {
  background: url(./img/Space-Background-Images.jpg) center/cover no-repeat;
  padding: 2rem;
  border-radius: 12px;
  box-shadow: 0 8px 40px rgba(0,0,0,0.2);
  min-width: 280px;
  text-align: center;
}
#auth-container img { max-width: 200px; display:block; margin: 0 auto 12px; }
#auth-container button {
  display: inline-block;
  padding: 0.9rem 1.6rem;
  margin: 8px 0;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  font-weight: 700;
}
#auth-container #phantom-login-btn { background:#8f57ff; color:white; }
#auth-container #coinbase-login-btn { background:#0052FF; color:white; }

#auth-msg { color:#ffdddd; margin-top:10px; font-weight:600; }

/* App layout */
.hidden { display: none !important; }

#app-container nav {
  *background: #cf9203;
  background: url(./img/images00000000000.jpg);
  background-repeat: no-repeat;
  background-size: 100%;
  color: #170e0e;
  padding: 12px 16px;
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: flex-start;
  flex-wrap: wrap;
}
#app-container nav #welcome {
  font-weight:700;
  margin-right: auto;
}
#app-container nav img#profile-pic { width:40px; height:40px; border-radius:50%; object-fit:cover; display:inline-block; margin-left:8px; }
#app-container nav button {
  padding:8px 10px;
  border-radius:8px;
  border:1px solid rgba(0,0,0,0.06);
  background:#fff;
  cursor:pointer;
}
#app-container nav button#logout-btn { background:#ed174f; color:#fff; border-color:rgba(0,0,0,0.06); }
#app-container nav button#profile-btn { background:#3e17ed; color:#fff; }

/* Main container */
main {
  max-width: 980px;
  margin: 1.5rem auto;
  padding: 0 12px;
}

/* Product form */
#product-form {
  background: rgba(255,255,255,0.95);
  padding: 14px;
  border-radius: 10px;
  box-shadow: 0 6px 24px rgba(0,0,0,0.06);
}
#product-form input[type="text"],
#product-form input[type="file"],
#product-form textarea,
#product-form input[type="number"],
#product-form input[type="tel"] {
  width: 100%;
  padding: 10px;
  margin: 6px 0;
  border-radius: 8px;
  border: 1px solid #ddd;
  background: #fff;
  font-size: 0.98rem;
}
#product-form button {
  padding: 10px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
}

/* Catalog list */
#catalog {
  margin-top: 1.2rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 14px;
}

/* Card for each product */
.product-card {
  background: #c4f1ff;
  padding: 12px;
  border-radius: 10px;
  box-shadow: 0 6px 20px rgba(0,0,0,0.05);
  display: flex;
  align-items: center;
  gap: 12px;
}
.product-card > img {
  width: 120px;
  height: 120px;
  object-fit: cover;
  border-radius: 8px;
  flex-shrink: 0;
}
.product-info {
  flex: 1;
}
.title {
  font-weight: 700;
  font-size: 1.05rem;
  margin-bottom: 6px;
}
.desc {
  color: #555;
  font-size: 0.95rem;
  margin-bottom: 8px;
}
.meta {
  color: #222;
  font-weight: 700;
}
.actions {
  text-align: right;
  display:flex;
  flex-direction:column;
  gap:8px;
}
.actions > button {
  padding: 8px 10px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
}
.add-cart-btn{
    *color: #0052FF;
}
.add-cart-btn { background: #27ae60; color: #fff; }
.edit-product-btn,
.delete-product-btn { background:#eee; color:#111; }

/* Cart floating panel */
#cart-section {
  position: fixed;
  right: 16px;
  top: 80px;
  width: 340px;
  max-height: 76vh;
  overflow:auto;
  background: #fff;
  padding: 12px;
  border-radius: 12px;
  box-shadow: 0 18px 60px rgba(0,0,0,0.18);
  z-index: 1200;
}
#cart-section.hidden { display:none; }
#cart-section h3 { margin:0 0 10px 0; }
#cart-list .cart-item {
  display:flex;
  gap:8px;
  align-items:center;
  padding: 8px 0;
  border-bottom: 1px solid #f0f0f0;
}
#cart-list .cart-item img { width:56px; height:56px; object-fit:cover; border-radius:6px; }
.cart-item .cart-meta { flex:1; }
.cart-item .cart-meta .name { font-weight:700; }
.cart-item .cart-meta .price { color:#444; font-size:0.95rem; }
.cart-item .cart-actions { text-align:right; }
.cart-item input[type="number"] { width:60px; padding:6px; border-radius:6px; border:1px solid #ddd; }

/* Buttons in cart */
#checkout-btn { background:#0052FF; color:#fff; border:none; padding:10px; border-radius:8px; cursor:pointer; flex:1; }
#clear-cart-btn { background:#eee; border:none; padding:10px; border-radius:8px; cursor:pointer; }

/* Profile section */
#profile-section {
  background: rgba(255,255,255,0.95);
  border-radius: 10px;
  padding: 16px;
  box-shadow: 0 8px 30px rgba(0,0,0,0.07);
}
#profile-section input[type="text"],
#profile-section input[type="tel"],
#profile-section input[type="file"] {
  width:100%;
  padding:8px;
  margin:6px 0;
  border-radius:8px;
  border:1px solid #ddd;
}

/* Post / feed compatibility (kept for backwards compatibility) */
#post-form, #post-input, #post-image, #feed, .post {
  /* keep defaults to avoid JS UI errors if any post-related elements still exist */
}
#feed { display:flex; flex-direction:column-reverse; gap:12px; }

/* Footer */
footer {
  text-align:center;
  padding:18px 8px;
  color:#fff;
  opacity:0.9;
  font-size:0.92rem;
}

/* Small utilities */
.button-ghost { background:transparent; border:1px solid #ddd; padding:8px 10px; border-radius:8px; cursor:pointer; }

/* Responsive tweaks */
@media (max-width: 920px) {
  #cart-section { width: 88vw; right: 6vw; top: 70px; }
  .product-card { flex-direction: row; }
}
@media (max-width: 650px) {
  #app-container nav { padding: 8px; gap:8px; }
  #product-form { padding:10px; }
  #catalog { gap:10px; grid-template-columns: 1fr; }
  #cart-section { right: 4vw; width: 92vw; top: 68px; }
}