/* ===== 基礎重置 ===== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* ===== 品牌色彩變數 ===== */
:root {
  --black: #111111;
  --white: #ffffff;
  --red: #E63030;
  --blue: #3B9BF5;
}

body {
  background-color: var(--black);
  color: var(--white);
  font-family: sans-serif;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ===== 導覽列 ===== */
nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 24px 48px;
}

.logo {
  font-size: 20px;
  font-weight: 900;
  letter-spacing: 2px;
  color: var(--white);
  text-decoration: none;
}

.logo span.red { color: var(--red); }
.logo span.blue { color: var(--blue); }

nav ul {
  list-style: none;
  display: flex;
  gap: 32px;
}

nav ul a {
  color: var(--white);
  text-decoration: none;
  font-size: 14px;
  letter-spacing: 1px;
  opacity: 0.85;
  transition: opacity 0.2s;
}

nav ul a:hover,
nav ul a.active {
  opacity: 1;
}

nav ul a.active {
  border-bottom: 1px solid var(--white);
  padding-bottom: 2px;
}

.cart-icon {
  color: var(--white);
  text-decoration: none;
  font-size: 14px;
  letter-spacing: 1px;
  opacity: 0.85;
  transition: opacity 0.2s;
  display: flex;
  align-items: center;
  gap: 6px;
}

.cart-icon:hover {
  opacity: 1;
}

#cart-count {
  font-size: 12px;
  letter-spacing: 0;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 24px;
}

.auth-nav {
  display: flex;
  align-items: center;
  gap: 12px;
}

.auth-btn {
  background: transparent;
  border: none;
  color: var(--white);
  font-size: 14px;
  letter-spacing: 1px;
  opacity: 0.85;
  cursor: pointer;
  font-family: inherit;
  transition: opacity 0.2s;
  padding: 0;
}

.auth-btn:hover {
  opacity: 1;
}

.auth-user {
  font-size: 14px;
  letter-spacing: 1px;
  opacity: 0.85;
  color: var(--white);
  text-decoration: none;
  transition: opacity 0.2s;
}

.auth-user:hover {
  opacity: 1;
}

.product-card-wrap {
  display: flex;
  flex-direction: column;
  border: 1px solid rgba(255, 255, 255, 0.15);
  transition: border-color 0.3s, background 0.3s;
}

.product-card-wrap:hover {
  border-color: rgba(255, 255, 255, 0.4);
  background: rgba(255, 255, 255, 0.03);
}

.product-card-wrap .product-card {
  border: none;
  flex: 1;
}

.product-card-wrap .product-card:hover {
  border: none;
  background: transparent;
}

.add-to-cart-btn {
  margin: 0 16px 16px;
  padding: 12px 16px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  background: transparent;
  color: var(--white);
  font-size: 12px;
  letter-spacing: 2px;
  cursor: pointer;
  transition: all 0.3s;
}

.add-to-cart-btn:hover {
  background: var(--white);
  color: var(--black);
}

/* ===== 選項 Modal ===== */
.option-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 1000;
}

.option-modal-overlay[hidden] {
  display: none;
}

.option-modal {
  background: var(--black);
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 32px;
  max-width: 420px;
  width: 100%;
}

.option-modal h3 {
  font-size: 18px;
  font-weight: 900;
  letter-spacing: 3px;
  margin-bottom: 24px;
  text-align: center;
}

.option-group {
  margin-bottom: 24px;
}

.option-group-label {
  font-size: 12px;
  letter-spacing: 2px;
  opacity: 0.6;
  margin-bottom: 12px;
}

.option-choices {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.option-choice-btn {
  padding: 8px 16px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  background: transparent;
  color: var(--white);
  font-size: 12px;
  letter-spacing: 1px;
  cursor: pointer;
  transition: all 0.2s;
}

.option-choice-btn:hover {
  border-color: var(--white);
}

.option-choice-btn.selected {
  background: var(--white);
  color: var(--black);
  border-color: var(--white);
}

.option-modal-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-top: 8px;
}

.option-modal-cancel,
.option-modal-confirm {
  padding: 12px 24px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  background: transparent;
  color: var(--white);
  font-size: 12px;
  letter-spacing: 2px;
  cursor: pointer;
  transition: all 0.2s;
}

.option-modal-confirm:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.option-modal-cancel:hover,
.option-modal-confirm:not(:disabled):hover {
  background: var(--white);
  color: var(--black);
}

/* ===== Hero 區（首頁）===== */
.hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 90vh;
  text-align: center;
  padding: 48px;
}

.hero-title {
  font-size: 72px;
  font-weight: 900;
  letter-spacing: 4px;
  line-height: 1.1;
}

.hero-title span.red { color: var(--red); }
.hero-title span.blue { color: var(--blue); }

.hero-sub {
  font-size: 18px;
  letter-spacing: 3px;
  margin-top: 16px;
  opacity: 0.7;
}

.hero-slogan {
  font-size: 14px;
  letter-spacing: 2px;
  margin-top: 48px;
  opacity: 0.5;
}

.hero-btn {
  margin-top: 48px;
  padding: 16px 48px;
  border: 2px solid var(--white);
  color: var(--white);
  text-decoration: none;
  font-size: 14px;
  letter-spacing: 3px;
  transition: all 0.3s;
}

.hero-btn:hover {
  background: var(--white);
  color: var(--black);
}

/* ===== 內頁標題區 ===== */
.page-hero {
  text-align: center;
  padding: 80px 48px 48px;
}

.page-hero h1 {
  font-size: 48px;
  font-weight: 900;
  letter-spacing: 4px;
}

.page-hero p {
  font-size: 16px;
  letter-spacing: 2px;
  margin-top: 16px;
  opacity: 0.6;
}

.breadcrumb {
  font-size: 12px;
  letter-spacing: 1px;
  opacity: 0.4;
  margin-bottom: 24px;
}

.breadcrumb a {
  color: var(--white);
  text-decoration: none;
}

.breadcrumb a:hover {
  opacity: 0.8;
}

/* ===== 區塊通用 ===== */
main {
  flex: 1;
}

.section {
  padding: 48px 48px 96px;
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
}

.section-title {
  font-size: 32px;
  font-weight: 900;
  letter-spacing: 4px;
  margin-bottom: 48px;
  text-align: center;
}

.section-text {
  font-size: 16px;
  line-height: 1.8;
  letter-spacing: 1px;
  opacity: 0.75;
  max-width: 640px;
  margin: 0 auto;
  text-align: center;
}

/* ===== 產品網格 ===== */
.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 32px;
}

.product-card {
  aspect-ratio: 1;
  border: 1px solid rgba(255, 255, 255, 0.15);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  color: var(--white);
  transition: border-color 0.3s, background 0.3s;
  padding: 24px;
}

.product-card:hover {
  border-color: rgba(255, 255, 255, 0.4);
  background: rgba(255, 255, 255, 0.03);
}

.product-card h3 {
  font-size: 20px;
  font-weight: 900;
  letter-spacing: 3px;
}

.product-card p {
  font-size: 12px;
  letter-spacing: 2px;
  margin-top: 12px;
  opacity: 0.5;
}

.product-placeholder {
  aspect-ratio: 1;
  border: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.3;
  font-size: 12px;
  letter-spacing: 2px;
}

/* ===== 產品骨架屏 ===== */
.product-skeleton-wrap {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.product-skeleton-card {
  aspect-ratio: 1;
  border: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
  gap: 16px;
}

.product-skeleton-block,
.product-skeleton-line,
.product-skeleton-btn {
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0.06) 0%,
    rgba(255, 255, 255, 0.14) 50%,
    rgba(255, 255, 255, 0.06) 100%
  );
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.4s ease-in-out infinite;
  border-radius: 2px;
}

.product-skeleton-image {
  width: 55%;
  height: 42%;
  max-height: 120px;
}

.product-skeleton-line {
  height: 14px;
  width: 60%;
}

.product-skeleton-line--title {
  height: 18px;
  width: 45%;
}

.product-skeleton-line--short {
  width: 35%;
  height: 10px;
}

.product-skeleton-btn {
  height: 40px;
  width: 100%;
  animation-delay: 0.15s;
}

@keyframes skeleton-shimmer {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

/* ===== 聯絡表單 ===== */
.contact-form {
  max-width: 480px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.contact-form label {
  font-size: 12px;
  letter-spacing: 2px;
  opacity: 0.6;
}

.contact-form input,
.contact-form textarea {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: var(--white);
  padding: 12px 16px;
  font-size: 14px;
  font-family: inherit;
}

.contact-form textarea {
  min-height: 120px;
  resize: vertical;
}

.contact-form button {
  padding: 16px 48px;
  border: 2px solid var(--white);
  background: transparent;
  color: var(--white);
  font-size: 14px;
  letter-spacing: 3px;
  cursor: pointer;
  transition: all 0.3s;
  margin-top: 8px;
}

.contact-form button:hover {
  background: var(--white);
  color: var(--black);
}

.contact-form button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.contact-form button:disabled:hover {
  background: transparent;
  color: var(--white);
}

.contact-status {
  text-align: center;
  font-size: 14px;
  letter-spacing: 1px;
  min-height: 1.5em;
}

.contact-status.success {
  opacity: 0.85;
}

.contact-status.error {
  color: var(--red);
  opacity: 0.9;
}

/* ===== 購物車頁 ===== */
.cart-items {
  display: flex;
  flex-direction: column;
  gap: 24px;
  max-width: 800px;
  margin: 0 auto;
}

.cart-item {
  display: grid;
  grid-template-columns: 1fr auto auto auto auto;
  gap: 24px;
  align-items: center;
  padding: 24px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 14px;
  letter-spacing: 1px;
}

.cart-item-name {
  font-weight: 700;
}

.cart-item-qty {
  display: flex;
  align-items: center;
  gap: 12px;
}

.cart-item-qty button {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: var(--white);
  width: 28px;
  height: 28px;
  cursor: pointer;
  font-size: 14px;
}

.cart-item-qty button:hover {
  border-color: var(--white);
}

.cart-item-remove {
  background: transparent;
  border: none;
  color: var(--red);
  cursor: pointer;
  font-size: 12px;
  letter-spacing: 1px;
  opacity: 0.8;
}

.cart-item-remove:hover {
  opacity: 1;
}

.cart-empty {
  text-align: center;
  opacity: 0.5;
  font-size: 14px;
  letter-spacing: 2px;
  padding: 48px 0;
}

.cart-summary {
  max-width: 800px;
  margin: 48px auto 0;
  text-align: right;
}

.cart-total {
  font-size: 20px;
  font-weight: 900;
  letter-spacing: 2px;
  margin-bottom: 24px;
}

.cart-summary .hero-btn {
  display: inline-block;
  cursor: pointer;
  background: transparent;
}

.cart-summary .hero-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* ===== 結帳頁 ===== */
.checkout-section {
  max-width: 1000px;
  margin: 0 auto;
}

.checkout-loading {
  text-align: center;
  font-size: 14px;
  letter-spacing: 2px;
  opacity: 0.5;
  padding: 48px 0;
}

.checkout-success-section {
  max-width: 640px;
  margin: 0 auto;
  text-align: center;
  padding: 24px 0 64px;
}

.checkout-success-text {
  font-size: 14px;
  letter-spacing: 2px;
  line-height: 2;
  opacity: 0.85;
  margin-bottom: 40px;
}

.checkout-success-btn {
  display: inline-block;
  text-decoration: none;
}

.checkout-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 64px;
  align-items: start;
}

.checkout-heading {
  font-size: 14px;
  font-weight: 900;
  letter-spacing: 3px;
  margin-bottom: 24px;
  opacity: 0.85;
}

.checkout-order {
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 32px;
}

.checkout-items {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-bottom: 32px;
}

.checkout-item {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 14px;
  letter-spacing: 1px;
}

.checkout-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.checkout-item-name {
  font-weight: 700;
  margin-bottom: 6px;
}

.checkout-item-options {
  font-size: 12px;
  opacity: 0.55;
  letter-spacing: 1px;
}

.checkout-item-price {
  flex-shrink: 0;
  font-weight: 700;
}

.checkout-total {
  font-size: 20px;
  font-weight: 900;
  letter-spacing: 2px;
  text-align: right;
  padding-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.15);
}

.checkout-form {
  max-width: none;
  margin: 0;
}

.checkout-fieldset {
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 20px;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.checkout-fieldset legend {
  font-size: 12px;
  letter-spacing: 2px;
  opacity: 0.6;
  padding: 0 8px;
  margin-bottom: 4px;
}

.checkout-radio {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  letter-spacing: 1px;
  cursor: pointer;
}

.checkout-radio input {
  accent-color: var(--white);
  width: 16px;
  height: 16px;
}

.checkout-status {
  text-align: center;
  font-size: 14px;
  letter-spacing: 1px;
  min-height: 1.5em;
}

.checkout-status.success {
  opacity: 0.85;
}

.checkout-status.error {
  color: var(--red);
  opacity: 0.9;
}

.checkout-submit {
  width: 100%;
}

@media (max-width: 768px) {
  .checkout-layout {
    grid-template-columns: 1fr;
    gap: 48px;
  }

  .checkout-order {
    padding: 24px;
  }
}

/* ===== 會員頁 ===== */
.account-section {
  max-width: 640px;
}

.account-profile {
  text-align: center;
  padding: 32px 0 48px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.account-avatar {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid rgba(255, 255, 255, 0.2);
  margin-bottom: 20px;
}

.account-avatar-placeholder {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  font-weight: 900;
  margin: 0 auto 20px;
  opacity: 0.6;
}

.account-name {
  font-size: 24px;
  font-weight: 900;
  letter-spacing: 2px;
  margin-bottom: 8px;
}

.account-email {
  font-size: 14px;
  letter-spacing: 1px;
  opacity: 0.6;
}

.account-orders {
  padding: 48px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.account-block-title {
  font-size: 16px;
  font-weight: 900;
  letter-spacing: 3px;
  margin-bottom: 24px;
  text-align: center;
}

.account-empty {
  text-align: center;
  font-size: 14px;
  letter-spacing: 2px;
  opacity: 0.5;
}

.account-orders-error {
  text-align: center;
  font-size: 14px;
  letter-spacing: 1px;
  color: var(--red);
  opacity: 0.9;
}

.account-orders-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.account-order-item {
  border: 1px solid rgba(255, 255, 255, 0.12);
  padding: 20px 24px;
}

.account-order-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  font-size: 14px;
  letter-spacing: 1px;
  padding: 6px 0;
}

.account-order-label {
  opacity: 0.5;
  flex-shrink: 0;
}

.account-order-value {
  text-align: right;
  font-weight: 700;
}

.account-order-status {
  text-transform: capitalize;
}

.account-logout-btn {
  display: block;
  margin: 48px auto 0;
  cursor: pointer;
  background: transparent;
  text-align: center;
}

/* ===== 管理後台 ===== */
.admin-section {
  max-width: 800px;
}

.admin-section-wide {
  max-width: 1100px;
}

.admin-tabs {
  display: flex;
  justify-content: center;
  align-items: stretch;
  gap: 16px;
  width: 100%;
  max-width: 480px;
  margin: 0 auto 48px;
  padding: 0 24px;
}

.admin-tab {
  flex: 1 1 0;
  min-width: 0;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.35);
  color: var(--white);
  font-family: inherit;
  font-size: 14px;
  letter-spacing: 3px;
  padding: 14px 12px;
  cursor: pointer;
  text-align: center;
  white-space: nowrap;
  opacity: 0.75;
  transition: background 0.3s, color 0.3s, border-color 0.3s, opacity 0.3s;
}

.admin-tab:hover {
  opacity: 1;
  border-color: var(--white);
}

.admin-tab.is-active {
  background: var(--white);
  color: var(--black);
  border-color: var(--white);
  opacity: 1;
}

.admin-tab:focus-visible {
  outline: 1px solid var(--white);
  outline-offset: 2px;
}

.admin-tab-panel[hidden] {
  display: none;
}

.admin-tab-hint {
  font-size: 13px;
  letter-spacing: 1px;
  opacity: 0.55;
  margin: -8px 0 24px;
}

.admin-table-wrap {
  overflow-x: auto;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  letter-spacing: 1px;
}

.admin-table th,
.admin-table td {
  padding: 12px 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  text-align: left;
  vertical-align: middle;
}

.admin-table th {
  font-size: 11px;
  letter-spacing: 2px;
  opacity: 0.55;
  white-space: nowrap;
}

.admin-stock-input,
.admin-status-select {
  background-color: var(--black);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: var(--white);
  font-family: inherit;
  font-size: 13px;
  padding: 6px 10px;
  min-width: 100px;
  cursor: pointer;
}

.admin-status-select {
  color-scheme: dark;
  appearance: auto;
}

.admin-status-select option {
  background-color: var(--black);
  color: var(--white);
}

.admin-stock-input.is-success,
.admin-status-select.is-success {
  border-color: rgba(120, 200, 120, 0.6);
}

.admin-stock-input.is-error,
.admin-status-select.is-error {
  border-color: var(--red);
}

.admin-denied .hero-btn {
  display: block;
  margin: 32px auto 0;
  text-align: center;
}

.admin-denied-email {
  opacity: 0.6;
}

.admin-product-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.admin-product-item {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  padding: 16px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.admin-product-thumb {
  width: 72px;
  height: 72px;
  object-fit: cover;
  border: 1px solid rgba(255, 255, 255, 0.15);
  flex-shrink: 0;
}

.admin-product-info h3 {
  font-size: 16px;
  font-weight: 900;
  letter-spacing: 2px;
  margin-bottom: 6px;
}

.admin-product-info p {
  font-size: 13px;
  letter-spacing: 1px;
  opacity: 0.75;
}

.admin-product-desc {
  margin-top: 6px;
  opacity: 0.55 !important;
}

.admin-form {
  max-width: 480px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.admin-form label {
  display: block;
  font-size: 12px;
  letter-spacing: 2px;
  opacity: 0.6;
  margin-bottom: 8px;
}

.admin-form input,
.admin-form textarea {
  width: 100%;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: var(--white);
  padding: 12px 16px;
  font-size: 14px;
  font-family: inherit;
}

.admin-form textarea {
  resize: vertical;
}

.admin-form-status {
  text-align: center;
  font-size: 14px;
  letter-spacing: 1px;
  min-height: 1.5em;
}

.admin-form-status.success {
  opacity: 0.85;
}

.admin-form-status.error {
  color: var(--red);
}

.admin-submit-btn {
  display: block;
  margin: 0 auto;
  cursor: pointer;
  background: transparent;
}

/* ===== 頁尾 ===== */
footer {
  padding: 32px 48px;
  text-align: center;
  font-size: 12px;
  letter-spacing: 2px;
  opacity: 0.3;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

footer p + p {
  margin-top: 12px;
}

.footer-contact a {
  color: inherit;
  text-decoration: none;
}

.footer-contact a:hover {
  opacity: 1;
}

@media (max-width: 768px) {
  nav {
    flex-direction: column;
    gap: 20px;
    padding: 20px 24px;
  }

  nav ul {
    gap: 20px;
    flex-wrap: wrap;
    justify-content: center;
  }

  .nav-actions {
    gap: 16px;
  }

  .auth-nav {
    gap: 8px;
  }

  .hero-title {
    font-size: 48px;
  }

  .page-hero h1 {
    font-size: 32px;
  }

  .admin-tabs {
    max-width: 100%;
    gap: 12px;
    padding: 0 16px;
    margin-bottom: 32px;
  }

  .admin-tab {
    font-size: 13px;
    letter-spacing: 2px;
    padding: 12px 8px;
  }

  .section {
    padding: 32px 24px 64px;
  }

  .cart-item {
    grid-template-columns: 1fr;
    gap: 12px;
    text-align: center;
  }

  .cart-item-qty {
    justify-content: center;
  }
}
