:root {
  --bg: #0f0e0c;
  --bg-alt: #1a1814;
  --surface: #242019;
  --text: #e8e4dc;
  --text-muted: #9a9288;
  --accent: #c4a35a;
  --accent-hover: #d4b86a;
  --border: rgba(196, 163, 90, 0.2);
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  --font-display: 'Cormorant Garamond', Georgia, serif;
  --font-body: 'Outfit', system-ui, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

body.browse-locked {
  overflow: hidden;
}

/* Header */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: rgba(15, 14, 12, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.logo {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--text);
  text-decoration: none;
  letter-spacing: 0.02em;
}

.logo span {
  color: var(--accent);
  font-style: italic;
}

.nav {
  display: flex;
  gap: 2rem;
}

.nav a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 400;
  transition: color 0.2s;
}

.nav a:hover {
  color: var(--accent);
}

.cart-btn {
  position: relative;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.2s, background 0.2s;
}

.cart-btn:hover {
  border-color: var(--accent);
  background: rgba(196, 163, 90, 0.08);
}

.cart-count {
  position: absolute;
  top: -4px;
  right: -4px;
  background: var(--accent);
  color: var(--bg);
  font-size: 0.7rem;
  font-weight: 600;
  min-width: 18px;
  height: 18px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cart-count:empty,
.cart-count[data-count="0"] {
  display: none;
}

/* Bouton retour */
.btn-back {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  min-height: 44px;
  padding: 0.5rem 0.85rem;
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-muted);
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 2px;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
  transition: color 0.2s, border-color 0.2s;
}

.btn-back:hover {
  color: var(--accent);
  border-color: var(--accent);
}

.btn-back[hidden] {
  display: none !important;
}

.btn-back-inline {
  margin-bottom: 1rem;
}

.btn-back-modal {
  position: absolute;
  top: max(1rem, env(safe-area-inset-top));
  left: max(1rem, env(safe-area-inset-left));
  z-index: 3;
  background: rgba(15, 14, 12, 0.85);
  backdrop-filter: blur(8px);
}

.header-inner:has(.btn-back:not([hidden])) {
  gap: 0.5rem;
}

.header-inner .logo {
  flex: 1;
  min-width: 0;
}

/* Hero */
.hero {
  min-height: 85vh;
  display: flex;
  align-items: center;
  padding: 8rem 1.5rem 4rem;
  background:
    linear-gradient(135deg, rgba(15, 14, 12, 0.85) 0%, rgba(15, 14, 12, 0.6) 50%, rgba(26, 24, 20, 0.9) 100%),
    url('img/masque6.jpg') center/cover no-repeat;
}

.hero-content {
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
}

.hero-tag {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.25em;
  color: var(--accent);
  margin-bottom: 1rem;
}

.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 6vw, 4.5rem);
  font-weight: 400;
  line-height: 1.15;
  margin-bottom: 1.5rem;
}

.hero h1 em {
  font-style: italic;
  color: var(--accent);
}

.hero-desc {
  max-width: 520px;
  color: var(--text-muted);
  font-size: 1.05rem;
  margin-bottom: 2rem;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.85rem 1.75rem;
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 500;
  border: none;
  border-radius: 2px;
  cursor: pointer;
  transition: background 0.2s, transform 0.15s;
  text-decoration: none;
}

.btn-primary {
  background: var(--accent);
  color: var(--bg);
}

.btn-primary:hover {
  background: var(--accent-hover);
}

.btn-block {
  width: 100%;
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--accent);
  color: var(--accent);
}

.btn-outline:hover {
  background: rgba(196, 163, 90, 0.12);
}

.btn-sm {
  padding: 0.5rem 1rem;
  font-size: 0.8rem;
}

/* Gallery */
.gallery-section {
  padding: 5rem 1.5rem;
  max-width: 1200px;
  margin: 0 auto;
}

.gallery-section.alt {
  background: var(--bg-alt);
  max-width: none;
  padding-left: calc((100vw - 1200px) / 2 + 1.5rem);
  padding-right: calc((100vw - 1200px) / 2 + 1.5rem);
}

.section-header {
  text-align: center;
  margin-bottom: 3rem;
}

.section-header h2 {
  font-family: var(--font-display);
  font-size: 2.5rem;
  font-weight: 400;
  margin-bottom: 0.5rem;
}

.section-header p {
  color: var(--text-muted);
  font-size: 1rem;
}

.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 2rem;
}

/* Product card */
.product-card {
  background: var(--surface);
  border: 1px solid var(--border);
  overflow: hidden;
  transition: transform 0.3s, box-shadow 0.3s;
}

.product-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow);
}

.product-card-image {
  position: relative;
  aspect-ratio: 4/5;
  overflow: hidden;
  cursor: pointer;
  background: #1a1814;
}

.product-image-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 1rem;
  background: linear-gradient(to top, rgba(15, 14, 12, 0.85) 0%, transparent 55%);
  opacity: 0;
  transition: opacity 0.3s;
  pointer-events: none;
}

.product-card:hover .product-image-overlay,
.product-card-image:focus-within .product-image-overlay {
  opacity: 1;
  pointer-events: auto;
}

@media (hover: none) {
  .product-image-overlay {
    opacity: 1;
    pointer-events: auto;
  }
}

.btn-pay-direct {
  width: 100%;
  padding: 0.75rem 1rem;
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 600;
  background: var(--accent);
  color: var(--bg);
  border: none;
  border-radius: 2px;
  cursor: pointer;
  transition: background 0.2s;
}

.btn-pay-direct:hover {
  background: var(--accent-hover);
}

.product-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s;
}

.product-card:hover .product-card-image img {
  transform: scale(1.05);
}

.product-card-body {
  padding: 1.25rem;
}

.product-card h3 {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 600;
  margin-bottom: 0.35rem;
}

.product-card .price {
  color: var(--accent);
  font-size: 1.1rem;
  font-weight: 500;
  margin-bottom: 0.75rem;
}

.product-card .excerpt {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.product-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.product-card-actions .btn {
  flex: 1 1 calc(33% - 0.5rem);
  min-width: 0;
}

.product-modal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.product-modal-actions .btn {
  flex: 1 1 auto;
  min-width: 140px;
}

/* About */
.about {
  padding: 4rem 1.5rem;
  border-top: 1px solid var(--border);
}

.about-inner {
  max-width: 640px;
  margin: 0 auto;
  text-align: center;
}

.about h2 {
  font-family: var(--font-display);
  font-size: 2rem;
  margin-bottom: 1rem;
}

.about p {
  color: var(--text-muted);
}

/* Footer */
.footer {
  padding: 2rem 1.5rem;
  text-align: center;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.85rem;
}

.footer-note {
  margin-top: 0.5rem;
  font-size: 0.75rem;
  opacity: 0.7;
}

/* Cart panel */
.cart-panel {
  position: fixed;
  inset: 0;
  z-index: 200;
  pointer-events: none;
  visibility: hidden;
}

.cart-panel.open {
  pointer-events: auto;
  visibility: visible;
}

.cart-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  opacity: 0;
  transition: opacity 0.3s;
}

.cart-panel.open .cart-overlay {
  opacity: 1;
}

.cart-panel-inner {
  position: absolute;
  top: 0;
  right: 0;
  width: min(400px, 100%);
  height: 100%;
  background: var(--bg-alt);
  border-left: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.35s ease;
  box-shadow: -10px 0 40px rgba(0, 0, 0, 0.4);
}

.cart-panel.open .cart-panel-inner {
  transform: translateX(0);
}

.cart-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.5rem;
  border-bottom: 1px solid var(--border);
}

.cart-header h2 {
  font-family: var(--font-display);
  font-size: 1.5rem;
}

.close-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.75rem;
  line-height: 1;
  cursor: pointer;
  padding: 0.25rem;
}

.close-btn:hover {
  color: var(--text);
}

.cart-items {
  list-style: none;
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
}

.cart-item {
  display: flex;
  gap: 1rem;
  padding: 1rem 0;
  border-bottom: 1px solid var(--border);
}

.cart-item img {
  width: 64px;
  height: 80px;
  object-fit: cover;
}

.cart-item-info {
  flex: 1;
}

.cart-item-info h4 {
  font-size: 0.95rem;
  margin-bottom: 0.25rem;
}

.cart-item-info .item-price {
  color: var(--accent);
  font-size: 0.9rem;
}

.cart-item-remove {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1.25rem;
  align-self: flex-start;
}

.cart-item-remove:hover {
  color: #c45a5a;
}

.cart-empty {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  padding: 2rem;
}

.cart-footer {
  padding: 1.5rem;
  border-top: 1px solid var(--border);
}

.cart-total {
  margin-bottom: 1rem;
  font-size: 1.1rem;
}

.cart-total strong {
  color: var(--accent);
}

/* Modals */
dialog {
  border: 1px solid var(--border);
  background: var(--bg-alt);
  color: var(--text);
  padding: 0;
  max-width: 90vw;
  box-shadow: var(--shadow);
}

dialog::backdrop {
  background: rgba(0, 0, 0, 0.75);
}

.product-modal {
  width: min(900px, 95vw);
  border-radius: 2px;
}

.product-modal .modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  z-index: 2;
}

.product-modal-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
}

@media (max-width: 700px) {
  .product-modal-content {
    grid-template-columns: 1fr;
  }
}

.product-modal-image img {
  width: 100%;
  height: 100%;
  min-height: 320px;
  object-fit: cover;
}

.product-modal-details {
  padding: 2rem;
}

.product-modal-details h2 {
  font-family: var(--font-display);
  font-size: 2rem;
  margin-bottom: 0.5rem;
}

.product-modal-details .price {
  color: var(--accent);
  font-size: 1.25rem;
  margin-bottom: 1.5rem;
}

.product-modal-details .story {
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.75;
  margin-bottom: 1.5rem;
}

.checkout-modal,
.subscription-modal {
  width: min(480px, 95vw);
  padding: 2rem;
  border-radius: 2px;
}

.checkout-modal h2,
.subscription-modal h2 {
  font-family: var(--font-display);
  font-size: 1.75rem;
  margin-bottom: 1rem;
}

.modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
}

/* Forms */
.checkout-form label,
.subscription-form label {
  display: block;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.checkout-form input,
.checkout-form textarea,
.subscription-form input {
  display: block;
  width: 100%;
  margin-top: 0.35rem;
  padding: 0.65rem 0.85rem;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  font-family: inherit;
  font-size: 0.95rem;
  border-radius: 2px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.payment-fieldset {
  border: 1px solid var(--border);
  padding: 1rem;
  margin-bottom: 1rem;
  border-radius: 2px;
}

.payment-fieldset legend {
  font-size: 0.85rem;
  color: var(--accent);
  padding: 0 0.5rem;
}

.payment-options {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.payment-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
}

.payment-option {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  background: var(--surface);
  border: 1px solid transparent;
  border-radius: 2px;
  cursor: pointer;
  font-size: 0.85rem;
  transition: border-color 0.2s;
}

.payment-option:has(input:checked) {
  border-color: var(--accent);
  background: rgba(196, 163, 90, 0.08);
}

.payment-option input {
  margin: 0;
}

.pay-icon {
  font-weight: 600;
  font-size: 0.75rem;
}

.pay-icon.visa {
  color: #1a1f71;
  background: #fff;
  padding: 2px 6px;
  border-radius: 2px;
}

.pay-icon.mc {
  color: #eb001b;
  font-weight: 700;
}

.card-fields {
  margin-bottom: 1rem;
}

/* Subscription modal */
.subscription-modal {
  text-align: center;
}

.sub-icon {
  font-size: 2rem;
  color: var(--accent);
  margin-bottom: 0.5rem;
}

.subscription-modal p {
  color: var(--text-muted);
  margin-bottom: 1rem;
  font-size: 0.95rem;
}

.sub-benefits {
  font-size: 0.8rem !important;
  color: var(--accent) !important;
  letter-spacing: 0.05em;
}

.subscription-form {
  text-align: left;
  margin-top: 1.5rem;
}

.sub-legal {
  font-size: 0.7rem !important;
  margin-top: 1rem !important;
  opacity: 0.6;
}

.browse-blocker {
  position: fixed;
  inset: 0;
  z-index: 150;
  background: transparent;
  pointer-events: all;
}

/* Success toast */
.toast {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: var(--surface);
  border: 1px solid var(--accent);
  color: var(--text);
  padding: 1rem 1.5rem;
  border-radius: 2px;
  z-index: 300;
  opacity: 0;
  transition: transform 0.4s, opacity 0.4s;
  font-size: 0.9rem;
}

.toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

@media (max-width: 600px) {
  .payment-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
