:root {
  --font-base: "Helvetica Neue", Helvetica, Arial, sans-serif;
  --color-text: #111;
  --color-muted: #666;
  --color-bg: #f8f8f8;
  --color-accent: #000;
  --color-border: #000000;
  --card-width: 40vw;
}

* {
  box-sizing: border-box;
}

body {
  max-width: 100vw;
  font-family: var(--font-base);
  color: var(--color-text);
  background: var(--color-bg);
  display: flex;
  flex-direction: column;
  margin: 0 auto;
  overflow-x: hidden;
}

main {
  width: 100%;
  height: 100%;
}

/* NAVIGATION */
.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--color-bg);
  padding: 1.5rem 3rem;
  border: 1px solid var(--color-border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.navbar-mobile {
  display: none;
}

.navbar__brand {
  font-weight: 700;
  letter-spacing: 0.05em;
  width: 100%;
}

.navbar__menu {
  display: flex;
  justify-items: center;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}

.navbar-mobile__menu {
  display: flex;
  justify-items: center;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 0;
  width: 100%;
  border-top: 1px solid var(--color-border);
}

.navbar__user {
  display: flex;
  direction: rtl;
  align-items: center;
  width: 100%;
  gap: 1rem;
}

.navbar__link {
  text-decoration: none;
  color: var(--color-text);
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
}

.navbar__link:hover,
.navbar__user a:hover {
  text-decoration: underline;
}

@media (max-width: 768px) {
  .navbar {
    display: none;
  }

  .navbar-mobile {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    position: sticky;
    top: 0;
    z-index: 100;
  }

  .navbar-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 1rem 2rem;
  }
}

/* DROPDOWN */
.dropdown {
  position: relative;
  cursor: pointer;
}

.dropdown[open] > summary::after {
  content: "▲";
  margin-left: 0.25rem;
  font-size: 0.6em;
}

.dropdown > summary {
  list-style: none;
}

.dropdown__panel {
  position: absolute;
  top: 100%;
  left: 0;
  background: #fff;
  border: 1px solid var(--color-border);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  padding: 0.5rem 0;
  min-width: 10rem;
  z-index: 10;
}

.dropdown__item {
  display: block;
  padding: 0.25rem 1rem;
  color: var(--color-text);
  text-decoration: none;
  white-space: nowrap;
}

.dropdown__item:hover {
  background: var(--color-bg);
}

.hero {
  width: 100vw;
  position: relative;
  border-left: 1px solid var(--color-border);
  border-right: 1px solid var(--color-border);
}

.spline-viewer {
  height: 80vh;
}

@media (max-width: 768px) {
  .spline-viewer {
    height: 50vh;
  }
}

/* UTILITY BAR */
.utility-bar {
  display: flex;
  justify-content: space-between;
  background: var(--color-bg);
  padding: 2rem;
  border-bottom: 0.5px solid var(--color-border);
  border-left: 1px solid var(--color-border);
  border-right: 1px solid var(--color-border);
  position: sticky;
  top: 0;
  z-index: 90;
}

.utility-bar__button {
  background: none;
  border: none;
  cursor: pointer;
  font-weight: 600;
  letter-spacing: 0.1rem;
}

.filter-panel,
.sort-menu {
  top: 0;
  right: 0;
  height: 0;
  width: 100%;
  background: var(--color-bg);
  overflow-y: auto;
  z-index: 200;
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.filter-panel[open],
.sort-menu[open] {
  border-bottom: 0.5px solid var(--color-border);
  border-left: 1px solid var(--color-border);
  border-right: 1px solid var(--color-border);
  padding: 2rem;
  height: 100%;
}

.filter-panel__tag {
  padding: 0.5rem 1rem;
  letter-spacing: 0.1rem;
  background-color: var(--color-bg);
  color: #000;
  border: none;
  cursor: pointer;
  width: 30%;
  border: 1px solid var(--color-border);
  transition: all 0.3s ease;
}

.filter-panel__tag:hover {
  background-color: var(--color-muted);
  color: #fff;
}

.is-selected {
  background-color: #000;
  color: #fff;
}

/* Cart notification */
.cart-notification {
  position: fixed;
  top: 20px;
  right: 20px;
  background-color: #000;
  color: #fff;
  padding: 10px 20px;
  border-radius: 4px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  z-index: 1000;
  opacity: 1;
  transition: opacity 0.5s ease;
}

.sort-menu button {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
  background: none;
  border: 1px solid var(--color-border);
  cursor: pointer;
  letter-spacing: 0.1rem;
  width: 20%;
  padding: 0.5rem;
  cursor: pointer;
  transition: all 0.3s ease;
}

.sort-menu button:hover {
  background-color: var(--color-muted);
  color: #fff;
}

.sort-menu button[selected] {
  background-color: var(--color-border);
  color: #fff;
}

/* PRODUCT GRID */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, calc(100% / 3));
  border-left: 0.5px solid var(--color-border);
  border-right: 0.5px solid var(--color-border);
}

@media (max-width: 996px) {
  .product-grid {
    grid-template-columns: repeat(auto-fit, calc(100% / 2));
  }
}

@media (max-width: 500px) {
  .product-grid {
    grid-template-columns: repeat(auto-fit, calc(100% / 1));
  }
}

.product-card {
  position: relative;
  border: 0.5px solid var(--color-border);
  transition: box-shadow 0.3s ease;
  overflow: hidden;
  /* Ensures image doesn't overflow the border */
}

.product-card__image {
  width: 100%;
  height: 75%;
  aspect-ratio: 1/1;
  object-fit: cover;
  display: block;
  padding: 0;
  transition: padding 0.4s ease;
}

.product-card__meta {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
  height: 25%;
  padding: 1.5rem 2rem;
}

@media (max-width: 800px) {
  .product-card__meta {
    padding: 1rem;
  }
}

.product-card__meta:hover {
  backface-visibility: hidden;
}

.product-card__title {
  font-size: 1.2rem;
  margin: 0 0 0.25rem;
  line-height: 1.2;
}

.product-card__price {
  font-size: 0.85rem;
  color: var(--color-muted);
}

.product-card__badge {
  position: absolute;
  bottom: 0.75rem;
  left: 0.75rem;
  background: rgba(0, 0, 0, 0.8);
  color: #fff;
  padding: 0.25rem 0.5rem;
  font-size: 0.75rem;
  text-transform: uppercase;
}

.product-card.is-sold-out .product-card__image {
  opacity: 0.4;
  filter: grayscale(100%);
}

.cart-link {
  background-color: var(--color-bg);
  border: 1px solid var(--color-border);
  padding: 0.5rem 1rem;
  margin: 0.5rem;
  text-decoration: none;
  color: #000;
  display: flex;
  align-items: center;
  justify-self: flex-end;
  gap: 1rem;
  font-size: 1.5rem;
  transition: all 0.3s ease;
}

.cart-link:hover {
  text-decoration: none;
  background-color: #000;
  color: #fff;
}

.add-to-cart-btn {
  background-color: var(--color-bg);
  border: 1px solid var(--color-border);
  cursor: pointer;
  height: 2.5rem;
  width: 2.5rem;
  font-size: 1.5rem;
  color: #000;
  transition: all 0.3s ease;
}

.add-to-cart-btn:hover {
  background-color: var(--color-accent);
  color: #fff;
}

.add-to-cart-btn-selected {
  background-color: var(--color-border);
  border: 1px solid var(--color-border);
  height: 2.5rem;
  width: 2.5rem;
  font-size: 1.5rem;
  color: #fff;
  transition: all 0.3s ease;
}

.add-to-cart-btn-selected:hover {
  background-color: #fff;
  border: 1px solid var(--color-border);
  color: #000;
}

.add-to-cart-btn-disabled {
  background-color: var(--color-border);
  border: 1px solid var(--color-border);
  cursor: not-allowed;
  height: 2.5rem;
  width: 2.5rem;
  font-size: 1.5rem;
  color: #fff;
  transition: all 0.3s ease;
}

.empty-state {
  padding: 2rem;
  text-align: center;
  width: 100%;
  grid-column: 1 / -1;
}

.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  padding: 2rem;
  border-top: 0.5px solid var(--color-border);
  border-left: 1px solid var(--color-border);
  border-right: 1px solid var(--color-border);
}

.current {
  font-size: 1.2rem;
  padding: 0.6rem 1rem;
  margin: 0 1rem;
  border: 1px solid var(--color-border);
  background-color: var(--color-border);
  color: #fff;
}

.previous {
  font-size: 1.2rem;
  padding: 0.6rem 1rem;
  opacity: 0.4;
  margin: 0 1rem;
  border: 1px solid var(--color-border);
  transition: all 0.3s ease;
}

.previous:hover {
  opacity: 1;
}

.cart-summary {
  display: flex;
  width: 100%;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  border-left: 1px solid var(--color-border);
  border-right: 1px solid var(--color-border);
}

.cart-card {
  display: flex;
  flex-direction: row;
  align-items: center;
  width: 100%;
  border-bottom: 1px solid var(--color-border);
}

.cart-card-title {
  display: flex;
  width: 50%;
  flex-direction: column;
  gap: 1rem;
  align-items: flex-start;
  padding: 2rem;
}

.cart-card-controls {
  display: flex;
  width: 20%;
  justify-content: flex-end;
  align-items: center;
  padding-right: 1rem;
  gap: 1rem;
}

.qty-button {
  background-color: var(--color-bg);
  border: 1px solid var(--color-border);
  cursor: pointer;
  height: 2.5rem;
  width: 2.5rem;
  font-size: 1.5rem;
  color: #000;
  transition: all 0.3s ease;
}

.qty-button:hover {
  background-color: #000;
  color: #fff;
}

.checkout-btn {
  background-color: var(--color-bg);
  text-decoration: none;
  font-size: 1.5rem;
  font-weight: 500;
  width: 100%;
  color: #000;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 1rem;
  border-right: 1px solid var(--color-border);
  border-left: 1px solid var(--color-border);
  border-top: none;
  border-bottom: none;
  transition: all 0.3s ease;
}

.checkout-btn:hover {
  background-color: #000;
  color: #fff;
}

.checkout-tile {
  padding: 0.5rem 2rem;
  font-size: 1.2rem;
  font-weight: 400;
  display: flex;
  justify-items: flex-start;
  width: 100%;
}

/* FOOTER */
.footer {
  padding: 1rem;
  text-align: center;
  border: 1px solid var(--color-border);
  z-index: 100;
}

/* RESPONSIVE */
@media (max-width: 600px) {
  .navbar {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }

  .navbar__menu {
    flex-wrap: wrap;
  }
}

.carousel-container {
  width: 100%;
  height: var(--card-width);
  position: relative;
}

.controls {
  display: flex;
  width: 100%;
}

.controls-mobile {
  display: none;
}

.carousel-container-mobile {
  display: none;
  width: 100%;
  height: 40vh;
  position: relative;
}

.carousel-track {
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  position: relative;
  transform-style: preserve-3d;
  transition: transform 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.card {
  position: absolute;
  height: var(--card-width);
  width: var(--card-width);
  background: black;
  transition: all 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  cursor: zoom-in;
}

.card-mobile {
  display: none;
  height: 40vh;
  width: 100%;
  cursor: zoom-in;
}

.card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: all 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.card-mobile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.card.center {
  z-index: 10;
  transform: translateZ(0);
}

.card.center img {
  filter: none;
}

.card.left-1 {
  z-index: 5;
  transform: translateX(calc(var(--card-width) * -1));
  opacity: 0.9;
}

.card.left-1 img {
  filter: grayscale(100%);
}

.card.left-2 {
  z-index: 5;
  transform: translateX(calc(var(--card-width) * -2));
  opacity: 0.9;
}

.card.left-2 img {
  filter: grayscale(100%);
}

.card.right-1 {
  z-index: 5;
  transform: translateX(var(--card-width));
  opacity: 0.9;
}

.card.right-1 img {
  filter: grayscale(100%);
}

.card.right-2 {
  z-index: 5;
  transform: translateX(calc(var(--card-width) * 2));
  opacity: 0.9;
}

.card.right-2 img {
  filter: grayscale(100%);
}

.card.hidden {
  opacity: 0;
  pointer-events: none;
}

@media (max-width: 768px) {
  .controls,
  .carousel-container {
    display: none;
  }

  .controls-mobile,
  .carousel-container-mobile {
    display: flex;
    width: 100%;
  }

  .card {
    width: 200px;
    height: 280px;
  }

  .card.left-2 {
    transform: translateX(-250px) scale(0.8) translateZ(-300px);
  }

  .card.left-1 {
    transform: translateX(-120px) scale(0.9) translateZ(-100px);
  }

  .card.right-1 {
    transform: translateX(120px) scale(0.9) translateZ(-100px);
  }

  .card.right-2 {
    transform: translateX(250px) scale(0.8) translateZ(-300px);
  }
}

.contacts {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  justify-content: center;
  height: 100%;
  border-right: 1px solid var(--color-border);
  border-left: 1px solid var(--color-border);
}

.contacts-left {
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  padding: 2rem 2rem;
  font-size: larger;
  border-right: 1px solid var(--color-border);
}

.contacts-info {
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: center;
  justify-content: start;
  gap: 1rem;
  padding: 1rem 0;
  margin: 0;
}

@media (max-width: 600px) {
  .contacts {
    flex-direction: column;
    align-items: center;
  }

  .contacts-left {
    width: 100%;
    border-right: none;
  }

  .contacts-info {
    width: 100%;
    border-top: 1px solid var(--color-border);
  }
}
