@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@300;400;500;600;700&display=swap');

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

body {
  background: #fafbfc;
  color: #1a202c;
  font-family: 'Montserrat', sans-serif;
  font-weight: 400;
  line-height: 1.6;
}

.navbar {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
  padding: 16px 80px;
  background: #ffffff;
  border-bottom: 1px solid #e2e8f0;
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.nav-links a, .btn, .category-dropdown, h1, h2, h3, .card-price {
  font-family: 'Montserrat', sans-serif;
}

.logo-container {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 45px;
  height: 45px;
  background: #ffffff;
  border-radius: 16px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08), 0 4px 16px rgba(0, 0, 0, 0.06);
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.logo-container:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12), 0 6px 20px rgba(0, 0, 0, 0.1);
}

.nav-logo {
  width: 85%;
  height: 85%;
  display: block;
  object-fit: contain;
}

.nav-links a {
  padding: 8px 16px;
  margin: 0 4px;
  text-decoration: none;
  color: #4a5568;
  font-weight: 500;
  font-size: 14px;
  border-radius: 6px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-links a:hover,
.nav-links a:active {
  color: #2563eb;
  background-color: #eff6ff;
}

.nav-links {
  display: flex;
  gap: 32px;
}

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

.nav-icons a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background-color: #f0f4f8;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border: 1px solid #e2e8f0;
}

.nav-icons a:hover {
  background-color: #e2e8f0;
  border-color: #cbd5e0;
  transform: scale(1.05);
}

.icon-img {
  width: 20px;
  height: 20px;
  object-fit: contain;
  opacity: 0.7;
  transition: opacity 0.3s ease;
}

.navbar-brand-group {
  display: flex;
  align-items: center;
  gap: 18px; /* Increased spacing to help shorter titles feel more balanced */
}

.brand-title {
  font-family: 'Montserrat', sans-serif;
  font-weight: 600;
  font-size: 19px;
  color: #1a202c; /* Use existing text color */
  white-space: nowrap; /* Prevent title from wrapping */
  line-height: 1; /* Adjust line-height to prevent extra space */
  opacity: 0.8; /* Slightly more visible for shorter page titles */
  letter-spacing: 0.5px;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
  transition: all 0.3s ease;
}

.navbar-brand-group:hover .brand-title {
  opacity: 1;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.hero {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 80px;
  padding: 60px 80px;
  max-width: 1400px;
  min-height: calc(100vh - 72px);
  margin: 0 auto;
  overflow: hidden;
  position: relative;
}

.hero-content {
  flex: 1;
}

.hero h1, h1, h2, h3 {
  font-weight: 700;
  color: #1a202c;
  line-height: 1.2;
}

.hero h1 {
  font-size: clamp(2.8rem, 5vw, 4rem);
  animation: slideInLeft 0.8s ease-out forwards;
  margin-bottom: 24px;
}

.hero p {
  font-size: 16px;
  font-weight: 400;
  color: #64748b;
  margin-bottom: 32px;
  line-height: 1.8;
}

.hero img {
  flex: 1;
  width: 100%;
  max-width: 550px;
  height: 420px;
  border-radius: 32px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.12);
  object-fit: cover;
  display: block;
  animation: fadeInScale 0.8s ease-out forwards;
  animation-delay: 0.2s;
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.hero img:hover {
  transform: scale(1.03);
}

.btn {
  padding: 14px 36px;
  background: #2563eb;
  color: white;
  border: none;
  border-radius: 12px;
  font-weight: 600;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.btn:hover {
  background: #1d4ed8;
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(37, 99, 235, 0.4);
}

.btn:active {
  transform: translateY(0);
}


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

.product-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 48px;
  border-bottom: 1px solid #e2e8f0;
  padding-bottom: 24px;
}

.product-header h2 {
  font-size: 2rem;
  color: #1a202c;
}

.category-dropdown {
  padding: 10px 16px;
  border-radius: 12px;
  border: 1px solid #cbd5e1;
  background: #ffffff;
  font-weight: 500;
  color: #2d3748;
  cursor: pointer;
  outline: none;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  font-family: 'Montserrat', sans-serif;
  font-size: 14px;
}

.category-dropdown:hover {
  border-color: #2563eb;
}

.category-dropdown:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 32px;
  opacity: 0;
  transition: opacity 0.8s ease;
}

.products-grid.visible {
  opacity: 1;
}

.card {
  background: #ffffff;
  padding: 20px;
  border-radius: 24px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.04);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  border: 1px solid #e2e8f0;
  cursor: pointer;
}

.card:hover {
  transform: translateY(-6px);
  box-shadow: 0 16px 32px rgba(0, 0, 0, 0.12);
  border-color: #2563eb;
}

.card img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  border-radius: 18px;
  margin-bottom: 16px;
  transition: transform 0.4s ease;
}

.card:hover img {
  transform: scale(1.05);
}

.card h3 {
  margin: 12px 0 8px;
  font-size: 1.1rem;
  color: #1a202c;
  font-weight: 600;
}

.card p {
  color: #64748b;
  font-size: 14px;
  line-height: 1.5;
  margin-bottom: 12px;
}

.card-price {
  font-weight: 700;
  color: #2563eb;
  font-size: 1.2rem;
  display: block;
  margin-top: 12px;
}

.about {
  padding: 80px 80px;
  max-width: 1000px;
  display: flex;
  flex-direction: column;
  margin: 0 auto;
}

.about h1 {
  font-size: clamp(2.5rem, 4vw, 3.2rem);
  margin-bottom: 24px;
  animation: fadeInUpStaggered 0.8s ease-out forwards;
  animation-delay: 0.1s;
  color: #1a202c;
}

.about p {
  animation: fadeInUpStaggered 0.8s ease-out forwards;
  animation-delay: 0.2s;
  color: #475569;
  font-weight: 400;
}

.values-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 24px;
  margin-top: 48px;
}

.value-card {
  background: #f8fafc;
  padding: 32px 24px;
  border-radius: 24px;
  text-align: center;
  border: 1px solid #e2e8f0;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  animation: fadeInUpStaggered 0.8s ease-out forwards;
  opacity: 0;
}

.value-card h3 {
  margin-bottom: 16px;
  color: #2563eb;
  font-size: 1.2rem;
}

.value-card p {
  color: #64748b;
  font-size: 14px;
  line-height: 1.6;
}

.value-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 12px 24px rgba(37, 99, 235, 0.1);
  border-color: #2563eb;
}

/* Modal Styles */
.modal {
  display: none;
  position: fixed;
  z-index: 2000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(4px);
  animation: fadeIn 0.3s ease;
}

.modal-content {
  background-color: #ffffff;
  margin: 5% auto;
  padding: 40px;
  border: none;
  width: 90%;
  max-width: 900px;
  border-radius: 32px;
  position: relative;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.15);
  animation: slideUp 0.3s ease;
}

.close-modal {
  position: absolute;
  right: 20px;
  top: 16px;
  color: #94a3b8;
  font-size: 28px;
  font-weight: 300;
  cursor: pointer;
  transition: color 0.2s;
  background: none;
  border: none;
  padding: 0;
}

.close-modal:hover {
  color: #1a202c;
}

/* Animation Keyframes */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

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

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes slideInLeft {
  from { opacity: 0; transform: translateX(-50px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes fadeInScale {
  from { opacity: 0; transform: scale(0.9); }
  to { opacity: 1; transform: scale(1); }
}

@keyframes fadeInUpStaggered {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.card {
  animation: fadeInUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  opacity: 0;
}

/* Apply staggered animation delays to value cards */
.values-grid .value-card:nth-child(1) { animation-delay: 0.3s; }
.values-grid .value-card:nth-child(2) { animation-delay: 0.4s; }
.values-grid .value-card:nth-child(3) { animation-delay: 0.5s; }

/* Hero content animation delay */
.hero-content p { animation-delay: 0.15s; }

/* Footer Styles */
.footer {
  background: #ffffff;
  color: #1a202c;
  padding: 80px 80px;
  margin-top: 100px;
  border-top: 1px solid #e2e8f0;
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 60px;
  max-width: 1400px;
  margin: 0 auto;
}

.footer h3 {
  color: #1a202c;
  margin-bottom: 24px;
  font-size: 1.2rem;
  font-weight: 700;
}

.footer p {
  font-weight: 400;
  color: #4a5568;
  font-size: 15px;
  line-height: 1.8;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.footer p a {
  color: #2563eb;
  text-decoration: none;
  transition: color 0.3s ease;
}

.footer p a:hover {
  color: #1e40af;
  text-decoration: underline;
}

/* Admin Dashboard Styles */
.admin-card {
  margin-top: 32px;
  animation: fadeInUp 0.5s ease-out forwards;
  background: #ffffff;
  padding: 24px;
  border-radius: 24px;
  border: 1px solid #e2e8f0;
}

.admin-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-top: 20px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-group label {
  font-weight: 600;
  font-size: 13px;
  text-transform: uppercase;
  color: #2d3748;
  letter-spacing: 0.5px;
}

.form-group input, .form-group textarea {
  padding: 12px;
  border: 1px solid #cbd5e1;
  border-radius: 12px;
  font-family: 'Montserrat', sans-serif;
  font-weight: 400;
  font-size: 14px;
  outline: none;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.form-group input:focus, .form-group textarea:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.admin-table-wrapper {
  margin-top: 40px;
  background: white;
  border-radius: 24px;
  overflow: hidden;
  border: 1px solid #e2e8f0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.admin-table th {
  background: #f8fafc;
  padding: 16px 20px;
  border-bottom: 1px solid #e2e8f0;
  font-weight: 600;
  color: #2d3748;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.admin-table td {
  padding: 16px 20px;
  border-bottom: 1px solid #e2e8f0;
  color: #475569;
  font-size: 14px;
}

.edit-btn, .delete-btn {
  border: none;
  cursor: pointer;
  font-weight: 700;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  transition: all 0.2s;
  padding: 4px 8px;
  border-radius: 4px;
}

.edit-btn { 
  color: #2563eb;
}

.delete-btn { 
  color: #ef4444;
}

.edit-btn:hover { 
  background: #eff6ff;
}

.delete-btn:hover { 
  background: #fee2e2;
}

.error-message, .no-products {
  grid-column: 1 / -1;
  text-align: center;
  padding: 48px;
  background: #fef2f2;
  color: #991b1b;
  border-radius: 24px;
  font-weight: 500;
  border: 1px solid #fecaca;
  animation: fadeInUp 0.5s ease-out;
  font-size: 14px;
}

/* Loading & Transition Styles */
.loading-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 100px 0;
  gap: 20px;
  width: 100%;
  transition: opacity 0.5s ease, transform 0.5s ease, filter 0.5s ease;
}

.spinner {
  width: 48px;
  height: 48px;
  border: 4px solid #e2e8f0;
  border-top-color: #2563eb;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.fade-out {
  opacity: 0;
  transform: scale(0.95);
  filter: blur(4px);
  pointer-events: none;
}

/* Responsive Design */
@media (max-width: 768px) {
  .navbar {
    padding: 12px 20px;
    flex-wrap: wrap;
    gap: 16px;
  }

  .nav-logo {
    width: 48px;
    height: 48px;
  }

  .nav-links {
    gap: 16px;
    order: 3; /* Ensure nav links appear below logo/title on wrap */
    width: 100%;
  }

  .hero {
    gap: 40px;
    padding: 40px 20px;
    min-height: auto;
    flex-direction: column;
  }

  .hero h1 {
    font-size: clamp(1.8rem, 4vw, 2.5rem);
  }

  .hero img {
    max-width: 100%;
    height: 300px;
  }

  .container {
    padding: 40px 20px;
  }

  .product-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
  }

  .products-grid {
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 20px;
  }

  .modal-content {
    width: 95%;
    padding: 24px;
    margin: 20% auto;
  }

  .about {
    padding: 40px 20px;
  }

  .footer {
    padding: 40px 20px;
  }

  .admin-form {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .navbar {
    padding: 10px 12px;
  }

  .nav-links a {
    padding: 6px 12px;
    font-size: 13px;
  }

  .brand-title {
    font-size: 14px; /* Adjusted for mobile */
  }

  .hero h1 {
    font-size: clamp(1.5rem, 3vw, 2rem);
  }

  .hero p {
    font-size: 14px;
  }

  .btn {
    width: 100%;
    padding: 12px 20px;
  }

  .products-grid {
    grid-template-columns: 1fr;
  }

  .product-header h2 {
    font-size: 1.5rem;
  }

  .values-grid {
    grid-template-columns: 1fr;
  }

  .footer-grid {
    grid-template-columns: 1fr;
  }

  .modal-content {
    padding: 16px;
    margin: 50% auto;
  }

  .admin-table {
    font-size: 12px;
  }

  .admin-table th, .admin-table td {
    padding: 10px 8px;
  }
}