/* ===== RESET & BASE ===== */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --leather-dark: #2c1810;
  --leather-mid: #5c3a28;
  --leather-light: #8b5e3c;
  --leather-accent: #c4956a;
  --gold: #d4a24e;
  --cream: #f5efe6;
  --rust: #a0522d;
  --off-white: #faf6f0;
  --overlay: rgba(0, 0, 0, 0.75);
  --shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  --border-raw: #3d2218;
  --font-heading: 'Georgia', 'Times New Roman', serif;
  --font-body: 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
  --nav-height: 70px;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  background: #1a0f0a;
  color: var(--cream);
  line-height: 1.6;
  min-height: 100vh;
}

a { text-decoration: none; color: inherit; }
img { max-width: 100%; display: block; }
button { cursor: pointer; font-family: inherit; }
ul { list-style: none; }

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--leather-dark); }
::-webkit-scrollbar-thumb { background: var(--leather-light); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--gold); }

/* ===== HEADER ===== */
header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: linear-gradient(180deg, var(--leather-dark) 0%, rgba(44,24,16,0.97) 100%);
  border-bottom: 2px solid var(--border-raw);
  box-shadow: 0 2px 12px rgba(0,0,0,0.5);
  backdrop-filter: blur(6px);
}

.header-inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 24px;
  height: var(--nav-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-heading);
}

.logo-icon {
  font-size: 28px;
  line-height: 1;
}

.logo h1 {
  font-size: 22px;
  font-weight: 700;
  color: var(--gold);
  letter-spacing: 2px;
  text-transform: uppercase;
  line-height: 1.1;
}

.logo span {
  display: block;
  font-size: 10px;
  color: var(--leather-accent);
  letter-spacing: 4px;
  text-transform: uppercase;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.cart-btn {
  position: relative;
  background: var(--leather-mid);
  border: 1px solid var(--leather-accent);
  color: var(--cream);
  padding: 10px 20px;
  border-radius: 6px;
  font-size: 15px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s;
}

.cart-btn:hover {
  background: var(--leather-light);
  border-color: var(--gold);
}

.cart-count {
  background: var(--gold);
  color: var(--leather-dark);
  font-size: 11px;
  font-weight: 700;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: absolute;
  top: -6px;
  right: -6px;
}

.cart-count.hidden { display: none; }

/* ===== HERO ===== */
.hero {
  margin-top: var(--nav-height);
  background: linear-gradient(135deg, var(--leather-dark) 0%, #1a0f0a 50%, #3d2218 100%);
  padding: 80px 24px 60px;
  text-align: center;
  border-bottom: 3px solid var(--leather-mid);
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23c4956a' fill-opacity='0.06'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  opacity: 0.5;
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 800px;
  margin: 0 auto;
}

.hero h2 {
  font-family: var(--font-heading);
  font-size: 42px;
  color: var(--gold);
  margin-bottom: 16px;
  letter-spacing: 1px;
}

.hero p {
  font-size: 17px;
  color: var(--leather-accent);
  max-width: 600px;
  margin: 0 auto 24px;
  line-height: 1.7;
}

.hero em {
  font-style: italic;
  color: var(--cream);
}

/* ===== CATEGORY NAV ===== */
.category-nav {
  background: var(--leather-dark);
  border-bottom: 1px solid var(--border-raw);
  padding: 0 24px;
  position: sticky;
  top: var(--nav-height);
  z-index: 100;
}

.category-nav-inner {
  max-width: 1400px;
  margin: 0 auto;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.category-nav-inner::-webkit-scrollbar { display: none; }

.category-list {
  display: flex;
  gap: 4px;
  padding: 12px 0;
  white-space: nowrap;
}

.category-btn {
  background: transparent;
  border: 1px solid var(--leather-mid);
  color: var(--leather-accent);
  padding: 8px 18px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 1px;
  transition: all 0.2s;
  flex-shrink: 0;
}

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

.category-btn.active {
  background: var(--leather-mid);
  border-color: var(--gold);
  color: var(--gold);
}

/* ===== PRODUCT GRID ===== */
main {
  max-width: 1400px;
  margin: 0 auto;
  padding: 40px 24px 80px;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 32px;
  flex-wrap: wrap;
  gap: 12px;
}

.section-header h3 {
  font-family: var(--font-heading);
  font-size: 28px;
  color: var(--gold);
}

.section-header span {
  font-size: 14px;
  color: var(--leather-accent);
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: 24px;
}

.product-card {
  background: var(--leather-dark);
  border: 1px solid var(--border-raw);
  border-radius: 10px;
  overflow: hidden;
  transition: all 0.3s;
  cursor: pointer;
}

.product-card:hover {
  transform: translateY(-4px);
  border-color: var(--leather-accent);
  box-shadow: 0 8px 30px rgba(0,0,0,0.4);
}

.product-card-thumb {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  background: var(--leather-mid);
  transition: transform 0.3s;
}

.product-card:hover .product-card-thumb {
  transform: scale(1.03);
}

.product-card-body {
  padding: 16px 18px;
}

.product-card-body h4 {
  font-family: var(--font-heading);
  font-size: 16px;
  color: var(--cream);
  margin-bottom: 4px;
}

.product-card-body .category-tag {
  font-size: 11px;
  color: var(--leather-accent);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 8px;
}

.product-card-body .price {
  font-size: 18px;
  font-weight: 700;
  color: var(--gold);
}

.product-card-body .description-preview {
  font-size: 13px;
  color: var(--leather-accent);
  margin-top: 8px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.5;
}

.empty-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 60px 20px;
  color: var(--leather-accent);
  font-size: 18px;
}

/* ===== PRODUCT MODAL ===== */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: var(--overlay);
  padding: 24px;
  align-items: center;
  justify-content: center;
  overflow-y: auto;
  animation: fadeIn 0.2s;
}

.modal-overlay.open {
  display: flex;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

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

.modal {
  background: var(--leather-dark);
  border: 1px solid var(--leather-mid);
  border-radius: 12px;
  max-width: 900px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  animation: slideUp 0.3s;
  position: relative;
}

.modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 10;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--leather-mid);
  background: rgba(44,24,16,0.9);
  color: var(--cream);
  font-size: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.modal-close:hover {
  background: var(--leather-light);
  border-color: var(--gold);
}

.modal-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
}

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

/* Carousel */
.carousel {
  position: relative;
  background: #111;
  min-height: 350px;
}

.carousel-viewport {
  width: 100%;
  aspect-ratio: 1;
  position: relative;
  overflow: hidden;
}

.carousel-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.4s;
}

.carousel-slide.active {
  opacity: 1;
}

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

.carousel-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 5;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.2);
  background: rgba(0,0,0,0.6);
  color: white;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.carousel-btn:hover {
  background: var(--leather-light);
  border-color: var(--gold);
}

.carousel-prev { left: 12px; }
.carousel-next { right: 12px; }

.carousel-dots {
  position: absolute;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
  z-index: 5;
}

.carousel-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.4);
  background: rgba(0,0,0,0.5);
  transition: all 0.2s;
}

.carousel-dot.active {
  background: var(--gold);
  border-color: var(--gold);
}

/* Modal info */
.modal-info {
  padding: 32px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.modal-info .category-tag {
  font-size: 11px;
  color: var(--leather-accent);
  text-transform: uppercase;
  letter-spacing: 2px;
}

.modal-info h2 {
  font-family: var(--font-heading);
  font-size: 24px;
  color: var(--cream);
  line-height: 1.3;
}

.modal-info .price-large {
  font-size: 28px;
  font-weight: 700;
  color: var(--gold);
}

.modal-info .description {
  font-size: 15px;
  color: var(--leather-accent);
  line-height: 1.7;
}

.add-to-cart-btn {
  background: var(--gold);
  color: var(--leather-dark);
  border: none;
  padding: 14px 28px;
  border-radius: 6px;
  font-size: 16px;
  font-weight: 700;
  transition: all 0.2s;
  margin-top: auto;
}

.add-to-cart-btn:hover {
  background: #e8b85a;
  transform: translateY(-1px);
  box-shadow: 0 4px 15px rgba(212, 162, 78, 0.3);
}

/* ===== CART DRAWER ===== */
.cart-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 3000;
  background: rgba(0,0,0,0.6);
}

.cart-overlay.open {
  display: block;
}

.cart-drawer {
  position: fixed;
  top: 0;
  right: -420px;
  width: 400px;
  max-width: 100vw;
  height: 100vh;
  z-index: 3001;
  background: var(--leather-dark);
  border-left: 2px solid var(--leather-mid);
  display: flex;
  flex-direction: column;
  transition: right 0.3s;
  box-shadow: -8px 0 30px rgba(0,0,0,0.5);
}

.cart-drawer.open {
  right: 0;
}

.cart-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-raw);
}

.cart-header h3 {
  font-family: var(--font-heading);
  font-size: 20px;
  color: var(--gold);
}

.cart-close {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid var(--leather-mid);
  background: transparent;
  color: var(--leather-accent);
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.cart-close:hover {
  background: var(--leather-light);
  color: var(--cream);
}

.cart-items {
  flex: 1;
  overflow-y: auto;
  padding: 16px 24px;
}

.cart-empty {
  text-align: center;
  padding: 40px 0;
  color: var(--leather-accent);
  font-size: 15px;
}

.cart-item {
  display: flex;
  gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border-raw);
}

.cart-item:last-child {
  border-bottom: none;
}

.cart-item-thumb {
  width: 64px;
  height: 64px;
  border-radius: 6px;
  object-fit: cover;
  flex-shrink: 0;
  background: var(--leather-mid);
}

.cart-item-info {
  flex: 1;
  min-width: 0;
}

.cart-item-info h4 {
  font-size: 14px;
  color: var(--cream);
  margin-bottom: 2px;
}

.cart-item-info .cart-item-price {
  font-size: 14px;
  color: var(--gold);
  font-weight: 600;
}

.cart-item-qty {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
}

.qty-btn {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 1px solid var(--leather-mid);
  background: transparent;
  color: var(--leather-accent);
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

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

.cart-item-qty span {
  font-size: 14px;
  color: var(--cream);
  min-width: 24px;
  text-align: center;
}

.remove-item {
  background: transparent;
  border: none;
  color: var(--leather-accent);
  font-size: 13px;
  padding: 2px 4px;
  transition: color 0.2s;
}

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

/* Cart Footer */
.cart-footer {
  padding: 20px 24px;
  border-top: 1px solid var(--border-raw);
  background: rgba(0,0,0,0.3);
}

.cart-total {
  display: flex;
  justify-content: space-between;
  font-size: 18px;
  font-weight: 700;
  color: var(--cream);
  margin-bottom: 16px;
}

.cart-total .total-amount {
  color: var(--gold);
}

.checkout-btn {
  width: 100%;
  background: var(--gold);
  color: var(--leather-dark);
  border: none;
  padding: 14px;
  border-radius: 6px;
  font-size: 16px;
  font-weight: 700;
  transition: all 0.2s;
}

.checkout-btn:hover {
  background: #e8b85a;
  box-shadow: 0 4px 15px rgba(212, 162, 78, 0.3);
}

/* ===== CHECKOUT MODAL ===== */
.checkout-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 4000;
  background: var(--overlay);
  padding: 24px;
  align-items: center;
  justify-content: center;
  overflow-y: auto;
}

.checkout-modal.open {
  display: flex;
}

.checkout-panel {
  background: var(--leather-dark);
  border: 1px solid var(--leather-mid);
  border-radius: 12px;
  max-width: 500px;
  width: 100%;
  padding: 32px;
  animation: slideUp 0.3s;
}

.checkout-panel h3 {
  font-family: var(--font-heading);
  font-size: 22px;
  color: var(--gold);
  margin-bottom: 8px;
}

.checkout-panel .checkout-subtotal {
  color: var(--leather-accent);
  font-size: 14px;
  margin-bottom: 24px;
}

.payment-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 24px;
}

.payment-option {
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--leather-mid);
  border-radius: 8px;
  padding: 14px 12px;
  text-align: center;
  transition: all 0.2s;
  font-size: 13px;
  font-weight: 600;
  color: var(--leather-accent);
}

.payment-option:hover {
  border-color: var(--leather-accent);
  color: var(--cream);
}

.payment-option.selected {
  border-color: var(--gold);
  background: rgba(212, 162, 78, 0.1);
  color: var(--gold);
}

.payment-option-icon {
  font-size: 24px;
  display: block;
  margin-bottom: 6px;
}

.square-payment-section {
  margin-bottom: 20px;
  min-height: 80px;
}

#square-payment-form {
  width: 100%;
}

#card-container {
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--leather-mid);
  border-radius: 6px;
  padding: 12px;
  min-height: 44px;
}

.pay-submit-btn {
  width: 100%;
  background: var(--gold);
  color: var(--leather-dark);
  border: none;
  padding: 14px;
  border-radius: 6px;
  font-size: 16px;
  font-weight: 700;
  transition: all 0.2s;
  margin-top: 12px;
}

.pay-submit-btn:hover {
  background: #e8b85a;
}

.pay-submit-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.checkout-close-btn {
  width: 100%;
  background: transparent;
  border: 1px solid var(--leather-mid);
  color: var(--leather-accent);
  padding: 12px;
  border-radius: 6px;
  font-size: 14px;
  margin-top: 8px;
  transition: all 0.2s;
}

.checkout-close-btn:hover {
  border-color: var(--leather-accent);
  color: var(--cream);
}

.payment-note {
  font-size: 12px;
  color: var(--leather-accent);
  text-align: center;
  margin-top: 16px;
  font-style: italic;
}

/* ===== TOAST ===== */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  z-index: 5000;
  background: var(--leather-dark);
  border: 1px solid var(--gold);
  color: var(--cream);
  padding: 14px 28px;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
  box-shadow: 0 4px 20px rgba(0,0,0,0.5);
  opacity: 0;
  transition: all 0.3s;
  pointer-events: none;
}

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

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .header-inner { padding: 0 16px; }
  .logo h1 { font-size: 18px; }
  .logo span { font-size: 9px; letter-spacing: 2px; }
  .hero { padding: 60px 16px 40px; }
  .hero h2 { font-size: 28px; }
  .product-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 14px; }
  .modal { max-height: 95vh; }
  .modal-info { padding: 20px; }
  .cart-drawer { width: 100vw; }
  .checkout-panel { padding: 20px; }
  .payment-options { grid-template-columns: 1fr 1fr; }
  .section-header h3 { font-size: 22px; }
}

@media (max-width: 480px) {
  .product-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .category-btn { font-size: 11px; padding: 6px 14px; }
  .modal-body { grid-template-columns: 1fr; }
}
