/* =============================
   VARIABLES & RESET
   ============================= */
:root {
  --primary: #2d6a4f;
  --primary-dark: #1b4332;
  --primary-light: #40916c;
  --secondary: #d8f3dc;
  --accent: #74c69d;
  --text: #1b1b1b;
  --text-light: #666;
  --white: #ffffff;
  --gray: #f5f5f5;
  --danger: #e63946;
  --danger-dark: #c1121f;
  --shadow: 0 4px 6px rgba(0,0,0,0.1);
  --shadow-lg: 0 10px 25px rgba(0,0,0,0.15);
  --radius: 8px;
  --radius-lg: 16px;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
  line-height: 1.6;
  color: var(--text);
  background: var(--gray);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

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

main {
  flex: 1;
  padding-bottom: 40px;
}

/* =============================
   HEADER & NAV
   ============================= */
.header {
  background: var(--white);
  box-shadow: var(--shadow);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 20px;
}

.logo {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 8px;
}

.logo-icon {
  font-size: 1.8rem;
}

.nav {
  display: flex;
  gap: 20px;
  align-items: center;
}

.nav-link {
  color: var(--text);
  text-decoration: none;
  font-weight: 500;
  padding: 8px 12px;
  border-radius: var(--radius);
  transition: all 0.2s;
}

.nav-link:hover,
.nav-link.active {
  color: var(--primary);
  background: var(--secondary);
}

.cart-link {
  background: var(--primary);
  color: var(--white) !important;
  padding: 8px 16px;
  border-radius: var(--radius);
}

.cart-count {
  background: var(--danger);
  font-size: 0.8rem;
  padding: 2px 6px;
  border-radius: 10px;
  margin-left: 4px;
}

/* =============================
   HERO
   ============================= */
.hero {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: var(--white);
  padding: 60px 0;
  text-align: center;
  margin-bottom: 40px;
}

.hero h1 {
  font-size: 2.5rem;
  margin-bottom: 10px;
}

.hero p {
  font-size: 1.2rem;
  opacity: 0.9;
}

/* =============================
   SECTIONS
   ============================= */
.section {
  display: none;
}

.section.active {
  display: block;
}

.section-title {
  font-size: 2rem;
  color: var(--primary);
  margin-bottom: 30px;
  text-align: center;
}

/* =============================
   PRODUCTS GRID
   ============================= */
.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 25px;
  margin-top: 20px;
}

.product-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform 0.3s, box-shadow 0.3s;
}

.product-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
}

.product-image {
  width: 100%;
  height: 200px;
  overflow: hidden;
  background: var(--gray);
  display: flex;
  align-items: center;
  justify-content: center;
}

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

.product-card h3 {
  padding: 15px 15px 5px;
  font-size: 1.1rem;
  color: var(--text);
}

.product-producer {
  padding: 0 15px;
  color: var(--text-light);
  font-size: 0.9rem;
}

.product-price {
  padding: 10px 15px;
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--primary);
}

.product-card .btn {
  margin: 0 15px 15px;
  width: calc(100% - 30px);
}

/* =============================
   BUTTONS
   ============================= */
.btn {
  display: inline-block;
  padding: 12px 24px;
  border: none;
  border-radius: var(--radius);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  text-align: center;
  text-decoration: none;
}

.btn-primary {
  background: var(--primary);
  color: var(--white);
}

.btn-primary:hover {
  background: var(--primary-dark);
}

.btn-danger {
  background: var(--danger);
  color: var(--white);
}

.btn-danger:hover {
  background: var(--danger-dark);
}

.btn-sm {
  padding: 6px 12px;
  font-size: 0.85rem;
}

.btn-lg {
  padding: 15px 30px;
  font-size: 1.1rem;
  width: 100%;
}

.btn-full {
  width: 100%;
}

/* =============================
   ABOUT
   ============================= */
.about-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 40px;
  box-shadow: var(--shadow);
}

.about-text h2 {
  color: var(--primary);
  margin-bottom: 20px;
}

.about-text p {
  margin-bottom: 15px;
  color: var(--text-light);
}

.stats {
  display: flex;
  gap: 40px;
  margin-top: 30px;
}

.stat {
  text-align: center;
}

.stat-number {
  display: block;
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--primary);
}

.stat-label {
  color: var(--text-light);
}

/* =============================
   CONTACT
   ============================= */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 30px;
}

@media (max-width: 768px) {
  .contact-grid {
    grid-template-columns: 1fr;
  }
}

.contact-card {
  background: var(--white);
  padding: 30px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

.contact-card h3 {
  color: var(--primary);
  margin-bottom: 15px;
}

.contact-card p {
  margin-bottom: 10px;
}

.contact-card a {
  color: var(--primary);
}

.contact-form {
  background: var(--white);
  padding: 30px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  margin-bottom: 5px;
  font-weight: 500;
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 12px;
  border: 2px solid var(--gray);
  border-radius: var(--radius);
  font-size: 1rem;
  transition: border-color 0.2s;
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--primary);
}

/* =============================
   ADMIN
   ============================= */
.admin-card {
  background: var(--white);
  padding: 30px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  margin-bottom: 30px;
}

.admin-card h2 {
  color: var(--primary);
  margin-bottom: 20px;
}

.admin-form .form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
  margin-bottom: 15px;
}

.admin-form input {
  width: 100%;
  padding: 12px;
  border: 2px solid var(--gray);
  border-radius: var(--radius);
  font-size: 1rem;
}

.admin-form input:focus {
  outline: none;
  border-color: var(--primary);
}

.admin-form .btn {
  margin-top: 15px;
}

.table-responsive {
  overflow-x: auto;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 20px;
}

.admin-table th,
.admin-table td {
  padding: 12px;
  text-align: left;
  border-bottom: 1px solid var(--gray);
}

.admin-table th {
  background: var(--secondary);
  color: var(--primary-dark);
  font-weight: 600;
}

.admin-table tr:hover {
  background: var(--gray);
}

/* =============================
   CART
   ============================= */
.cart-container {
  max-width: 800px;
  margin: 0 auto;
}

.cart-empty {
  text-align: center;
  padding: 60px 20px;
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

.cart-empty p {
  font-size: 1.2rem;
  color: var(--text-light);
  margin-bottom: 20px;
}

.cart-items {
  display: flex;
  flex-direction: column;
  gap: 15px;
  margin-bottom: 30px;
}

.cart-item {
  display: flex;
  gap: 20px;
  background: var(--white);
  padding: 20px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.cart-img {
  width: 80px;
  height: 80px;
  border-radius: var(--radius);
  overflow: hidden;
  flex-shrink: 0;
}

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

.cart-details {
  flex: 1;
}

.cart-details h4 {
  margin-bottom: 5px;
}

.cart-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-top: 10px;
}

.cart-qty {
  width: 60px;
  padding: 5px;
  text-align: center;
  border: 1px solid var(--gray);
  border-radius: var(--radius);
}

.cart-summary {
  background: var(--white);
  padding: 30px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

.cart-total {
  display: flex;
  justify-content: space-between;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 20px;
}

.cart-summary .btn {
  width: 100%;
  margin-bottom: 10px;
}

/* =============================
   FOOTER
   ============================= */
.footer {
  background: var(--primary-dark);
  color: var(--white);
  padding: 20px 0;
  text-align: center;
  margin-top: auto;
}

/* =============================
   TOAST
   ============================= */
.toast {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--primary);
  color: var(--white);
  padding: 15px 30px;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  z-index: 1000;
  animation: slideUp 0.3s ease;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}

/* =============================
   RESPONSIVE
   ============================= */
@media (max-width: 768px) {
  .header-content {
    flex-direction: column;
    gap: 15px;
  }
  
  .nav {
    flex-wrap: wrap;
    justify-content: center;
  }
  
  .hero h1 {
    font-size: 1.8rem;
  }
  
  .section-title {
    font-size: 1.5rem;
  }
  
  .admin-form .form-row {
    grid-template-columns: 1fr;
  }
  
  .cart-item {
    flex-direction: column;
  }
}
