/* Reset and Variables */
:root {
  --primary: #ff9900; /* Amazon/Kilimall Orange */
  --primary-hover: #e68a00;
  --secondary: #232f3e; /* Dark Blue */
  --background: #f8f9fa;
  --surface: #ffffff;
  --text-main: #1a1a1a;
  --text-muted: #666666;
  --glass-bg: rgba(255, 255, 255, 0.85);
  --glass-border: rgba(255, 255, 255, 0.18);
  --shadow-subtle: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
  --shadow-hover: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
  font-family: 'Inter', sans-serif;
  background-color: var(--background);
  color: var(--text-main);
  line-height: 1.5;
  overflow-x: hidden;
}

a { text-decoration: none; color: inherit; }

/* Utilities */
.glass {
  background: var(--glass-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--glass-border);
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

.badge {
  background: var(--primary);
  color: white;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: bold;
}

.text-center { text-align: center; }
.small-text { font-size: 0.85rem; color: var(--text-muted); }

/* Buttons */
button {
  cursor: pointer;
  font-family: inherit;
  border: none;
  transition: var(--transition);
}

.btn-primary {
  background: var(--primary);
  color: #fff;
  padding: 10px 20px;
  border-radius: 8px;
  font-weight: 600;
}
.btn-primary:hover {
  background: var(--primary-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
}
.btn-primary.large {
  padding: 15px 30px;
  font-size: 1.1rem;
}
.btn-primary.block {
  width: 100%;
  padding: 12px;
}

.btn-outline {
  border: 2px solid var(--secondary);
  color: var(--secondary);
  padding: 8px 18px;
  border-radius: 8px;
  font-weight: 600;
  background: transparent;
}
.btn-outline:hover {
  background: var(--secondary);
  color: #fff;
}

.btn-facebook {
  background: #1877f2;
  color: #fff;
  padding: 12px;
  width: 100%;
  border-radius: 8px;
  font-weight: 600;
  margin-bottom: 10px;
}
.btn-facebook:hover { background: #166fe5; }

/* Navbar */
.navbar {
  position: fixed;
  top: 0; width: 100%;
  z-index: 1000;
}

.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 15px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo h1 {
  font-weight: 700;
  font-size: 1.8rem;
  color: var(--secondary);
}
.logo span { color: var(--primary); }

.search-bar {
  display: flex;
  flex: 1;
  max-width: 500px;
  margin: 0 20px;
}
.search-bar input {
  width: 100%;
  padding: 10px 15px;
  border: 1px solid #ddd;
  border-right: none;
  border-radius: 8px 0 0 8px;
  outline: none;
}
.search-bar input:focus { border-color: var(--primary); }
.search-bar button {
  border-radius: 0 8px 8px 0;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 20px;
}
.nav-links a { font-weight: 600; }

/* Hero */
.hero {
  margin-top: 80px;
  background: linear-gradient(135deg, var(--secondary) 0%, #3a4b60 100%);
  color: white;
  padding: 80px 20px;
  text-align: center;
}
.hero-content h2 {
  font-size: 3rem;
  margin-bottom: 15px;
  font-weight: 700;
}
.hero-content p {
  font-size: 1.2rem;
  margin-bottom: 30px;
  opacity: 0.9;
}

/* Sections & Grids */
.category-section {
  margin: 60px 0;
}
.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 25px;
}
.section-header h3 {
  font-size: 1.8rem;
  color: var(--secondary);
}
.section-header a {
  color: var(--primary);
  font-weight: 600;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 25px;
}

.card {
  background: var(--surface);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--shadow-subtle);
  transition: var(--transition);
}
.card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-hover);
}
.card-img {
  height: 180px;
  background: #eee;
  width: 100%;
  object-fit: cover;
}
.card-body {
  padding: 15px;
}
.card-title {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 8px;
}
.card-price {
  font-size: 1.3rem;
  color: var(--primary);
  font-weight: 700;
  margin-bottom: 10px;
}
.card-location {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 15px;
}
.card-actions {
  display: flex;
  gap: 10px;
}
.card-actions button {
  flex: 1;
  padding: 8px;
  border-radius: 6px;
}

/* Modals & Overlays */
.modal {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.5);
  z-index: 2000;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.3s ease;
}
.modal.active { display: flex; }

.modal-content {
  background: var(--surface);
  padding: 40px;
  border-radius: 16px;
  width: 100%;
  max-width: 400px;
  position: relative;
  box-shadow: 0 20px 25px -5px rgba(0,0,0,0.1);
}
.close-btn {
  position: absolute;
  top: 15px; right: 20px;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--text-muted);
}
.close-btn:hover { color: var(--text-main); }

.modal-content h2 { margin-bottom: 10px; }
.modal-content p { color: var(--text-muted); margin-bottom: 25px; }

.modal-content input {
  width: 100%;
  padding: 12px;
  margin-bottom: 15px;
  border: 1px solid #ddd;
  border-radius: 8px;
  background: #fdfdfd;
}

.divider {
  text-align: center;
  margin: 20px 0;
  position: relative;
  color: var(--text-muted);
}
.divider::before, .divider::after {
  content: "";
  position: absolute;
  top: 50%;
  width: 40%;
  height: 1px;
  background: #ddd;
}
.divider::before { left: 0; }
.divider::after { right: 0; }

/* Sidebar */
.sidebar {
  position: fixed;
  top: 0; right: -400px;
  width: 100%;
  max-width: 350px;
  height: 100vh;
  background: var(--surface);
  box-shadow: -5px 0 15px rgba(0,0,0,0.05);
  z-index: 1500;
  transition: right 0.4s ease;
  display: flex;
  flex-direction: column;
}
.sidebar.active { right: 0; }
.sidebar-header {
  padding: 20px;
  border-bottom: 1px solid #eee;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.sidebar-content {
  padding: 20px;
  flex: 1;
  overflow-y: auto;
}
.sidebar-footer {
  padding: 20px;
  border-top: 1px solid #eee;
}

.cart-item {
  display: flex;
  align-items: center;
  gap: 15px;
  margin-bottom: 15px;
  padding-bottom: 15px;
  border-bottom: 1px solid #f0f0f0;
}
.cart-item img {
  width: 60px; height: 60px;
  border-radius: 8px;
  object-fit: cover;
}
.cart-item-info h4 { font-size: 0.95rem; }
.cart-item-info p { color: var(--primary); font-weight: bold; }

/* Chat Widget */
.chat-widget {
  position: fixed;
  bottom: 20px; right: 20px;
  width: 320px;
  background: var(--surface);
  border-radius: 12px;
  box-shadow: 0 10px 25px rgba(0,0,0,0.15);
  z-index: 1000;
  display: flex;
  flex-direction: column;
}
.chat-header {
  background: var(--secondary);
  color: white;
  padding: 15px;
  border-radius: 12px 12px 0 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.chat-header .close-btn { position: relative; top: 0; right: 0; color: white; }
.chat-messages {
  height: 250px;
  padding: 15px;
  overflow-y: auto;
  background: #f9f9f9;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.msg-bubble {
  padding: 10px;
  border-radius: 12px;
  max-width: 85%;
  font-size: 0.9rem;
}
.msg-bubble.sent {
  background: var(--primary);
  color: white;
  align-self: flex-end;
  border-bottom-right-radius: 2px;
}
.msg-bubble.recv {
  background: #e9ecef;
  color: var(--text-main);
  align-self: flex-start;
  border-bottom-left-radius: 2px;
}
.chat-input {
  display: flex;
  padding: 10px;
  border-top: 1px solid #eee;
}
.chat-input input {
  flex: 1;
  padding: 10px;
  border: 1px solid #ddd;
  border-radius: 20px;
  outline: none;
}
.chat-input button {
  background: var(--primary);
  color: white;
  border: none;
  padding: 0 15px;
  border-radius: 20px;
  margin-left: 10px;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* Footer */
footer {
  background: var(--secondary);
  color: rgba(255,255,255,0.7);
  padding: 30px 20px;
  text-align: center;
  margin-top: 60px;
}
