/* =========================
   RESET & GLOBAL
========================= */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* ===========================================
   FONTS

   font-family: "Roboto Mono", monospace;
   font-family: "Josefin Sans", sans-serif;
   font-family: "Outfit", sans-serif;

 ==============================================*/

/* fonts.css */
@import url("https://fonts.googleapis.com/css2?family=Josefin+Sans:ital,wght@0,100..700;1,100..700&family=Outfit:wght@100..900&family=Roboto+Mono:ital,wght@0,100..700;1,100..700&display=swap");


/* =========================
   LAYOUT
========================= */

body,
html {
  height: 100%;
  font-family: "Outfit", sans-serif;
}

.container {
  display: flex;
  height: 100vh;
}

/* =========================
   SIDEBAR
========================= */

.logo {
  padding: 20px;
  text-align: center;
}

.logo img {
  max-width: 100%;
  height: auto;
}

.sidebar {
  width: 265px;
  background-color: #0d0e0f;
  display: flex;
  flex-direction: column;
  align-items: stretch;
}

/* MENU STACK */
.menu {
  display: flex;
  flex-direction: column;
  gap: 24px;
  width: 100%;
}

/* WRAPPER (owns the back layer) */
.menu-item {
  position: relative;
  width: 100%;
  border: none;
  background: none;
  cursor: pointer;
  display: flex;
  justify-content: flex-end;
}

/* FRONT BUTTON */
.menu a {
  display: inline-block;
  position: relative;
  z-index: 1;
  background-color: transparent;
  padding: 5px 5px;
  margin-right: 39px;
  text-align: center;
  box-sizing: border-box;
  font-family: Roboto Mono;
  color: rgb(209, 206, 225);
  text-decoration: none;
  font-size: 30px;
  font-weight: 100;
  letter-spacing: 2px;
}

.menu a:hover {
  background-color: #eaeaea;
  color: rgb(31, 31, 31);
}

/* =========================
   MAIN CONTENT
========================= */
.content {
  flex-grow: 1;
  overflow-y: auto;
  padding: 0;
  --stripe-color-a: #aba6c2;
  --stripe-color-b: #0d0e0f;
  --gap: 15px;
  background: repeating-linear-gradient(4deg, var(--stripe-color-a) 0 1px, var(--stripe-color-b) 1px calc(var(--gap) + 1px));
  display: flex;
  justify-content: flex-start;
  scroll-behavior: smooth;
}

.product-list {
  display: flex;
  flex-direction: column;
}

/* =========================
   ITEM ROW
========================= */
.product {
  display: flex;
  width: 100%;
  max-width: 1200px;
}

/* =========================
   IMAGE PANEL
========================= */

/* Image container */
.product-image {
  position: relative;
  width: 600px;
  height: 600px;
  overflow: hidden;
}

/* Color overlay */
.bg-overlay {
  position: absolute;
  inset: 0;
  background-color: var(--image-bg);
  /* base color */
  filter: grayscale(100%);
  opacity: 1;
  transition: filter 0.3s ease;
  z-index: 1;
}

/* Image */
.product-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  filter: grayscale(100%);
  transition: filter 0.3s ease;
  position: relative;
  z-index: 2;
}

/* ACTIVE (clicked) state */
.product:has(.product-info.active) .bg-overlay {
  filter: grayscale(0%);
}

.product:has(.product-info.active) .product-image img {
  filter: grayscale(0%);
}

/* =========================
   INFO PANEL
========================= */
:root {
  --item-highlight: #0d0e0f;
}

/* Base panel */
.product-info {
  position: relative;
  width: 600px;
  height: 600px;
  background-color: #cacaca;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
  padding: 40px;
  transition: background-color 0.25s ease;
}

/* Title */
.product-info h2 {
  font-family: "Josefin Sans", sans-serif;
  font-weight: 800;
  letter-spacing: 3px;
  font-size: 2.5rem;
  color: #0d0e0f;
  transition: color 0.25s ease;
}

/* ACTIVE (clicked) state */
.product.active .product-info {
  background-color: var(--item-highlight);
}

.product.active .product-info h2 {
  color: #eaeaea;
}

/* Info text base (hidden) */
.product-info .info-text {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.4s ease, transform 0.4s ease;
  pointer-events: none;
  color: #eaeaea;
  line-height: 2;
  margin-top: 10px;
  margin-bottom: 10px;
}

/* Info text reveal */
.product.active .product-info .info-text.text {
  opacity: 1;
  transform: translateY(0);
  transition-delay: 0.2s;
  pointer-events: auto;
}

/* Close button */
.product-info .close-text {
  position: absolute;
  top: 15px;
  right: 15px;
  background: transparent;
  border: none;
  color: #eaeaea;
  font-size: 3rem;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  font-family: 'Times New Roman', Times, serif;
}

.product.active .product-info .close-text {
  opacity: 1;
  pointer-events: auto;
}

/* =========================
   INFO BUTTONS
========================= */

.info-button {
  background-color: #eaeaea;
  width: 140px;
  height: 60px;
  display: flex;
  justify-content: center;
  align-items: center;
  letter-spacing: 1px;
  font-family: "Roboto Mono", monospace;
  font-size: medium;
  cursor: pointer;
  margin-top: 10px;
  border: none;
}

.info-button-stack {
  position: absolute;
  bottom: 40px;
  left: 40px;
  display: flex;
  flex-direction: column;
  display: flex;
  flex-direction: column;
  opacity: 0;
  transform: translateY(20px);
  pointer-events: none;
  transition: opacity 0.4s ease, transform 0.4s ease;
}

.product.active .info-button-stack {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
  transition-delay: 0.2s;
}

/* =========================
   CART
========================= */

.cart-button {
  background-color: #0d0e0f;
  width: 140px;
  height: 60px;
  display: flex;
  justify-content: center;
  align-items: center;
  letter-spacing: 1px;
  font-family: "Roboto Mono", monospace;
  color: #cacaca;
  font-size: medium;
  cursor: pointer;
  margin-top: 10px;
  border: none;
}

.cart-button-stack {
  display: flex;
  gap: 20px;
  align-items: center;
  justify-content: center;
}

/* Cart content list */
#cart-items li {
  list-style: none;
  padding-left: 10px;
  padding-right: 31px;
}

#cart-items li .cart-empty-text {
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Full screen overlay */
.cart-modal {
  display: none;
  /* hidden by default */
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.6);
  z-index: 1000;

  justify-content: center;
  /* these will work when you toggle flex in JS */
  align-items: center;
  padding: 20px;
  box-sizing: border-box;
}

.cart-modal.active {
  display: flex;
}

/* Modal content */
.cart-modal-content {
  background-color: #74798a;
  color: #eaeaea;
  padding-top: 5px;
  padding-bottom: 40px;
  padding-left: 20px;
  padding-right: 20px;
  width: 400px;
  /* fixed width */
  max-height: 80vh;
  /* max height = 80% of viewport */
  overflow-y: auto;
  /* scroll if content exceeds max height */
  display: flex;
  flex-direction: column;
  /* stack children vertically */
  gap: 15px;
  /* spacing between children */
  box-sizing: border-box;
}

/* Close button */
.cart-close {
  align-self: flex-end;
  cursor: pointer;
  font-size: 3rem;
  font-family: 'Times New Roman', Times, serif;
}

/* Quantity buttons */
#cart-items button {
  width: 28px;
  height: 28px;
  background: #0d0e0f;
  color: #eaeaea;
  border: none;
  cursor: pointer;
  font-family: "Roboto Mono", monospace;
}

#cart-items button:hover {
  background: #c1c2c6;
  color: #0d0e0f;
}

#cart-items .cart-qty {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #c1c2c6;
  color: #0d0d0d;
  font-family: "Roboto Mono", monospace;
  font-size: 14px;
  user-select: none;
}

/* =========================
   RESPONSIVE
========================= */
@media (max-width: 1300px) {
  .product {
    max-width: 100%;
  }

  .product-image,
  .product-info {
    width: 50%;
    aspect-ratio: 1 / 1;
  }
}

/* =========================
   ACCESSIBILITY
========================= */
@media (prefers-reduced-motion: reduce) {

  .product-image img,
  .product-info,
  .product-info h2 {
    transition: none;
  }
}