/* ===== AGALE COLOMBIA - Variables ===== */
:root {
  --primary: #5b21b6;
  --primary-dark: #4c1d95;
  --primary-light: #7c3aed;
  --accent: #22c55e;
  --accent-dark: #16a34a;
  --danger: #ef4444;
  --success: #22c55e;
  --bg: #f8fafc;
  --card: #ffffff;
  --text: #0f172a;
  --text-muted: #64748b;
  --border: #e2e8f0;
  --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.07), 0 2px 4px -2px rgb(0 0 0 / 0.05);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.08), 0 4px 6px -4px rgb(0 0 0 / 0.05);
  --radius: 12px;
}

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

body {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  min-height: 100vh;
}

a { color: var(--primary); text-decoration: none; }
img { max-width: 100%; display: block; }

.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 16px;
}

/* BUTTONS */
.btn-primary {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: transform 0.15s, box-shadow 0.2s;
  box-shadow: 0 2px 8px rgba(91, 33, 182, 0.3);
}
.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(91, 33, 182, 0.4);
}
.btn-outline {
  background: transparent;
  color: var(--primary);
  border: 2px solid var(--primary);
  padding: 8px 18px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s;
}
.btn-outline:hover { background: var(--primary); color: white; }
.btn-text {
  background: none; border: none; color: var(--primary);
  font-weight: 600; cursor: pointer; display: inline-flex; align-items: center; gap: 6px;
}
.btn-lg { padding: 14px 28px; font-size: 16px; }
.btn-sm { padding: 6px 14px; font-size: 13px; }
.btn-block { width: 100%; justify-content: center; }
.btn-icon {
  background: none; border: none; cursor: pointer; position: relative;
  display: flex; align-items: center; gap: 6px; color: var(--text);
  font-size: 14px; font-weight: 500; padding: 8px;
}
.btn-icon .badge {
  position: absolute; top: 0; right: -4px; background: var(--accent);
  color: white; font-size: 11px; font-weight: 700; width: 18px; height: 18px;
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
}

/* HEADER */
.header { background: white; box-shadow: var(--shadow); position: sticky; top: 0; z-index: 100; }
.header-top { background: var(--primary-dark); color: white; font-size: 13px; padding: 7px 0; }
.header-top .container { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px; }
.header-top-links a { color: rgba(255,255,255,0.95); margin-left: 18px; font-size: 13px; }
.header-top-links a:hover { color: #a7f3d0; }
.header-main { padding: 10px 0; }
.header-main .container { display: flex; align-items: center; gap: 20px; }
.logo { display: flex; align-items: center; flex-shrink: 0; }
.logo-img { height: 48px; width: auto; object-fit: contain; }
.search-bar { flex: 1; display: flex; max-width: 520px; }
.search-bar input {
  flex: 1; padding: 12px 16px; border: 2px solid var(--border);
  border-right: none; border-radius: 8px 0 0 8px; font-size: 15px; outline: none;
}
.search-bar input:focus { border-color: var(--primary); }
.search-bar button {
  background: var(--primary); color: white; border: none;
  padding: 0 18px; border-radius: 0 8px 8px 0; cursor: pointer; font-size: 16px;
}
.header-actions { display: flex; align-items: center; gap: 8px; }
.nav-categories { border-top: 1px solid var(--border); padding: 8px 0; overflow-x: auto; }
.nav-categories .container { display: flex; gap: 6px; }
.cat-btn {
  background: none; border: none; padding: 8px 14px; border-radius: 20px;
  font-size: 13px; font-weight: 500; color: var(--text-muted); cursor: pointer; white-space: nowrap;
}
.cat-btn:hover, .cat-btn.active { background: #ede9fe; color: var(--primary-dark); }

/* USER MENU */
.user-menu {
  position: fixed; top: 110px; right: 20px; background: white; border-radius: var(--radius);
  box-shadow: var(--shadow-lg); padding: 8px; min-width: 200px; display: none; z-index: 200; flex-direction: column;
}
.user-menu.show { display: flex; }
.user-menu button {
  background: none; border: none; padding: 12px 14px; text-align: left; cursor: pointer;
  border-radius: 8px; font-size: 14px; display: flex; align-items: center; gap: 10px; color: var(--text); width: 100%;
}
.user-menu button:hover { background: var(--bg); }

/* CART */
.cart-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.4); z-index: 300;
  opacity: 0; visibility: hidden; transition: all 0.3s;
}
.cart-overlay.show { opacity: 1; visibility: visible; }
.cart-sidebar {
  position: fixed; top: 0; right: -400px; width: 100%; max-width: 380px; height: 100%;
  background: white; z-index: 310; display: flex; flex-direction: column;
  transition: right 0.3s ease; box-shadow: -4px 0 20px rgba(0,0,0,0.1);
}
.cart-sidebar.show { right: 0; }
.cart-header { padding: 20px; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; }
.cart-header h3 { font-size: 18px; display: flex; align-items: center; gap: 8px; }
.cart-header button { background: none; border: none; font-size: 18px; cursor: pointer; color: var(--text-muted); }
.cart-items { flex: 1; overflow-y: auto; padding: 16px; }
.cart-item { display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.cart-item img { width: 64px; height: 64px; object-fit: cover; border-radius: 8px; background: var(--bg); }
.cart-item-info { flex: 1; }
.cart-item-info h4 { font-size: 14px; margin-bottom: 4px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.cart-item-info .price { font-weight: 700; color: var(--primary); }
.cart-item-qty { display: flex; align-items: center; gap: 8px; margin-top: 6px; }
.cart-item-qty button { width: 26px; height: 26px; border: 1px solid var(--border); background: white; border-radius: 6px; cursor: pointer; font-size: 14px; }
.cart-footer { padding: 20px; border-top: 1px solid var(--border); }
.cart-total { display: flex; justify-content: space-between; font-size: 18px; margin-bottom: 16px; }
.cart-note { text-align: center; font-size: 12px; color: var(--text-muted); margin-top: 12px; }
.cart-empty { text-align: center; padding: 40px 20px; color: var(--text-muted); }

/* SECTIONS */
.section { display: none; }
.section.active { display: block; }
.section-pad { padding: 40px 0; }
.section-title { font-size: 26px; font-weight: 700; margin-bottom: 8px; }
.section-subtitle { color: var(--text-muted); margin-bottom: 28px; max-width: 600px; }
.section-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; }

/* HERO */
.hero {
  background: linear-gradient(135deg, #4c1d95 0%, #5b21b6 40%, #6d28d9 70%, #7c3aed 100%);
  color: white; padding: 60px 0; position: relative; overflow: hidden;
}
.hero::before {
  content: ''; position: absolute; top: -40%; right: -15%; width: 500px; height: 500px;
  background: radial-gradient(circle, rgba(34,197,94,0.2) 0%, transparent 70%); border-radius: 50%;
}
.hero-content { display: grid; grid-template-columns: 1.4fr 1fr; gap: 40px; align-items: center; position: relative; }
.hero-text h1 { font-size: 36px; font-weight: 800; line-height: 1.2; margin-bottom: 16px; }
.hero-text h1 span { color: #86efac; }
.hero-text p { font-size: 16px; opacity: 0.92; margin-bottom: 28px; max-width: 480px; }
.hero-btns { display: flex; gap: 12px; flex-wrap: wrap; }
.hero-btns .btn-outline { border-color: white; color: white; }
.hero-btns .btn-outline:hover { background: white; color: var(--primary-dark); }
.hero-stats { display: flex; flex-direction: column; gap: 16px; }
.stat {
  background: rgba(255,255,255,0.12); backdrop-filter: blur(8px); padding: 18px 24px;
  border-radius: var(--radius); border: 1px solid rgba(255,255,255,0.18);
}
.stat strong { display: block; font-size: 28px; font-weight: 800; }
.stat span { font-size: 14px; opacity: 0.85; }

/* HOW */
.how-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; margin-top: 28px; }
.how-card {
  background: white; padding: 28px 20px; border-radius: var(--radius);
  box-shadow: var(--shadow); text-align: center; transition: transform 0.2s, box-shadow 0.2s;
}
.how-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.how-icon {
  width: 56px; height: 56px; background: #ede9fe; color: var(--primary);
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-size: 22px; margin: 0 auto 16px;
}
.how-card h3 { font-size: 16px; margin-bottom: 8px; }
.how-card p { font-size: 13px; color: var(--text-muted); }

/* PRODUCTS */
.products-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 20px; }
.product-card {
  background: white; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow);
  transition: transform 0.2s, box-shadow 0.2s; cursor: pointer; display: flex; flex-direction: column;
}
.product-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.product-img {
  height: 180px; background: #f1f5f9; display: flex; align-items: center;
  justify-content: center; position: relative; overflow: hidden;
}
.product-img img { width: 100%; height: 100%; object-fit: cover; }
.product-img .placeholder { font-size: 48px; color: #cbd5e1; }
.product-badge {
  position: absolute; top: 10px; left: 10px; background: var(--accent); color: white;
  font-size: 11px; font-weight: 700; padding: 4px 8px; border-radius: 6px;
}
.product-badge.dropship { background: var(--primary); }
.product-body { padding: 14px; flex: 1; display: flex; flex-direction: column; }
.product-body h3 {
  font-size: 14px; font-weight: 600; margin-bottom: 6px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; line-height: 1.35;
}
.product-seller { font-size: 12px; color: var(--text-muted); margin-bottom: 8px; }
.product-price { margin-top: auto; }
.product-price .current { font-size: 18px; font-weight: 800; color: var(--text); }
.product-price .old { font-size: 13px; color: var(--text-muted); text-decoration: line-through; margin-left: 6px; }
.product-price .discount {
  display: inline-block; background: #dcfce7; color: #166534; font-size: 11px;
  font-weight: 700; padding: 2px 6px; border-radius: 4px; margin-left: 6px;
}
.product-actions { padding: 0 14px 14px; }
.product-actions .btn-primary { width: 100%; justify-content: center; padding: 9px; font-size: 13px; }

/* PROVIDERS */
.providers-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 20px; margin-top: 24px; }
.provider-card { background: white; border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); text-align: center; }
.provider-logo {
  width: 64px; height: 64px; border-radius: 16px; display: flex; align-items: center;
  justify-content: center; font-weight: 800; font-size: 14px; color: white; margin: 0 auto 14px;
}
.provider-logo.dropi { background: linear-gradient(135deg, #6366f1, #4f46e5); }
.provider-logo.chipi { background: linear-gradient(135deg, #f59e0b, #d97706); }
.provider-logo.master { background: linear-gradient(135deg, #10b981, #059669); }
.provider-logo.efi { background: linear-gradient(135deg, #3b82f6, #2563eb); }
.provider-logo.hoko { background: linear-gradient(135deg, #ec4899, #db2777); }
.provider-logo.other { background: linear-gradient(135deg, #64748b, #475569); }
.provider-card h4 { margin-bottom: 8px; }
.provider-card p { font-size: 13px; color: var(--text-muted); margin-bottom: 16px; }

/* CONTACT STRIP */
.contact-strip { background: linear-gradient(135deg, #4c1d95, #5b21b6); color: white; padding: 36px 0; }
.contact-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; }
.contact-grid > div { display: flex; gap: 14px; align-items: flex-start; }
.contact-grid i { font-size: 22px; color: #86efac; margin-top: 2px; }
.contact-grid strong { display: block; margin-bottom: 4px; font-size: 15px; }
.contact-grid p { font-size: 14px; opacity: 0.9; line-height: 1.45; }
.contact-grid a { color: #bbf7d0; }
.contact-grid a:hover { color: white; }

/* SELLER */
.seller-tabs { display: flex; gap: 8px; margin-bottom: 24px; }
.seller-tabs .tab {
  padding: 10px 20px; border: 2px solid var(--border); background: white; border-radius: 8px;
  font-weight: 600; cursor: pointer; font-size: 14px; color: var(--text-muted);
}
.seller-tabs .tab.active { border-color: var(--primary); color: var(--primary); background: #f5f3ff; }
.seller-form-card { background: white; padding: 28px; border-radius: var(--radius); box-shadow: var(--shadow); max-width: 720px; }
.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; }
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; color: var(--text); }
.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="password"],
.form-group input[type="number"],
.form-group input[type="url"],
.form-group select,
.form-group textarea {
  width: 100%; padding: 11px 14px; border: 2px solid var(--border); border-radius: 8px;
  font-size: 14px; font-family: inherit; outline: none;
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus { border-color: var(--primary); }
.form-group input[type="checkbox"] { margin-right: 8px; }
.import-providers { display: flex; flex-wrap: wrap; gap: 12px; margin: 20px 0; }
.import-results { margin-top: 20px; }
.products-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; flex-wrap: wrap; gap: 12px; }
.filters select { padding: 10px 14px; border: 2px solid var(--border); border-radius: 8px; font-size: 14px; outline: none; }
.empty-msg { text-align: center; padding: 40px; color: var(--text-muted); }

/* MODALS */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 400;
  display: flex; align-items: center; justify-content: center; padding: 20px;
  opacity: 0; visibility: hidden; transition: all 0.25s;
}
.modal-overlay.show { opacity: 1; visibility: visible; }
.modal {
  background: white; border-radius: 16px; padding: 32px; width: 100%; max-width: 420px;
  position: relative; max-height: 90vh; overflow-y: auto; transform: scale(0.95); transition: transform 0.25s;
}
.modal-overlay.show .modal { transform: scale(1); }
.modal-lg { max-width: 700px; }
.modal-close { position: absolute; top: 16px; right: 16px; background: none; border: none; font-size: 18px; cursor: pointer; color: var(--text-muted); }
.modal h2 { margin-bottom: 24px; font-size: 22px; }
.modal-footer { text-align: center; margin-top: 20px; font-size: 14px; color: var(--text-muted); }

/* PRODUCT DETAIL */
.product-detail { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; }
.product-detail-img {
  background: #f1f5f9; border-radius: var(--radius); height: 320px;
  display: flex; align-items: center; justify-content: center; overflow: hidden;
}
.product-detail-img img { width: 100%; height: 100%; object-fit: cover; }
.product-detail-info h2 { font-size: 22px; margin-bottom: 8px; }
.product-detail-info .seller { color: var(--text-muted); font-size: 14px; margin-bottom: 16px; }
.product-detail-info .price-block { margin-bottom: 16px; }
.product-detail-info .price-block .current { font-size: 28px; font-weight: 800; }
.product-detail-info .price-block .old { text-decoration: line-through; color: var(--text-muted); margin-left: 8px; }
.product-detail-info .desc { font-size: 14px; color: var(--text-muted); margin-bottom: 20px; line-height: 1.6; }
.product-detail-info .meta { font-size: 13px; margin-bottom: 20px; }
.product-detail-info .meta span {
  display: inline-block; background: #f1f5f9; padding: 4px 10px; border-radius: 6px; margin-right: 8px; margin-bottom: 6px;
}

/* TOAST */
.toast {
  position: fixed; bottom: 30px; left: 50%; transform: translateX(-50%) translateY(100px);
  background: var(--text); color: white; padding: 14px 24px; border-radius: 10px;
  font-size: 14px; font-weight: 500; z-index: 500; opacity: 0; transition: all 0.3s; box-shadow: var(--shadow-lg);
}
.toast.show { transform: translateX(-50%) translateY(0); opacity: 1; }
.toast.success { background: var(--success); }
.toast.error { background: var(--danger); }

/* WHATSAPP FLOAT */
.whatsapp-float {
  position: fixed; bottom: 24px; right: 24px; width: 56px; height: 56px;
  background: #25d366; color: white; border-radius: 50%; display: flex;
  align-items: center; justify-content: center; font-size: 28px;
  box-shadow: 0 4px 14px rgba(37, 211, 102, 0.45); z-index: 90; transition: transform 0.2s;
}
.whatsapp-float:hover { transform: scale(1.08); color: white; }

/* FOOTER */
.footer { background: #1e1b4b; color: #a5b4fc; padding: 50px 0 20px; margin-top: 0; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1.4fr; gap: 32px; margin-bottom: 40px; }
.footer-logo-img { height: 52px; width: auto; margin-bottom: 14px; }
.footer p { font-size: 14px; line-height: 1.6; }
.footer h4 { color: white; font-size: 15px; margin-bottom: 14px; }
.footer a { display: block; color: #a5b4fc; font-size: 14px; margin-bottom: 8px; }
.footer a:hover { color: white; }
.footer-social { display: flex; gap: 12px; margin-top: 16px; }
.footer-social a {
  width: 40px; height: 40px; background: rgba(255,255,255,0.1); border-radius: 50%;
  display: flex; align-items: center; justify-content: center; font-size: 18px; color: white; margin-bottom: 0;
}
.footer-social a:hover { background: var(--accent); }
.footer-contact { font-size: 13px !important; margin-bottom: 10px !important; line-height: 1.5; }
.footer-contact i { margin-right: 6px; color: #86efac; }
.footer-bottom { border-top: 1px solid #312e81; padding-top: 20px; text-align: center; font-size: 13px; }

/* RESPONSIVE */
@media (max-width: 900px) {
  .hero-content { grid-template-columns: 1fr; }
  .hero-stats { flex-direction: row; flex-wrap: wrap; }
  .stat { flex: 1; min-width: 120px; }
  .how-grid { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .product-detail { grid-template-columns: 1fr; }
  .contact-grid { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .header-main .container { flex-wrap: wrap; }
  .search-bar { order: 3; max-width: 100%; width: 100%; }
  .header-top { font-size: 12px; }
  .header-top-links a { margin-left: 10px; }
  .logo-img { height: 40px; }
  .hero-text h1 { font-size: 26px; }
  .how-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .btn-text-hide { display: none; }
}
