:root {
  --sidebar-w: 280px;
}

html,
body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  font-family: Roboto, system-ui, -apple-system, Segoe UI, Arial, sans-serif;
}

body {
  color: #fff;
  background: #222831;
}

#view-home {
  text-align: center;
}

.app {
  display: flex;
  height: 100%;
  position: relative;
}

.logo {
  text-align: center;
  margin: 40px 0;
}

.logo img {
  width: 60%;
  max-width: 400px;
}

.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  width: var(--sidebar-w);
  background: #222831;
  color: #fff;
  overflow-y: auto;
  transform: translateX(-100%);
  transition: transform .25s ease, box-shadow .25s ease;
  will-change: transform;
  z-index: 30;
}

.app.sidebar-open .sidebar {
  transform: translateX(0);
  box-shadow: 0 0 24px rgba(0,0,0,.35);
}

.backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.3);
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease;
  z-index: 20;
}

.app.sidebar-open .backdrop {
  opacity: 1;
  pointer-events: auto;
}

.menu-toggle {
  position: fixed;
  top: 24px;
  left: 24px;
  z-index: 11;
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 8px;
  background: #948979;
  color: #fff;
  font-size: 22px;
  line-height: 44px;
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(0,0,0,.25);
}
.app.sidebar-open .menu-toggle {
  background: #444;
}

.view-container {
  position: relative;
  flex: 1;
  overflow-x: hidden;
  z-index: 10;
}

.sidebar ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.sidebar li {
  padding: 14px 16px;
  cursor: pointer;
  user-select: none;
  transition: background .2s;
}

.sidebar li:hover,
.sidebar li.active {
  background: #6d6458;
}

.view {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  opacity: 0;
  transform: translateX(20px);
  transition: opacity .3s ease, transform .3s ease;
  pointer-events: none;
}

.view.active {
  opacity: 1;
  transform: translateX(0);
  pointer-events: all;
}

.product-options {
  display: flex;
  gap: 20px;
  margin: 20px 0;
}

.product-options label {
  display: block;
  margin-bottom: 4px;
}

.product-options select {
  padding: 6px;
}

.button {
  padding: 12px 20px;
  background: #28a745;
  color: #fff;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}

.product-detail {
  display: flex;
  justify-content: center;
  opacity: 0;
  transform: translateX(20px);
  transition: opacity .3s ease, transform .3s ease;
}

.product-detail.enter {
  opacity: 1;
  transform: translateX(0);
}

.product-detail.leave {
  opacity: 0;
  transform: translateX(-20px);
}

.product-page {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
}

.product-top {
  display: flex;
  flex-direction: column;
  gap: 40px;
  margin-bottom: 70px;
  background: linear-gradient(20deg, #6d6458 0%, #998d7a 90%);
  box-shadow: 0 1px 20px rgb(4 6 28 / 48%);
  border-radius: 5px;
  padding: 30px;
  max-width: 70%;
  height: fit-content;
}

.gallery {
  flex: 0 0 70%;
}

.gallery-main {
  width: 100%;
  border-radius: 8px;
  object-fit: cover;
}

.gallery-thumbs {
  display: flex;
  gap: 20px;
  margin-top: 12px;
  padding: 0;
}

.gallery-thumbs li {
  list-style: none;
  cursor: pointer;
}

.gallery-thumbs img {
  width: 100%;
  border-radius: 4px;
  transition: transform .2s;
}

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

.details {
  flex: 0 0 30%;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.title {
  font-size: 2rem;
  margin: 0;
}

.sku {
  font-size: 1.5rem;
}

.price {
  font-size: 1.8rem;
  font-weight: bold;
  margin: 8px 0;
}

.options {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 16px;
}

.option label {
  display: block;
  margin-bottom: 4px;
  font-weight: 600;
}

.options .option select {
  width: 100%;
  padding: 8px 32px 8px 0;
  color: #fff;
  background: transparent;
  border: none;
  border-bottom: 2px solid #fff;
  border-radius: 0;
  outline: none;
  cursor: pointer;

  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;

  background-image: url("data:image/svg+xml,%3Csvg width='16' height='16' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M6 9l6 6 6-6' stroke='%23fff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 6px center;
  background-size: 16px 16px;
}

.options .option select:focus,
.options .option select:hover {
  border-bottom-width: 3px;
}

.options .option select option {
  color: #222831;
}

@media (max-width: 900px) {
  .options {
    grid-template-columns: 1fr 1fr;
  }
}
@media (max-width: 600px) {
  .options {
    grid-template-columns: 1fr;
  }
}

.btn {
  padding: 14px;
  font-size: 1rem;
  border: none;
  border-radius: 6px;
  cursor: pointer;
}

.btn.preorder {
  background-color: #fff;
  color: #51392d;
  margin-top: 8px;
  transition: background .2s;
}

.btn.preorder:hover {
  background-color: #eee;
}

.description h2,
.specs h2 {
  margin-bottom: 12px;
  font-size: 2.4rem;
  border-bottom: 2px solid #eee;
  padding-bottom: 4px;
}

.description p,
.specs ul {
  font-size: 1.4rem;
  line-height: 1.6;
}

.video-embed {
  position: relative;
  width: 100%;
  margin: 24px auto;
  aspect-ratio: 16 / 9;
  background: #111;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 1px 20px rgba(4,6,28,.48);
}

.video-embed iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

/* --- Checkout Popup (modal) --- */
.co-backdrop{
  position:fixed; inset:0; background:rgba(0,0,0,.5); backdrop-filter:saturate(80%) blur(2px);
}
.co-modal{
  position:fixed; inset:0; display:grid; place-items:center;
}
.co-modal > * { box-sizing:border-box; }
.co-modal[hidden], .co-backdrop[hidden]{ display:none; }

#checkout-modal{
  align-content:start;
}
#checkout-modal .co-card{
  background:#111827;
}
#checkout-modal{
  padding: 24px;
  max-width: 420px;
  width: calc(100% - 32px);
  max-height: fit-content;
  margin: auto;
  background: #111417;
  border: 1px solid #1f2937;
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, .4);
  z-index: 111;
}

.co-close{
  position:absolute; right:14px; top:10px;
  background:transparent; border:none; color:#9ca3af;
  font-size:22px; cursor:pointer;
}

#co-title{ margin-top:0; margin-bottom:12px; }
#co-form,#co-summary{ width: 100% }

.co-summary{ font-size:14px; color:#cbd5e1; background:#0d1117; border:1px solid #1f2937;
  border-radius:12px; padding:10px 12px; margin-bottom:12px; }
.co-summary > div{ margin:4px 0; }

.co-label{ display:block; font-size:12px; color:#9ca3af; margin:8px 0 6px; }
.co-input{
  width:calc(100% - 20px); padding:10px 12px; border-radius:10px;
  border:1px solid #384152; background:#0d1117; color:#e6edf3;
}
.co-btn{
  margin-top:14px; width:100%; padding:11px 14px; border-radius:10px; border:0;
  background:#2563eb; color:#fff; cursor:pointer; font-weight:600;
}
.co-btn:disabled{ opacity:.6; cursor:not-allowed; }
.co-hint{ font-size:12px; color:#9ca3af; margin-top:8px; white-space:pre-wrap; }
