/* TIENDA */
.nav-back {
  background: rgba(255,255,255,0.1); color: var(--green-pale);
  text-decoration: none; padding: 0.5rem 1.2rem; border-radius: 25px;
  font-size: 0.9rem; font-weight: 600; border: 2px solid rgba(255,255,255,0.2);
  transition: all 0.3s; display: flex; align-items: center; gap: 0.5rem;
}
.nav-back:hover { background: rgba(255,255,255,0.2); color: white; }

.shop-hero {
  background: linear-gradient(135deg, var(--green-dark) 0%, var(--green-mid) 60%, var(--green-bright) 100%);
  padding: 7rem 2rem 3rem; text-align: center;
}
.shop-hero h1 { font-size: clamp(2rem,5vw,3.5rem); font-weight: 900; color: var(--pear-yellow); }
.shop-hero p { color: var(--green-pale); font-size: 1.1rem; margin-top: 0.5rem; }

.filters {
  display: flex; gap: 0.8rem; flex-wrap: wrap; justify-content: center;
  padding: 2rem 2rem 0; max-width: 1200px; margin: 0 auto;
}
.filter-btn {
  padding: 0.5rem 1.4rem; border-radius: 25px; border: 2px solid #ccc;
  background: white; cursor: pointer; font-family: inherit; font-weight: 600;
  font-size: 0.9rem; transition: all 0.3s; color: var(--text-dark);
}
.filter-btn.active, .filter-btn:hover {
  background: var(--green-mid); color: white; border-color: var(--green-mid);
}

.shop-section { padding: 2rem 2rem 5rem; max-width: 1200px; margin: 0 auto; }
.products-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px,1fr)); gap: 2rem; }

.product-card {
  background: white; border-radius: 20px; overflow: hidden;
  box-shadow: 0 4px 20px var(--shadow); transition: all 0.3s; position: relative;
}
.product-card:hover { transform: translateY(-8px); box-shadow: 0 12px 40px rgba(45,122,45,0.2); }
.product-badge {
  position: absolute; top: 1rem; left: 1rem; z-index: 2;
  background: var(--pear-yellow); color: var(--green-dark);
  font-size: 0.7rem; font-weight: 700; padding: 0.25rem 0.7rem;
  border-radius: 20px; text-transform: uppercase;
}
.product-img {
  height: 220px;
  display: flex; align-items: center; justify-content: center;
  font-size: 5rem; position: relative; overflow: hidden;
}
.product-img-overlay {
  position: absolute; inset: 0; background: rgba(0,0,0,0.4);
  display: flex; align-items: center; justify-content: center;
  opacity: 0; transition: 0.3s;
}
.product-card:hover .product-img-overlay { opacity: 1; }
.btn-quick {
  background: white; color: var(--green-dark);
  padding: 0.6rem 1.5rem; border-radius: 25px; font-weight: 700;
  border: none; cursor: pointer; font-family: inherit; font-size: 0.9rem;
}
.product-info { padding: 1.2rem 1.5rem; }
.product-cat { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 1px; color: var(--green-bright); font-weight: 600; margin-bottom: 0.3rem; }
.product-info h3 { font-size: 1.05rem; font-weight: 700; color: var(--green-dark); margin-bottom: 0.3rem; }
.product-info p { font-size: 0.85rem; color: #6a8a6a; margin-bottom: 1rem; }
.product-footer { display: flex; justify-content: space-between; align-items: center; }
.product-price { font-size: 1.4rem; font-weight: 900; color: var(--green-mid); }
.product-price small { font-size: 0.75rem; font-weight: 400; color: #888; display: block; line-height: 1; }
.btn-add {
  background: var(--green-mid); color: white;
  padding: 0.55rem 1.2rem; border-radius: 25px;
  border: none; cursor: pointer; font-family: inherit;
  font-weight: 600; font-size: 0.9rem; transition: all 0.3s;
  display: flex; align-items: center; gap: 0.4rem;
}
.btn-add:hover { background: var(--green-dark); transform: scale(1.05); }
.product-variants { display: flex; gap: 0.4rem; margin-bottom: 0.8rem; flex-wrap: wrap; }
.variant-dot {
  width: 22px; height: 22px; border-radius: 50%; cursor: pointer;
  border: 2px solid transparent; transition: 0.2s;
}
.variant-dot:hover, .variant-dot.sel { border-color: var(--green-dark); transform: scale(1.15); }
.size-btn {
  padding: 0.2rem 0.6rem; border: 1.5px solid #ccc; border-radius: 8px;
  font-size: 0.75rem; cursor: pointer; background: none; font-family: inherit;
  transition: 0.2s;
}
.size-btn:hover, .size-btn.sel { border-color: var(--green-mid); color: var(--green-mid); background: var(--green-bg); }

/* CART SIDEBAR */
.cart-overlay {
  display: none; position: fixed; inset: 0; z-index: 2000;
  background: rgba(0,0,0,0.5); backdrop-filter: blur(3px);
}
.cart-overlay.open { display: block; }
.cart-panel {
  position: fixed; right: -420px; top: 0; bottom: 0;
  width: 420px; max-width: 95vw; background: white;
  z-index: 2001; transition: right 0.35s cubic-bezier(.4,0,.2,1);
  display: flex; flex-direction: column; box-shadow: -10px 0 40px rgba(0,0,0,0.2);
}
.cart-panel.open { right: 0; }
.cart-head {
  padding: 1.5rem; background: var(--green-dark); color: white;
  display: flex; justify-content: space-between; align-items: center;
}
.cart-head h3 { font-size: 1.2rem; }
.cart-close { background: none; border: none; color: white; font-size: 1.4rem; cursor: pointer; }
.cart-items { flex: 1; overflow-y: auto; padding: 1rem; }
.cart-empty { text-align: center; padding: 3rem 1rem; color: #aaa; }
.cart-empty i { font-size: 3rem; display: block; margin-bottom: 1rem; }
.cart-item {
  display: flex; gap: 1rem; align-items: center;
  padding: 1rem; border-radius: 12px; background: var(--green-bg);
  margin-bottom: 0.8rem;
}
.cart-item-icon { font-size: 2.5rem; min-width: 50px; text-align: center; }
.cart-item-info { flex: 1; }
.cart-item-info h4 { font-size: 0.9rem; font-weight: 700; color: var(--green-dark); }
.cart-item-info p { font-size: 0.8rem; color: #888; }
.cart-item-price { font-weight: 700; color: var(--green-mid); font-size: 1rem; white-space: nowrap; }
.cart-item-del { background: none; border: none; color: #ccc; cursor: pointer; font-size: 1.1rem; transition: color 0.2s; }
.cart-item-del:hover { color: #e53935; }
/* Qty controls in cart */
.cart-qty-ctrl { display: flex; align-items: center; gap: 0.4rem; margin-top: 0.4rem; }
.cart-qty-ctrl button {
  width: 26px; height: 26px; border-radius: 50%; border: 1.5px solid var(--green-bright);
  background: none; font-size: 1rem; cursor: pointer; color: var(--green-mid);
  display: flex; align-items: center; justify-content: center; font-weight: 700; transition: 0.2s;
}
.cart-qty-ctrl button:hover { background: var(--green-mid); color: white; }
.cart-qty-ctrl span { font-size: 0.95rem; font-weight: 700; min-width: 22px; text-align: center; }
.cart-footer { padding: 1.5rem; border-top: 1px solid #eee; }
.cart-total { display: flex; justify-content: space-between; font-size: 1.2rem; font-weight: 700; margin-bottom: 1.5rem; color: var(--green-dark); }
.btn-checkout {
  width: 100%; padding: 1rem; background: linear-gradient(135deg, var(--green-mid), var(--green-bright));
  color: white; border: none; border-radius: 50px; font-size: 1.05rem; font-weight: 700;
  cursor: pointer; font-family: inherit; transition: all 0.3s;
  display: flex; align-items: center; justify-content: center; gap: 0.5rem;
}
.btn-checkout:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(45,122,45,0.4); }

/* CHECKOUT MODAL */
.checkout-modal {
  display: none; position: fixed; inset: 0; z-index: 3000;
  background: rgba(0,0,0,0.7); backdrop-filter: blur(5px);
  align-items: center; justify-content: center; padding: 1rem;
}
.checkout-modal.active { display: flex; }
.checkout-box {
  background: white; border-radius: 24px; width: 100%; max-width: 540px;
  max-height: 90vh; overflow-y: auto; animation: slideUp 0.3s ease;
}
@keyframes slideUp { from { transform: translateY(30px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.checkout-header {
  background: linear-gradient(135deg, var(--green-dark), var(--green-mid));
  color: white; padding: 1.5rem 2rem; border-radius: 24px 24px 0 0;
  display: flex; justify-content: space-between; align-items: center;
}
.checkout-header h3 { font-size: 1.3rem; }
.checkout-close { background: none; border: none; color: white; font-size: 1.4rem; cursor: pointer; }
.checkout-body { padding: 2rem; }
.checkout-steps { display: flex; gap: 0.5rem; margin-bottom: 2rem; }
.step {
  flex: 1; text-align: center; padding: 0.5rem; border-radius: 8px;
  font-size: 0.8rem; font-weight: 600; background: var(--green-bg); color: #aaa;
}
.step.active { background: var(--green-mid); color: white; }
.step.done { background: var(--green-bright); color: white; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.checkout-body .form-group { margin-bottom: 1rem; }
.checkout-body .form-group label { display: block; font-size: 0.82rem; font-weight: 600; color: var(--green-dark); margin-bottom: 0.35rem; }
.checkout-body .form-group input,
.checkout-body .form-group select {
  width: 100%; padding: 0.75rem 1rem; border: 2px solid #e0e0e0;
  border-radius: 10px; font-family: inherit; font-size: 0.9rem; transition: border-color 0.3s;
}
.checkout-body .form-group input:focus,
.checkout-body .form-group select:focus { outline: none; border-color: var(--green-bright); }
.card-display {
  background: linear-gradient(135deg, var(--green-dark), var(--green-mid));
  border-radius: 16px; padding: 1.5rem; color: white; margin-bottom: 1.5rem;
  font-family: monospace;
}
.card-display .card-number { font-size: 1.3rem; letter-spacing: 3px; margin: 0.8rem 0; }
.card-display .card-meta { display: flex; justify-content: space-between; font-size: 0.85rem; opacity: 0.8; }
.payment-icons { display: flex; gap: 0.7rem; margin-bottom: 1.2rem; align-items: center; }
.secure-badge { display: flex; align-items: center; gap: 0.4rem; font-size: 0.8rem; color: #6a8a6a; margin-bottom: 1.2rem; }
.secure-badge i { color: var(--green-bright); }
.order-summary { background: var(--green-bg); border-radius: 12px; padding: 1rem 1.5rem; margin-bottom: 1.5rem; }
.order-summary h4 { font-weight: 700; margin-bottom: 0.8rem; color: var(--green-dark); }
.order-line { display: flex; justify-content: space-between; font-size: 0.9rem; color: #5a7a5a; margin-bottom: 0.4rem; }
.order-total { display: flex; justify-content: space-between; font-weight: 700; font-size: 1.1rem; color: var(--green-dark); border-top: 1px solid #ddd; padding-top: 0.8rem; margin-top: 0.5rem; }
.btn-confirm {
  width: 100%; padding: 1rem; background: linear-gradient(135deg, var(--green-mid), var(--green-bright));
  color: white; border: none; border-radius: 50px; font-size: 1.05rem; font-weight: 700;
  cursor: pointer; font-family: inherit; transition: all 0.3s;
  display: flex; align-items: center; justify-content: center; gap: 0.5rem;
}
.btn-confirm:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(45,122,45,0.4); }
.success-screen { text-align: center; padding: 2rem; }
.success-screen .check-icon { font-size: 5rem; margin-bottom: 1rem; }
.success-screen h3 { font-size: 1.5rem; font-weight: 700; color: var(--green-dark); }
.success-screen p { color: #6a8a6a; margin: 0.5rem 0 1.5rem; }

#cartFab {
  position: fixed; right: 1.5rem; bottom: 5rem; z-index: 1500;
  width: 60px; height: 60px; border-radius: 50%;
  background: linear-gradient(135deg, var(--green-mid), var(--pear-yellow));
  color: white; border: none; font-size: 1.4rem; cursor: pointer;
  box-shadow: 0 4px 20px rgba(45,122,45,0.4); transition: all 0.3s;
  display: flex; align-items: center; justify-content: center;
}
#cartFab:hover { transform: scale(1.1) translateY(-3px); }
#cartCount {
  position: absolute; top: -5px; right: -5px;
  background: #e53935; color: white; border-radius: 50%;
  width: 22px; height: 22px; font-size: 0.75rem; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
#scrollTopBtn {
  position: fixed; right: 1.5rem; bottom: 1.5rem; z-index: 999;
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--green-dark); color: white;
  border: none; font-size: 1rem; cursor: pointer;
  box-shadow: 0 4px 15px rgba(0,0,0,0.2); opacity: 0; transition: all 0.3s;
  display: flex; align-items: center; justify-content: center;
}
#scrollTopBtn.visible { opacity: 1; }
footer { background: var(--green-dark); color: var(--green-pale); text-align: center; padding: 2.5rem 2rem; margin-top: 2rem; }
footer p { font-size: 0.85rem; opacity: 0.7; }
footer a { color: var(--pear-yellow); text-decoration: none; }
.footer-links { display: flex; gap: 2rem; justify-content: center; flex-wrap: wrap; margin: 1rem 0; }
.footer-links a { color: var(--green-pale); text-decoration: none; font-size: 0.9rem; transition: color 0.3s; }
.footer-links a:hover { color: var(--pear-yellow); }

@media(max-width: 900px) {
  /* En tablets el panel ocupa casi toda la pantalla y arranca fuera */
  .cart-panel {
    width: 88vw;
    max-width: 88vw;
    right: -88vw;
  }
}
@media(max-width: 600px) {
  .form-row { grid-template-columns: 1fr; }
  /* En móvil ocupa toda la pantalla y arranca completamente fuera */
  .cart-panel {
    width: 100vw;
    max-width: 100vw;
    right: -100vw;
  }
}
