/*
  File: style.css
  Author: Max Maehara
  Last Edited: 2026-05-15
*/

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

body {
  font-family: "EB Garamond", serif;
  background: #fff;
  color: #111;
}

/* NAVBAR */

.navbar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 24px 60px;
  border-bottom: 1px solid #eee;
}

.logo {
  justify-self: start;
  font-size: 25px;
  font-weight: 500;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  white-space: nowrap;
}

.nav-center {
  justify-self: center;
  display: grid;
  grid-template-columns: 32px 32px auto 32px 32px;
  align-items: center;
  gap: 18px;
}

.nav-deco {
  width: 32px;
  height: 32px;
  object-fit: contain;
  display: block;
  pointer-events: none;
}

.nav-links {
  display: flex;
  gap: 42px;
  list-style: none;
  min-width: 230px;
  justify-content: center;
}

.nav-links li {
  font-size: 16px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
}

.nav-links li:hover,
.nav-links li.active {
  opacity: 0.5;
}

.cart {
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 8px;
  border: none;
  background: transparent;
  font-family: "EB Garamond", serif;
  font-size: 16px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
}

.cart img {
  width: 32px;
  height: 32px;
  object-fit: contain;
}

#cart-count {
  font-size: 18px;
  font-weight: 500;
}

/* HEADER */

.header {
  padding: 45px 60px 25px;
  text-align: center;
}

.category-title-wrap {
  display: grid;
  grid-template-columns: 65px 65px 260px 65px 65px;
  justify-content: center;
  align-items: center;
  gap: 18px;
}

.title-deco {
  width: 65px;
  height: 65px;
  object-fit: contain;
  display: block;
}

.header h1 {
  font-size: 38px;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-align: center;
  margin: 0;
}

/* PRODUCT GRID */

.product-grid {
  padding: 0 60px 60px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
}

/* CART */

.cart-wrapper {
  position: relative;
  justify-self: end;
}

.cart {
  display: flex;
  align-items: center;
  gap: 8px;

  border: none;
  background: transparent;

  border-radius: 12px;
  padding: 8px 10px;

  font-family: "EB Garamond", serif;
  cursor: pointer;

  transition:
    background 0.2s ease,
    transform 0.15s ease;
}

.cart:hover {
  background: #f7f7f7;
}

.cart:active {
  transform: scale(0.97);
}

.cart img {
  width: 32px;
  height: 32px;
  object-fit: contain;
}

#cart-count {
  font-size: 18px;
  font-weight: 500;
}

.cart-dropdown {
  display: none;
  position: absolute;
  right: 0;
  top: 52px;

  width: 360px;

  background: white;
  border: 1px solid #f0f0f0;
  border-radius: 18px;

  padding: 20px;

  z-index: 100;

  box-shadow:
    0 10px 40px rgba(0, 0, 0, 0.08),
    0 2px 8px rgba(0, 0, 0, 0.04);

  animation: cartFade 0.18s ease;
}

.cart-dropdown.show {
  display: block;
}

@keyframes cartFade {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.cart-dropdown h3 {
  font-size: 22px;
  font-weight: 500;
  margin-bottom: 14px;
}

.cart-item {
  display: flex;
  justify-content: space-between;
  gap: 12px;

  padding: 14px 0;

  border-bottom: 1px solid #f3f3f3;
}

.cart-item-info p {
  font-size: 15px;
  font-weight: 500;
  margin-bottom: 4px;
}

.cart-item-info span {
  display: block;
  color: #777;
  font-size: 14px;
  margin-top: 2px;
}

.cart-controls {
  display: flex;
  align-items: center;
  gap: 6px;
}

.cart-controls button {
  border: none;

  min-width: 32px;
  height: 32px;

  border-radius: 10px;

  background: #f6f6f6;

  font-family: inherit;
  font-size: 14px;

  cursor: pointer;

  transition:
    background 0.2s ease,
    transform 0.15s ease;
}

.cart-controls button:hover {
  background: #ececec;
}

.cart-controls button:active {
  transform: scale(0.95);
}

.cart-controls button:last-child {
  padding: 0 10px;
  min-width: auto;
}

.empty-cart {
  color: #777;
  padding: 12px 0;
  font-size: 15px;
}

.cart-subtotal {
  display: flex;
  justify-content: space-between;

  margin-top: 18px;
  padding-top: 18px;

  border-top: 1px solid #f0f0f0;

  font-size: 16px;
}

.checkout-btn {
  width: 100%;

  margin-top: 18px;
  padding: 14px;

  border: none;
  border-radius: 14px;

  background: #111;
  color: white;

  font-family: inherit;
  font-size: 15px;
  font-weight: 500;

  letter-spacing: 0.05em;
  text-transform: uppercase;

  cursor: pointer;

  transition:
    transform 0.15s ease,
    opacity 0.2s ease;
}

.checkout-btn:hover {
  opacity: 0.9;
}

.checkout-btn:active {
  transform: scale(0.98);
}

/* PRODUCT CARD */

.product-card {
  cursor: pointer;
}

.image-box {
  width: 100%;
  aspect-ratio: 1 / 1;
  overflow: hidden;
}

.image-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.product-card:hover img {
  transform: scale(1.05);
}

.tag {
  margin-top: 18px;
  font-size: 14px;
  color: #9c6b4f;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.product-card h2 {
  font-size: 20px;
  font-weight: 500;
  margin: 6px 0;
}

.price,
.stock {
  font-size: 16px;
  margin-bottom: 6px;
}

.description {
  color: #666;
  font-size: 15px;
  line-height: 1.45;
  margin: 8px 0 12px;
}

.option-select {
  width: 100%;
  padding: 10px;
  margin: 8px 0 10px;
  border: 1px solid #ccc;
  background: white;
  font-family: inherit;
  font-size: 15px;
}

.add-btn,
.admin-btn {
  margin-top: 8px;
  padding: 11px 16px;
  border: 1px solid #111;
  background: #111;
  color: white;
  font-family: inherit;
  font-size: 15px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  cursor: pointer;
}

.add-btn:hover,
.admin-btn:hover {
  background: white;
  color: #111;
}

.option-label {
  display: block;
  margin-top: 10px;
  margin-bottom: 6px;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #555;
}

.single-option {
  margin-top: 10px;
  margin-bottom: 6px;

  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.03em;

  color: #555;
}

/* ADMIN PAGE */

.admin-page {
  min-height: 100vh;
  padding: 40px;
  background: #faf9f7;
}

.admin-page h1 {
  font-size: 36px;
  font-weight: 500;
  margin-bottom: 20px;
}

.admin-page h2 {
  font-size: 28px;
  font-weight: 500;
  margin: 30px 0 15px;
}

#login-box {
  min-height: 75vh;
  display: flex;
  justify-content: center;
  align-items: center;
}

.admin-login {
  width: 380px;
  display: grid;
  gap: 12px;

  padding: 28px;

  background: white;
  border: 1px solid #ececec;
  border-radius: 18px;

  box-shadow: 0 10px 35px rgba(0,0,0,0.06);
}

.admin-login input {
  width: 100%;

  padding: 12px;

  border: 1px solid #d9d9d9;
  border-radius: 10px;

  font-family: inherit;
  font-size: 15px;
}

#admin-content {
  max-width: 1400px;
  margin: 0 auto;
}

.admin-btn {
  padding: 10px 14px;

  border: 1px solid #111;
  border-radius: 12px;

  background: #111;
  color: white;

  font-family: inherit;
  font-size: 14px;

  cursor: pointer;

  transition:
    opacity 0.2s ease,
    transform 0.15s ease;
}

.admin-btn:hover {
  opacity: 0.9;
}

.admin-btn:active {
  transform: scale(0.98);
}

.remove-product-btn {
  background: white;
  color: #a52a2a;
  border: 1px solid #e0b8b8;
}

.remove-product-btn:hover {
  background: #fff4f4;
}

.order-card {
  background: white;

  border: 1px solid #ececec;
  border-radius: 16px;

  padding: 20px;
  margin-bottom: 18px;

  box-shadow: 0 6px 20px rgba(0,0,0,0.04);
}

.order-card h3 {
  margin-bottom: 10px;
}

.order-card p {
  margin-bottom: 6px;
}

.order-card ul {
  margin-left: 20px;
}

.order-card pre {
  background: #f7f7f7;
  border-radius: 10px;
  padding: 12px;
  overflow-x: auto;
  margin-top: 10px;
}

.product-editor-card {
  background: white;

  border: 1px solid #ececec;
  border-radius: 18px;

  padding: 20px;
  margin-bottom: 20px;

  display: grid;
  gap: 10px;

  box-shadow: 0 6px 20px rgba(0,0,0,0.04);
}

.product-editor-card h3 {
  margin-bottom: 5px;
}

.product-editor-card h4 {
  margin-top: 10px;
}

.product-editor-card input,
.product-editor-card textarea {
  width: 100%;

  padding: 10px;

  border: 1px solid #d8d8d8;
  border-radius: 10px;

  font-family: inherit;
  font-size: 15px;
}

.product-editor-card textarea {
  min-height: 90px;
  resize: vertical;
}

.option-editor-card {
  background: #fcfcfc;

  border: 1px solid #ececec;
  border-radius: 14px;

  padding: 14px;
  margin-top: 10px;

  display: grid;
  grid-template-columns:
    100px
    1fr
    130px
    180px
    auto;

  gap: 12px;
  align-items: center;
}

.option-editor-card h4 {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
}

.option-editor-card label {
  display: none;
}

.option-editor-card input {
  width: 100%;

  padding: 8px 10px;

  border: 1px solid #d9d9d9;
  border-radius: 8px;

  font-family: inherit;
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.checkbox-row input {
  width: auto;
}

.stock-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.stock-btn {
  width: 34px;
  height: 34px;

  border: none;
  border-radius: 10px;

  background: #efefef;

  font-size: 18px;
  cursor: pointer;

  transition: background 0.2s ease;
}

.stock-btn:hover {
  background: #e3e3e3;
}

.stock-row span {
  min-width: 24px;
  text-align: center;
  font-weight: 600;
}

.stock-status {
  font-size: 12px;

  padding: 5px 8px;

  border-radius: 999px;
}

.stock-status.in {
  background: #edf9ee;
  color: #2f7a3d;
}

.stock-status.out {
  background: #fff0f0;
  color: #b42318;
}

@media (max-width: 1000px) {

  .option-editor-card {
    grid-template-columns: 1fr;
  }

  .option-editor-card label {
    display: block;
  }

  .admin-page {
    padding: 20px;
  }
}

/* RESPONSIVE */

@media (max-width: 900px) {
  .navbar {
    grid-template-columns: 1fr;
    gap: 16px;
    padding: 22px 30px;
  }

  .logo,
  .nav-center,
  .cart {
    justify-self: center;
  }

  .logo {
    font-size: 28px;
    text-align: center;
  }

  .nav-center {
    grid-template-columns: 26px 26px auto 26px 26px;
    gap: 12px;
  }

  .nav-deco {
    width: 26px;
    height: 26px;
  }

  .product-grid {
    grid-template-columns: repeat(2, 1fr);
    padding: 0 30px 40px;
  }

  .header {
    padding: 35px 30px 20px;
  }
}

@media (max-width: 600px) {
  .logo {
    font-size: 24px;
    letter-spacing: 0.12em;
  }

  .nav-center {
    grid-template-columns: 22px 22px auto 22px 22px;
    gap: 8px;
  }

  .nav-deco {
    width: 22px;
    height: 22px;
  }

  .nav-links {
    gap: 20px;
    min-width: 190px;
    justify-content: center;
  }

  .product-grid {
    grid-template-columns: 1fr;
  }

  .admin-login {
    flex-direction: column;
  }

  .admin-page {
    padding: 30px 20px;
  }
}

/* FOOTER */

.site-footer {
  border-top: 1px solid #eee;
  padding: 32px 60px;
  text-align: center;
  color: #555;
  font-size: 15px;
  background: #faf9f7;
}

.footer-links {
  margin: 10px 0;
  display: flex;
  justify-content: center;
  gap: 22px;
}

.footer-links a {
  color: #111;
  text-decoration: none;
  font-size: 15px;
}

.footer-links a:hover {
  opacity: 0.55;
}

.footer-small {
  font-size: 13px;
  color: #777;
}

@media (max-width: 600px) {
  .site-footer {
    padding: 28px 24px;
  }

  .footer-links {
    flex-direction: column;
    gap: 8px;
  }
}