/* Global Font and Variables */
:root {
  --bg-color: #faf6f2;
  --text-color: #333;
  --accent: #845c44;
  --accent-hover: #6a4733;
  --card-bg: white;
  --button-radius: 6px;
  --badge-bg-new: #e07b39;
  --badge-bg-featured: #4a90e2;
  --badge-color: white;
  --badge-pulse-scale: 1.1;
}

body.dark-mode {
  --bg-color: #1e1e1e;
  --text-color: #f4f4f4;
  --card-bg: #2c2c2c;
  --badge-bg-new: #cc7a31;
  --badge-bg-featured: #3b79c6;
  --badge-color: #f0f0f0;
}

body {
  font-family: 'Segoe UI', sans-serif;
  margin: 0;
  padding: 0;
  background: var(--bg-color);
  color: var(--text-color);
  transition: background 0.3s ease, color 0.3s ease;
}

/* Header */
header {
  background-color: var(--accent);
  padding: 15px 30px;
  color: white;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
}

header .logo {
  font-weight: bold;
  font-size: 1.4rem;
}

nav a {
  color: white;
  text-decoration: none;
  margin-left: 20px;
  font-weight: 500;
  transition: text-decoration 0.3s ease;
}

nav a:hover,
nav a:focus {
  text-decoration: underline;
  outline: none;
}

.dark-toggle {
  background: transparent;
  border: none;
  color: white;
  font-size: 1.2rem;
  cursor: pointer;
  padding: 0;
}

/* Hero Section */
.hero {
  background: url('https://images.unsplash.com/photo-1534949800541-0e6471f97c36') no-repeat center center/cover;
  color: white;
  text-align: center;
  padding: 80px 20px;
}

.hero h1 {
  font-size: 2.5rem;
  margin: 0;
}

.hero .btn {
  display: inline-block;
  margin-top: 20px;
  background: var(--accent);
  padding: 10px 20px;
  color: white;
  border-radius: var(--button-radius);
  text-decoration: none;
  transition: background 0.3s ease;
}

.hero .btn:hover,
.hero .btn:focus {
  background: var(--accent-hover);
  outline: none;
}

/* General Section Padding */
section {
  padding: 40px 20px;
}

/* Products Grid */
.products {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
}

/* Product Card */
.product-card {
  position: relative;
  background: var(--card-bg);
  border-radius: 10px;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  text-align: center;
  padding: 10px;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  animation: fadeInUp 0.4s ease;
  cursor: pointer;
}

.product-card:hover,
.product-card:focus-within {
  transform: translateY(-5px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
  outline: none;
}

@keyframes fadeInUp {
  0% {
    opacity: 0;
    transform: translateY(20px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

.product-card img {
  max-width: 100%;
  height: 180px;
  object-fit: cover;
  border-radius: 6px;
  user-select: none;
}

.product-card h3 {
  font-size: 1.1rem;
  margin: 10px 0 5px;
}

.product-card p {
  margin: 5px 0 15px;
  font-size: 0.9rem;
  color: var(--text-color);
}

/* Badges for product tags */
.product-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  padding: 5px 10px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: bold;
  color: var(--badge-color);
  text-transform: uppercase;
  user-select: none;
  box-shadow: 0 0 6px rgba(0, 0, 0, 0.2);
  animation: pulseBadge 2.5s infinite ease-in-out;
  pointer-events: none;
  z-index: 10;
}

.product-badge.new {
  background-color: var(--badge-bg-new);
}

.product-badge.featured {
  background-color: var(--badge-bg-featured);
}

@keyframes pulseBadge {
  0%,
  100% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(var(--badge-pulse-scale));
    opacity: 0.8;
  }
}

/* Buttons */
.product-card button,
.btn {
  background: var(--accent);
  color: white;
  border: none;
  padding: 8px 12px;
  border-radius: var(--button-radius);
  cursor: pointer;
  font-size: 0.95rem;
  transition: background 0.3s ease;
}

.product-card button:hover,
.product-card button:focus,
.btn:hover,
.btn:focus {
  background: var(--accent-hover);
  outline: none;
}

/* Font Awesome icons */
.fa {
  margin-right: 6px;
}

/* Footer */
footer {
  text-align: center;
  padding: 20px;
  background: var(--accent);
  color: white;
  margin-top: 40px;
}

/* Admin Styles */
.admin-container {
  max-width: 900px;
  margin: 40px auto;
  padding: 20px;
  background: var(--card-bg);
  border-radius: 10px;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.15);
}

table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 20px;
}

th,
td {
  border: 1px solid #ddd;
  padding: 10px;
  text-align: left;
}

th {
  background: var(--accent);
  color: white;
}

input,
select,
textarea {
  padding: 8px;
  width: 100%;
  margin-bottom: 12px;
  border: 1px solid #ccc;
  border-radius: 5px;
  background: white;
  color: #333;
  transition: background 0.3s ease, color 0.3s ease;
}

body.dark-mode input,
body.dark-mode select,
body.dark-mode textarea {
  background: #333;
  color: #f4f4f4;
  border: 1px solid #666;
}

/* Receipt Style */
#receipt-content {
  background: var(--card-bg);
  padding: 30px;
  max-width: 700px;
  margin: auto;
  font-size: 16px;
  color: var(--text-color);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
  border-radius: 8px;
}

#receipt-content h2 {
  text-align: center;
  margin-bottom: 20px;
  font-size: 1.6rem;
}

#receipt-content table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 10px;
}

#receipt-content th,
#receipt-content td {
  border: 1px solid #ccc;
  padding: 10px;
  text-align: left;
}

#receipt-content th {
  background: #eee;
}

body.dark-mode #receipt-content th {
  background: #444;
  color: #fff;
}

body.dark-mode #receipt-content td {
  border-color: #666;
}

/* Responsive */
@media (max-width: 768px) {
  header {
    flex-direction: column;
    text-align: center;
  }

  nav {
    margin-top: 10px;
  }

  .hero h1 {
    font-size: 1.8rem;
  }

  .products {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 480px) {
  .products {
    grid-template-columns: 1fr;
  }
}
