:root {
  --paper: #fff;
  --blush: #fff3f7;
  --rose: #f42172;
  --raspberry: #9c125d;
  --violet: #392181;
  --ink: #241c29;
  --border: #ead8e4;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  padding: 20px;
  background: var(--paper);
  color: var(--ink);
  font-family: Arial, sans-serif;
}

h1, h2, h3 {
  color: var(--violet);
}

button, input {
  font: inherit;
}

button {
  cursor: pointer;
}

a:focus-visible,
button:focus-visible,
input:focus-visible {
  outline: 3px solid var(--violet);
  outline-offset: 3px;
}

/* Main menu */
.top-menu {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 24px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--rose);
}

.top-menu a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--raspberry);
  font-weight: bold;
  text-decoration: none;
}

.top-menu a:hover {
  color: var(--violet);
  text-decoration: underline;
}

.top-menu .bx,
#floating-cart .bx {
  font-size: 20px;
}

.top-menu .search-link {
  margin-left: auto;
}

#menu-toggle {
  display: none;
  padding: 8px 14px;
  border: 1px solid var(--raspberry);
  border-radius: 8px;
  background: var(--paper);
  color: var(--raspberry);
}

#menu-toggle[aria-expanded="true"] {
  background: var(--blush);
}

/* Homepage banner */
.hero {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: center;
  gap: 24px;
  min-height: 400px;
  margin: 20px 0 32px;
  padding: 12px clamp(24px, 5vw, 72px);
  border-radius: 16px;
  background: var(--blush);
}

.brand-title {
  width: 200px;
  max-width: 100%;
  margin: 0;
}

.brand-title svg {
  display: block;
  width: 100%;
  height: auto;
}

.hero-slideshow {
  width: 100%;
  min-width: 0;
  height: 376px;
}

#hero-slide-image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* Shop buttons */
.shop-button,
.add-to-cart {
  display: inline-block;
  padding: 12px 24px;
  border: 1px solid var(--raspberry);
  border-radius: 8px;
  background: var(--raspberry);
  color: var(--paper);
  text-decoration: none;
}

.shop-button:hover,
.add-to-cart:hover {
  background: var(--violet);
}

/* Search and category navigation */
label[for="product-search"] {
  display: block;
  margin-bottom: 6px;
  color: var(--violet);
  font-weight: bold;
}

#product-search {
  width: 100%;
  max-width: 380px;
  margin-bottom: 16px;
  padding: 12px 16px;
  border: 1px solid var(--raspberry);
  border-radius: 8px;
  color: var(--ink);
}

.category-menu {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 32px;
}

.category-menu a {
  padding: 10px 18px;
  border: 1px solid var(--raspberry);
  border-radius: 24px;
  background: var(--blush);
  color: var(--raspberry);
  font-weight: bold;
  text-decoration: none;
}

.category-menu a:hover {
  background: var(--raspberry);
  color: var(--paper);
}

/* Product categories and cards */
.product-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 24px;
  padding: 16px;
  border-radius: 18px;
  background: var(--blush);
}

.product-grid > section,
#cart {
  min-width: 0;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: var(--paper);
  box-shadow: 0 4px 14px rgb(57 33 129 / 7%);
}

.product-grid h2 {
  margin: 0 0 14px;
  font-size: 20px;
}

.design-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.design-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--paper);
}

.design-photo,
.design-photo img {
  display: block;
}

.design-photo img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: contain;
  border-radius: 10px;
  background: #fcf9fb;
}

.design-card h3 {
  margin: 14px 0 10px;
  font-size: 18px;
  overflow-wrap: anywhere;
}

.price {
  width: fit-content;
  margin: auto 0 14px;
  padding: 5px 14px;
  border: 1px solid #efc4d8;
  border-radius: 20px;
  background: var(--blush);
  color: var(--raspberry);
  font-size: 18px;
  font-weight: bold;
}

.design-card .shop-button,
.add-to-cart {
  width: 100%;
  padding: 10px 6px;
  text-align: center;
  font-size: 14px;
  font-weight: bold;
}

.add-to-cart {
  margin-bottom: 8px;
}

.design-card .shop-button {
  background: var(--paper);
  color: var(--raspberry);
}

.design-card .shop-button:hover {
  background: var(--blush);
}

/* Cart */
#cart {
  max-width: 640px;
  margin: 40px auto;
  padding: 24px;
  border-top: 4px solid var(--raspberry);
}

#cart h2 {
  margin-top: 0;
}

#cart-items {
  padding: 0;
  list-style: none;
}

#cart-items li {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  overflow-wrap: anywhere;
}

.cart-thumbnail {
  display: block;
  width: 52px;
  height: 52px;
  object-fit: contain;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--blush);
}

#cart-items button {
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--blush);
  color: var(--raspberry);
}

/* Floating buttons */
#floating-cart,
#back-to-top {
  position: fixed;
  right: 20px;
  z-index: 10;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--raspberry);
  color: var(--paper);
  text-decoration: none;
}

#floating-cart {
  bottom: 76px;
  gap: 6px;
  min-height: 44px;
  padding: 8px 16px;
  border-radius: 24px;
  font-weight: bold;
  box-shadow: 0 3px 10px rgb(57 33 129 / 18%);
}

#back-to-top {
  bottom: 20px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  font-size: 24px;
}

#floating-cart:hover,
#back-to-top:hover {
  background: var(--violet);
}

/* Phone layout */
@media (max-width: 600px) {
  body {
    padding: 12px;
  }

  #menu-toggle {
    display: inline-block;
  }

  .top-menu {
    display: none;
  }

  .top-menu.is-open {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    padding-top: 12px;
  }

  .top-menu .search-link {
    margin-left: 0;
  }

  .hero {
    grid-template-columns: minmax(0, 1fr);
    min-height: 0;
    gap: 16px;
    padding: 20px;
  }

  .brand-title {
    width: 160px;
  }

  .hero-slideshow {
    height: 240px;
  }

  .product-grid,
  .product-grid > section,
  .design-card {
    padding: 8px;
  }

  .design-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }
}
.mug-flip-button {
  align-self: center;
  min-height: 44px;
  margin-top: 8px;
  padding: 6px 18px;
  border: 1px solid var(--raspberry);
  border-radius: 24px;
  background: var(--paper);
  color: var(--raspberry);
  font: inherit;
  font-weight: bold;
  cursor: pointer;
}

.mug-flip-button:hover {
  background: var(--raspberry);
  color: var(--paper);
}
/* Keep the sliding photos inside the homepage banner. */
.hero-slideshow {
  position: relative;
  overflow: hidden;
}

.hero-slideshow > .hero-slide-photo {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
}

.hero-slideshow .hero-slide-controls {
  display: none;
}
.hero-slideshow {
  position: relative;
  overflow: hidden;
}

.hero-slideshow > .hero-slide-photo {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
}

.hero-slideshow > .hero-slide-photo[hidden],
.hero-slideshow .hero-slide-controls {
  display: none;
}
/* Outline each slideshow photo, including narrow portrait paintings. */
.hero-slideshow > .hero-slide-photo {
  filter:
    drop-shadow(1px 0 0 var(--raspberry))
    drop-shadow(-1px 0 0 var(--raspberry))
    drop-shadow(0 1px 0 var(--raspberry))
    drop-shadow(0 -1px 0 var(--raspberry));
  padding: 4px;
}
/* Cart quantity buttons */
.cart-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

#cart-items .cart-actions button {
  min-width: 40px;
  min-height: 40px;
  padding: 4px 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--blush);
  color: var(--raspberry);
  font: inherit;
  cursor: pointer;
}

#cart-items .cart-actions button:hover {
  background: var(--raspberry);
  color: var(--paper);
}

/* Put the buttons under the name on narrow phones. */
@media (max-width: 480px) {
  #cart-items li {
    grid-template-columns: 52px minmax(0, 1fr);
    row-gap: 6px;
  }

  #cart-items .cart-thumbnail {
    grid-row: span 2;
  }

  #cart-items .cart-actions {
    grid-column: 2;
  }
}

/* Give both sides of every cup the same square photo area. */
#mugs .design-photo img {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  object-fit: contain;
  object-position: center;
}
/* Keep each cup photo inside its square frame. */
#mugs .design-photo {
  overflow: hidden;
  border-radius: 10px;
}

/* Floating Jump to button, directly below the floating cart */
#quick-jump {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 20;
}

#quick-jump > summary {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 8px 16px;
  border-radius: 24px;
  background: var(--raspberry);
  color: var(--paper);
  font-weight: bold;
  cursor: pointer;
  list-style: none;
  box-shadow: 0 3px 10px rgb(57 33 129 / 18%);
}

#quick-jump > summary::-webkit-details-marker {
  display: none;
}

#quick-jump > summary:hover,
#quick-jump[open] > summary {
  background: var(--violet);
}

#quick-jump > summary:focus-visible {
  outline: 3px solid var(--violet);
  outline-offset: 3px;
}

.quick-jump-menu {
  position: absolute;
  right: 0;
  bottom: calc(100% + 8px);
  width: 190px;
  max-height: calc(100dvh - 90px);
  overflow-y: auto;
  padding: 6px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--paper);
  box-shadow: 0 6px 22px rgb(57 33 129 / 16%);
}

.quick-jump-menu a {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 8px 12px;
  border-radius: 8px;
  color: var(--raspberry);
  font-weight: bold;
  text-decoration: none;
}

.quick-jump-menu a:hover,
.quick-jump-menu a:focus-visible {
  background: var(--blush);
  color: var(--violet);
}