:root {
  --navy-dark: #1a2744;
  --navy: #2c3e5a;
  --navy-light: #3d5275;
  --gold: #c9a96e;
  --gold-light: #d4bc8a;
  --gold-dark: #a88b4a;
  --cream: #faf8f5;
  --cream-dark: #f0ebe3;
  --text-dark: #2d3748;
  --text-medium: #4a5568;
  --text-light: #718096;
  --white: #ffffff;
  --border: #e2ddd5;
  --shadow-subtle: 0 2px 8px rgba(26, 39, 68, 0.06);
  --shadow-medium: 0 4px 16px rgba(26, 39, 68, 0.1);
  --shadow-elevated: 0 8px 32px rgba(26, 39, 68, 0.15);
}

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

body {
  font-family: 'Heebo', 'Segoe UI', Tahoma, sans-serif;
  background: var(--cream);
  min-height: 100vh;
  color: var(--text-dark);
  line-height: 1.6;
}

header {
  background: var(--navy-dark);
  color: var(--white);
  padding: 0.5rem 2rem;
  box-shadow: 0 2px 12px rgba(26, 39, 68, 0.2);
  border-bottom: 3px solid var(--gold);
}

.header-content {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.header-content h1 {
  font-family: 'Playfair Display', Georgia, serif;
  font-weight: 600;
  font-size: 1.75rem;
  letter-spacing: 0.5px;
  color: var(--gold-light);
}

.cart-icon {
  position: relative;
  cursor: pointer;
  font-size: 1.4rem;
  padding: 0.6rem;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  transition: background 0.3s ease;
}

.cart-icon:hover {
  background: rgba(255, 255, 255, 0.15);
}

.cart-icon #cart-count {
  position: absolute;
  top: -4px;
  left: -4px;
  background: var(--gold);
  color: var(--navy-dark);
  font-size: 0.7rem;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 10px;
  min-width: 18px;
  text-align: center;
}

.menu-btn {
  display: flex;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.6rem;
  transition: all 0.3s ease;
}

.menu-btn span {
  width: 24px;
  height: 3px;
  background: var(--gold-light);
  border-radius: 2px;
  transition: all 0.3s ease;
}

.menu-btn:hover span {
  background: var(--gold);
}

.menu-sidebar {
  position: fixed;
  top: 0;
  right: -300px;
  width: 300px;
  height: 100vh;
  background: var(--navy-dark);
  box-shadow: -4px 0 24px rgba(26, 39, 68, 0.25);
  transition: right 0.35s ease;
  display: flex;
  flex-direction: column;
  z-index: 999;
}

.menu-sidebar.open {
  right: 0;
}

.menu-header {
  display: flex;
  justify-content: flex-end;
  padding: 1rem 1.5rem;
  border-bottom: 2px solid var(--gold);
}

.menu-close-btn {
  background: none;
  border: none;
  font-size: 2rem;
  cursor: pointer;
  color: var(--gold-light);
  transition: color 0.3s ease;
  line-height: 1;
}

.menu-close-btn:hover {
  color: var(--gold);
}

.menu-content {
  flex: 1;
  padding: 2rem 0;
  overflow-y: auto;
}

main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2.5rem 2rem;
}

.products-section h2 {
  margin-bottom: 2rem;
  color: var(--navy-dark);
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.75rem;
  font-weight: 600;
  position: relative;
  padding-bottom: 0.75rem;
}

.products-section h2::after {
  content: '';
  position: absolute;
  bottom: 0;
  right: 0;
  width: 60px;
  height: 3px;
  background: var(--gold);
}

.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1.5rem;
}

.product-card {
  background: var(--white);
  border-radius: 4px;
  overflow: hidden;
  box-shadow: var(--shadow-subtle);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  border: 1px solid var(--border);
}

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

.product-card img {
  width: 100%;
  height: 180px;
  object-fit: cover;
  border-bottom: 1px solid var(--border);
}

.product-clickable {
  cursor: pointer;
  transition: opacity 0.3s ease;
}

.product-clickable:hover {
  opacity: 0.9;
}

.product-name-clickable {
  cursor: pointer;
  transition: color 0.3s ease;
}

.product-name-clickable:hover {
  color: var(--gold-dark);
}

.product-info {
  padding: 1rem 1.25rem 1.25rem;
}

.product-info h3 {
  color: var(--navy-dark);
  margin-bottom: 0.4rem;
  font-weight: 600;
  font-size: 1rem;
}

.product-category {
  color: var(--text-light);
  font-size: 0.85rem;
  margin-bottom: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 500;
}

.product-price {
  color: var(--gold-dark);
  font-size: 1.35rem;
  font-weight: 700;
  margin-bottom: 1.25rem;
}

.add-to-cart {
  width: 100%;
  padding: 0.85rem;
  background: var(--navy-dark);
  color: var(--white);
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.95rem;
  font-weight: 500;
  font-family: 'Heebo', sans-serif;
  transition: background 0.3s ease, transform 0.2s ease;
  letter-spacing: 0.3px;
}

.add-to-cart:hover {
  background: var(--navy);
  transform: translateY(-1px);
}

.cart-sidebar {
  position: fixed;
  top: 0;
  left: -380px;
  width: 380px;
  height: 100vh;
  background: var(--white);
  box-shadow: 4px 0 24px rgba(26, 39, 68, 0.15);
  transition: left 0.35s ease;
  display: flex;
  flex-direction: column;
  z-index: 1000;
}

.cart-sidebar.open {
  left: 0;
}

.cart-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.25rem 1.5rem;
  border-bottom: 2px solid var(--gold);
  background: var(--navy-dark);
}

.cart-header h3 {
  color: var(--gold-light);
  font-family: 'Playfair Display', Georgia, serif;
  font-weight: 600;
  font-size: 1.25rem;
}

.close-btn {
  background: none;
  border: none;
  font-size: 1.75rem;
  cursor: pointer;
  color: var(--cream);
  transition: color 0.3s ease;
  line-height: 1;
}

.close-btn:hover {
  color: var(--gold);
}

.cart-items {
  flex: 1;
  overflow-y: auto;
  padding: 1.25rem;
  background: var(--cream);
}

.cart-item {
  display: flex;
  gap: 1rem;
  padding: 1rem;
  background: var(--white);
  border-radius: 4px;
  margin-bottom: 0.75rem;
  border: 1px solid var(--border);
}

.cart-item img {
  width: 65px;
  height: 65px;
  object-fit: cover;
  border-radius: 4px;
  border: 1px solid var(--border);
}

.cart-item-info {
  flex: 1;
}

.cart-item-info h4 {
  margin-bottom: 0.3rem;
  color: var(--navy-dark);
  font-weight: 600;
  font-size: 0.95rem;
}

.cart-item-price {
  color: var(--gold-dark);
  font-weight: 700;
  font-size: 1rem;
}

.cart-item-quantity {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.cart-item-quantity button {
  width: 28px;
  height: 28px;
  border: 1px solid var(--border);
  background: var(--cream);
  border-radius: 4px;
  cursor: pointer;
  font-weight: 600;
  color: var(--navy-dark);
  transition: background 0.2s ease, border-color 0.2s ease;
}

.cart-item-quantity button:hover {
  background: var(--cream-dark);
  border-color: var(--gold);
}

.cart-item-quantity span {
  min-width: 24px;
  text-align: center;
  font-weight: 600;
}

.remove-item {
  color: var(--text-light);
  cursor: pointer;
  font-size: 1.1rem;
  transition: color 0.2s ease;
  align-self: flex-start;
}

.remove-item:hover {
  color: #c53030;
}

.cart-footer {
  padding: 1.25rem 1.5rem;
  border-top: 1px solid var(--border);
  background: var(--white);
}

.cart-total {
  display: flex;
  justify-content: space-between;
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 1.25rem;
  color: var(--navy-dark);
}

.checkout-btn {
  width: 100%;
  padding: 1rem;
  background: var(--gold);
  color: var(--navy-dark);
  border: none;
  border-radius: 4px;
  font-size: 1.05rem;
  font-weight: 600;
  font-family: 'Heebo', sans-serif;
  cursor: pointer;
  transition: background 0.3s ease, transform 0.2s ease;
  letter-spacing: 0.3px;
}

.checkout-btn:hover {
  background: var(--gold-dark);
  transform: translateY(-1px);
}

.empty-cart {
  text-align: center;
  color: var(--text-light);
  padding: 3rem 1rem;
  font-size: 1rem;
}

.toast {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: var(--navy-dark);
  color: var(--gold-light);
  padding: 1rem 2rem;
  border-radius: 4px;
  font-size: 1rem;
  font-weight: 600;
  box-shadow: var(--shadow-elevated);
  opacity: 0;
  transition: transform 0.3s ease, opacity 0.3s ease;
  z-index: 2000;
  border: 1px solid var(--gold);
}

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

.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(26, 39, 68, 0.6);
  z-index: 2000;
  overflow-y: auto;
  backdrop-filter: blur(2px);
}

.modal.open {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 2rem;
}

.modal-content {
  background: var(--white);
  border-radius: 4px;
  padding: 2.5rem;
  max-width: 520px;
  width: 100%;
  position: relative;
  margin: auto;
  box-shadow: var(--shadow-elevated);
  border-top: 4px solid var(--gold);
}

.modal-close {
  position: absolute;
  top: 1rem;
  left: 1rem;
  background: var(--cream);
  border: 1px solid var(--border);
  width: 36px;
  height: 36px;
  border-radius: 4px;
  font-size: 1.4rem;
  cursor: pointer;
  color: var(--text-medium);
  transition: background 0.2s ease, color 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.modal-close:hover {
  background: var(--cream-dark);
  color: var(--navy-dark);
}

.modal-content h2 {
  margin-bottom: 1.75rem;
  color: var(--navy-dark);
  text-align: center;
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.5rem;
  font-weight: 600;
}

.checkout-summary {
  background: var(--cream);
  padding: 1.25rem;
  border-radius: 4px;
  margin-bottom: 1.75rem;
  border: 1px solid var(--border);
}

.checkout-summary h3 {
  margin-bottom: 1rem;
  font-size: 1rem;
  color: var(--navy-dark);
  font-weight: 600;
}

.checkout-item {
  display: flex;
  justify-content: space-between;
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--border);
  color: var(--text-medium);
  font-size: 0.95rem;
}

.checkout-total {
  display: flex;
  justify-content: space-between;
  font-weight: 700;
  font-size: 1.15rem;
  margin-top: 1rem;
  padding-top: 0.75rem;
  border-top: 2px solid var(--gold);
  color: var(--navy-dark);
}

.shipping-form h3 {
  margin-bottom: 1rem;
  font-size: 1rem;
  color: var(--navy-dark);
  font-weight: 600;
}

.form-group {
  margin-bottom: 1.1rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.35rem;
  font-size: 0.9rem;
  color: var(--text-medium);
  font-weight: 500;
}

.form-group input {
  width: 100%;
  padding: 0.85rem 1rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 1rem;
  font-family: 'Heebo', sans-serif;
  background: var(--white);
  color: var(--text-dark);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-group input:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(201, 169, 110, 0.15);
}

.form-row {
  display: flex;
  gap: 1rem;
}

.form-row .form-group {
  flex: 1;
}

#paypal-button-container {
  margin-top: 1.75rem;
}

.success-message {
  text-align: center;
  padding: 2.5rem 1rem;
}

.success-message h2 {
  color: var(--navy-dark);
  margin-bottom: 1rem;
  font-family: 'Playfair Display', Georgia, serif;
}

.success-message p {
  color: var(--text-medium);
  margin-bottom: 2rem;
  line-height: 1.7;
}

.continue-btn {
  padding: 1rem 2.5rem;
  background: var(--navy-dark);
  color: var(--white);
  border: none;
  border-radius: 4px;
  font-size: 1rem;
  font-weight: 500;
  font-family: 'Heebo', sans-serif;
  cursor: pointer;
  transition: background 0.3s ease;
}

.continue-btn:hover {
  background: var(--navy);
}

.product-detail-modal .product-detail-content {
  max-width: 720px;
}

.product-detail {
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
}

.product-detail-image {
  width: 100%;
}

.product-detail-image img {
  width: 100%;
  max-height: 380px;
  object-fit: cover;
  border-radius: 4px;
  border: 1px solid var(--border);
}

.product-detail-info {
  text-align: right;
}

.product-detail-info h2 {
  color: var(--navy-dark);
  margin-bottom: 0.5rem;
  font-size: 1.6rem;
  font-family: 'Playfair Display', Georgia, serif;
  font-weight: 600;
}

.product-detail-category {
  color: var(--text-light);
  font-size: 0.9rem;
  margin-bottom: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 500;
}

.product-detail-price {
  color: var(--gold-dark);
  font-size: 1.75rem;
  font-weight: 700;
  margin-bottom: 1.25rem;
}

.product-detail-description {
  background: var(--cream);
  padding: 1.25rem;
  border-radius: 4px;
  margin-bottom: 1.75rem;
  min-height: 80px;
  border: 1px solid var(--border);
}

.product-detail-description p {
  color: var(--text-medium);
  line-height: 1.8;
  white-space: pre-wrap;
}

.product-detail-description .no-description {
  color: var(--text-light);
  font-style: italic;
}

.product-detail-add {
  width: 100%;
  padding: 1rem;
  font-size: 1.05rem;
}

.loading-text,
.error-text {
  text-align: center;
  padding: 3rem;
  color: var(--text-light);
}

.error-text {
  color: #c53030;
}

@media (min-width: 600px) {
  .product-detail {
    flex-direction: row;
  }

  .product-detail-image {
    flex: 1;
    max-width: 320px;
  }

  .product-detail-info {
    flex: 1;
  }
}

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

  .header-content h1 {
    font-size: 1.4rem;
  }

  main {
    padding: 1.5rem 1rem;
  }

  .products-section h2 {
    font-size: 1.4rem;
  }

  .products-grid {
    gap: 1.25rem;
  }

  .cart-sidebar {
    width: 100%;
    left: -100%;
  }
  
  .cart-sidebar.open {
    left: 0;
  }

  .modal.open {
    padding: 1rem;
  }

  .modal-content {
    padding: 1.75rem 1.25rem;
  }
}
