:root {
  --primary-brown: #8b4513;
  --primary-brown-dark: #a0522d;
  --accent-red: #e74c3c;
  --accent-red-dark: #c0392b;
  --accent-gold: #f0a500;
  --surface: rgba(255, 255, 255, 0.9);
  --surface-strong: rgba(255, 255, 255, 0.98);
  --text-color: #8b4513;
  --text-muted: rgba(102, 102, 102, 0.85);
  --shadow-soft: 0 8px 25px rgba(139, 69, 19, 0.12);
  --shadow-strong: 0 18px 40px rgba(139, 69, 19, 0.18);
  --radius-pill: 999px;
  --radius-lg: 28px;
  --transition: all 0.3s ease;
}

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

html,
body {
  min-height: 100vh;
  width: 100%;
  margin: 0;
  padding: 0;
}

body {
  background: linear-gradient(135deg, #faf8f5 0%, #f5f3f0 100%);
  font-family: 'Poppins', sans-serif;
  color: var(--text-color);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

.hidden {
  display: none !important;
}

a {
  color: inherit;
  text-decoration: none;
  transition: var(--transition);
}

a:hover {
  text-decoration: none;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  outline: none;
  background: transparent;
  transition: var(--transition);
}

img {
  max-width: 100%;
  height: auto;
  display: block;
  object-fit: cover;
  transition: transform 0.3s ease;
}

/* Fixed Size Image Classes */
.img-fixed-sm {
  width: 200px;
  height: 150px;
  object-fit: cover;
}

.img-fixed-md {
  width: 280px;
  height: 200px;
  object-fit: cover;
}

.img-fixed-lg {
  width: 400px;
  height: 300px;
  object-fit: cover;
}

.img-fixed-square-sm {
  width: 200px;
  height: 200px;
  object-fit: cover;
}

.img-fixed-square-md {
  width: 280px;
  height: 280px;
  object-fit: cover;
}

.img-fixed-square-lg {
  width: 400px;
  height: 400px;
  object-fit: cover;
}

.img-container {
  position: relative;
  overflow: hidden;
  border-radius: 8px;
}

.img-container img {
  object-fit: cover;
  transition: transform 0.3s ease;
}

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

header#mainHeader {
  background: linear-gradient(135deg, #f5f3f0 0%, #faf8f5 100%);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  padding: 1rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-bottom: 2px solid rgba(139, 69, 19, 0.1);
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  box-shadow: 0 8px 32px rgba(139, 69, 19, 0.1);
  transition: var(--transition);
}

header#mainHeader.scrolled {
  background: rgba(245, 243, 240, 0.98);
  box-shadow: 0 4px 20px rgba(139, 69, 19, 0.1);
  padding: 0.75rem 1.5rem;
}

.header-content {
  width: 100%;
  max-width: 1400px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
  margin-right: auto;
}

.logo-icon {
  font-size: 1.6rem;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
  transition: var(--transition);
}

.logo:hover .logo-icon {
  transform: scale(1.1) rotate(5deg);
}

.logo-text {
  font-size: 1.4rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--primary-brown), var(--primary-brown-dark));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.5px;
}

.menu-toggle {
  display: none;
  font-size: 1.8rem;
  color: var(--primary-brown);
}

nav {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1.5rem;
}

nav ul {
  list-style: none;
  display: flex;
  gap: 1.5rem;
  align-items: center;
  justify-content: center;
  flex: 1;
  position: relative;
}

nav ul li a {
  color: var(--primary-brown);
  font-weight: 600;
  font-size: 0.9rem;
  padding: 0.6rem 1rem;
  border-radius: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

nav ul li a:hover,
nav ul li a:focus {
  background: linear-gradient(135deg, var(--primary-brown), var(--primary-brown-dark));
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(139, 69, 19, 0.3);
}

nav ul li a.active {
  background: #e9ecef;
  color: #333;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-shrink: 0;
  margin-left: auto;
}

.auth-links {
  display: none;
  align-items: center;
  gap: 1rem;
}

nav .auth-links {
  display: flex;
}

.auth-link {
  font-weight: 600;
  color: var(--primary-brown);
  padding: 0.5rem 1rem;
  border-radius: 999px;
  border: 1px solid rgba(139, 69, 19, 0.25);
  background: rgba(255, 255, 255, 0.6);
  box-shadow: 0 2px 6px rgba(139, 69, 19, 0.08);
  transition: var(--transition);
  font-size: 0.9rem;
}

.auth-link:hover,
.auth-link:focus-visible {
  background: linear-gradient(135deg, #fdf8f3, #f2e4d8);
  color: var(--primary-brown-dark);
  transform: translateY(-1px);
}

.auth-link.auth-primary {
  background: linear-gradient(135deg, var(--primary-brown), var(--primary-brown-dark));
  color: #fff;
  border-color: transparent;
  box-shadow: 0 6px 18px rgba(139, 69, 19, 0.28);
}

.auth-link.auth-primary:hover,
.auth-link.auth-primary:focus-visible {
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(139, 69, 19, 0.36);
}

.cart-link {
  color: var(--primary-brown);
  font-weight: 600;
  padding: 0.6rem 1rem;
  border-radius: 20px;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.9rem;
  position: relative;
}

.cart-link:hover {
  background: linear-gradient(135deg, var(--primary-brown), var(--primary-brown-dark));
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(139, 69, 19, 0.3);
}

.cart-badge {
  position: absolute;
  top: -2px;
  right: -4px;
  background: linear-gradient(135deg, #e74c3c, #c0392b);
  color: white;
  border-radius: 10px;
  padding: 0.15rem 0.4rem;
  font-size: 0.7rem;
  font-weight: 700;
  min-width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(231, 76, 60, 0.4);
  border: 2px solid #f5f3f0;
  line-height: 1;
}

.cart-link:hover .cart-badge {
  border-color: var(--primary-brown);
}

.profile-dropdown {
  position: relative;
  display: flex;
  align-items: center;
}

.profile-trigger {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: transparent;
  padding: 0.4rem 0.6rem;
  border-radius: 20px;
}

.profile-img {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--primary-brown);
  box-shadow: 0 2px 8px rgba(139, 69, 19, 0.2);
  transition: all 0.3s ease;
}

.profile-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  line-height: 1.1;
}

.profile-meta strong {
  font-size: 0.85rem;
  color: var(--primary-brown);
}

.profile-meta span {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.dropdown-menu {
  position: absolute;
  top: 120%;
  right: 0;
  min-width: 200px;
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.12);
  border: 1px solid rgba(139, 69, 19, 0.12);
  padding: 0.75rem 0;
  display: none;
  flex-direction: column;
  z-index: 1200;
}

.dropdown-menu li {
  list-style: none;
}

.dropdown-menu li a {
  display: block;
  padding: 0.75rem 1.25rem;
  color: #666666;
  font-weight: 500;
}

.dropdown-menu li a:hover {
  background: #f5f3f0;
  color: var(--primary-brown);
}

.profile-dropdown.show .dropdown-menu {
  display: flex;
}

@media (max-width: 768px) {
  header#mainHeader {
    padding: 1rem 1rem;
  }

  .header-content {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
  }

  .logo {
    margin-right: 0;
  }

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

  .logo-text {
    font-size: 1.2rem;
  }

  .nav-right {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: auto;
    order: 3;
    margin-left: auto;
  }

  nav .auth-links {
    width: 100%;
    justify-content: center;
    gap: 1rem;
    padding: 1.5rem 1.5rem 0;
    border-top: 1px solid rgba(139, 69, 19, 0.1);
    margin-top: 1.5rem;
    flex-direction: column;
  }

  nav .auth-link {
    width: 100%;
    text-align: center;
    padding: 1rem 1.5rem;
    font-size: 1rem;
  }

  .cart-link {
    padding: 0.5rem 0.8rem;
    font-size: 0.85rem;
    width: auto;
  }

  .cart-link > span:not(.cart-badge) {
    display: none;
  }

  .cart-badge {
    top: -4px;
    right: -4px;
  }

  .profile-dropdown {
    display: none;
  }

  .menu-toggle {
    display: block;
    font-size: 1.5rem;
    padding: 0.5rem;
    order: 4;
  }

  nav {
    position: fixed;
    top: 65px;
    left: 0;
    right: 0;
    width: 100%;
    max-width: none;
    background: rgba(245, 243, 240, 0.98);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    display: none;
    flex-direction: column;
    align-items: stretch;
    border-bottom: 1px solid rgba(139, 69, 19, 0.1);
    padding: 1.5rem 1rem 1.5rem;
    box-shadow: 0 4px 20px rgba(139, 69, 19, 0.1);
    z-index: 1100;
    order: 5;
  }

  nav.active {
    display: flex;
  }

  nav ul {
    flex-direction: column;
    gap: 0.5rem;
    width: 100%;
    padding: 0;
  }

  nav ul li {
    width: 100%;
  }

  nav ul li a {
    width: 100%;
    padding: 1rem 1.5rem;
    text-align: center;
    border-radius: 8px;
    font-size: 1rem;
  }

  /* Mobile Image Fixed Sizes */
  .img-container {
    border-radius: 6px;
  }
  
  .img-fixed-lg {
    width: 300px;
    height: 225px;
  }
  
  .img-fixed-square-lg {
    width: 300px;
    height: 300px;
  }
  
  .img-fixed-md {
    width: 250px;
    height: 180px;
  }

  main {
    padding-top: 70px;
  }

}

main {
  width: 100%;
  margin: 0;
  padding-top: 80px;
  display: block;
  min-height: calc(100vh - 80px);
}

.page-section {
  background: #ffffff;
  border-radius: 16px;
  box-shadow: var(--shadow-soft);
  border: 1px solid rgba(139, 69, 19, 0.12);
  padding: 1.5rem;
  margin: 1rem 1rem 2rem 1rem;
  width: calc(100% - 2rem);
}

/* First page section should have more top margin */
.page-section:first-of-type {
  margin-top: 1.5rem;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.9rem;
  border-radius: var(--radius-pill);
  font-size: 0.8rem;
  font-weight: 600;
  background: rgba(139, 69, 19, 0.12);
  color: var(--primary-brown);
}

.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(135deg, var(--primary-brown), var(--primary-brown-dark));
  color: #fff;
  padding: 0.85rem 1.8rem;
  border-radius: 999px;
  box-shadow: 0 12px 32px rgba(139, 69, 19, 0.25);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease, transform 0.3s ease;
  z-index: 4000;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(-8px);
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent-red), var(--accent-red-dark));
  color: #fff;
  border-radius: var(--radius-pill);
  padding: 0.75rem 1.6rem;
  font-weight: 600;
  box-shadow: 0 6px 18px rgba(231, 76, 60, 0.35);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
}

.btn-primary:hover {
  background: linear-gradient(135deg, var(--accent-red-dark), #a93226);
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(231, 76, 60, 0.4);
}

.btn-secondary {
  background: rgba(139, 69, 19, 0.12);
  color: var(--primary-brown);
  border-radius: var(--radius-pill);
  padding: 0.75rem 1.6rem;
  font-weight: 600;
  box-shadow: 0 2px 6px rgba(139, 69, 19, 0.12);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
}

.btn-secondary:hover {
  background: rgba(139, 69, 19, 0.18);
  transform: translateY(-2px);
}

.table {
  width: 100%;
  border-collapse: collapse;
}

.table thead th {
  text-align: left;
  padding: 0.75rem 1rem;
  font-weight: 600;
  color: var(--primary-brown);
  border-bottom: 1px solid rgba(139, 69, 19, 0.12);
}

.table tbody td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid rgba(139, 69, 19, 0.08);
  color: var(--text-color);
  font-weight: 500;
}

.empty-state {
  background: rgba(255, 255, 255, 0.92);
  border: 1px dashed rgba(139, 69, 19, 0.2);
  border-radius: var(--radius-lg);
  padding: 3rem 2rem;
  text-align: center;
  color: var(--text-muted);
  box-shadow: var(--shadow-soft);
}
