:root {
  --purple: #8e44ad;
  --blue: #3498db;
  --yellow: #f1c40f;
  --white: #ffffff;
  --black: #1d1d18;
}

/* Global styles */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: "ABeeZee", Arial, sans-serif;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

body {
  background-color: var(--white);
  color: var(--black);
  font-size: clamp(0.875rem, 2.5vw, 1rem);
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

#wrapper {
  display: grid;
  grid-template-rows: auto auto 1fr auto;
  gap: 2vh;
  min-height: 100vh;
  padding: 2vh 2vw;
}

/* Header */
header {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 2vh 0;
}

#logo {
  font-size: clamp(1.5rem, 5vw, 2.5rem);
}

/* Navigation */
nav {
  background-color: var(--purple);
  padding: 2vh 0;
  border-radius: 1vw;
}

nav ul {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  list-style: none;
  gap: clamp(1vw, 2vw, 3vw);
  padding: 0 1vw;
}

nav a {
  text-decoration: none;
  color: var(--white);
  padding: 1vh 2vw;
  border-radius: 1vw;
  transition: background-color 0.3s, color 0.3s;
  font-size: clamp(0.875rem, 2.5vw, 1rem);
  white-space: nowrap;
}

nav a:hover {
  background-color: var(--blue);
  color: var(--white);
}

/* Main */
main {
  background-color: var(--blue);
  padding: clamp(2vh, 3vh, 4vh) clamp(2vw, 3vw, 4vw);
  border-radius: 1vw;
}

/* Footer */
footer {
  background-color: var(--purple);
  color: var(--white);
  text-align: center;
  padding: 2vh 1vw;
  border-radius: 1vw;
  font-size: clamp(0.75rem, 2vw, 0.875rem);
}

footer a {
  color: var(--white);
  text-decoration: underline;
}

/* Shared Layout */
.image-container {
  display: grid;
  gap: 2vh;
}

/* Keep image-box styles ONLY on home page */
.home-page .image-box,
.home-page .image-box-with-subimages {
  display: flex;
  flex-direction: column;
  gap: 1vh;
  background-color: transparent;
  padding: 0;
  border-radius: 1vw;
  border: none;
}

/* Remove all styles from image-box and image-box-with-subimages on all other pages */
.image-box,
.image-box-with-subimages {
  all: unset;
  background: none;
  padding: 0;
  border-radius: 0;
  border: none;
  gap: 0;
  flex-direction: initial;
}

.text-box {
  padding: 1vh;
  background-color: var(--blue);
  color: var(--white);
  border-radius: 0.5vw;
  text-align: center;
}

.banner-image {
  width: 100%;
  max-width: 100%;
  height: auto;
  border-radius: 1vw;
  border: 0.5vw solid var(--purple);
  display: block;
  margin: 0 auto;
}

/* Home Page */
.home-page .banner-image {
  margin-bottom: 2vh;
}

.home-page .image-container {
  grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr));
  gap: 2vh;
}

.home-page .image-box,
.home-page .small-image-box {
  border: none;
  background-color: transparent;
}

.home-page .image {
  height: auto;
}

.home-page .small-image-container {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 2vw;
}

.home-page .small-image {
  object-fit: cover;
  height: auto;
}

.home-page .text-box {
  margin-top: 1vh;
}

/* Products Page */
.product-page .image-container {
  display: block;
  gap: 0;
}

.product-page .image-container img {
  max-width: 100%;
  width: auto;
  height: auto;
  border-radius: 1vw;
  border: 0.4vw solid var(--purple);
  display: block;
  margin: 0 auto;
}

/* Services Page */
.services-page .image-container {
  display: block;
  gap: 3vh;
}

.services-page .image-box {
  margin-bottom: 3vh;
  display: flex;
  flex-direction: column;
  gap: 1vh;
}

.services-page .image-box img {
  max-width: 100%;
  width: auto;
  height: auto;
  border-radius: 1vw;
  border: 0.4vw solid var(--purple);
  display: block;
  margin: 0 auto;
}

.services-page .text-box {
  background-color: var(--white);
  color: var(--black);
  text-align: left;
  padding: clamp(1.5vh, 2vh, 2.5vh) clamp(1.5vw, 2vw, 2.5vw);
  border-radius: 1vw;
  margin-top: 1vh;
}

.services-page .text-box:first-child {
  font-weight: bold;
  background-color: var(--purple);
  color: var(--white);
  text-align: center;
  padding: 1vh;
  border-radius: 0.5vw;
  margin-top: 0;
  margin-bottom: 1vh;
}

.services-page .text-box h3 {
  color: var(--purple);
  font-size: clamp(1rem, 3vw, 1.2rem);
  margin-bottom: 1vh;
  font-weight: bold;
}

.services-page .text-box p {
  line-height: 1.5;
  font-size: clamp(0.875rem, 2.5vw, 1rem);
}

/* Buy Button */
.buy-button {
  margin: 1vh 0;
  padding: 1vh;
  background-color: var(--blue);
  color: var(--white);
  border: 0.4vw solid var(--purple);
  border-radius: 0.5vw;
  width: 100%;
  font-weight: bold;
  cursor: pointer;
  transition: background-color 0.3s, color 0.3s;
  font-size: clamp(0.875rem, 2.5vw, 1rem);
}

.buy-button:hover,
.buy-button:focus,
.buy-button:active {
  background-color: var(--purple);
  color: var(--white);
}

/* Cart Page - FULLY RESPONSIVE */
.cart-content {
  display: flex;
  flex-direction: column;
  gap: clamp(2vh, 3vh, 4vh);
  font-size: clamp(0.875rem, 2.5vw, 1.1rem);
  padding: 0;
}

.selected-items {
  display: flex;
  flex-direction: column;
  gap: clamp(1.5vh, 2vh, 2.5vh);
}

.selected-items h3 {
  color: var(--white);
  font-size: clamp(1.1rem, 3vw, 1.3rem);
  margin-bottom: 1vh;
}

.item {
  display: flex;
  align-items: flex-start;
  background-color: var(--white);
  padding: clamp(1.5vh, 2vh, 2.5vh) clamp(1.5vw, 2vw, 2.5vw);
  border-radius: 1vw;
  gap: clamp(1.5vw, 2vw, 2.5vw);
  width: 100%;
}

.item img {
  border-radius: 0.5vw;
  border: 0.4vw solid var(--purple);
  height: auto;
  flex-shrink: 0;
  width: clamp(20vw, 25vw, 30vw);
  max-width: clamp(80px, 15vw, 120px);
  object-fit: cover;
}

/* Item details */
.item-details {
  display: flex;
  flex-direction: column;
  gap: clamp(0.5vh, 1vh, 1.5vh);
  flex: 1;
  min-width: 0;
}

.item-name {
  font-weight: bold;
  color: var(--black);
  font-size: clamp(0.9rem, 2.8vw, 1.1rem);
  word-wrap: break-word;
}

.item-price {
  color: var(--blue);
  font-weight: bold;
  font-size: clamp(1rem, 3vw, 1.2rem);
}

.total-price {
  background-color: var(--white);
  padding: clamp(2vh, 3vh, 4vh) clamp(2vw, 3vw, 4vw);
  border-radius: 1vw;
  text-align: center;
  font-size: clamp(1rem, 3vw, 1.2rem);
}

.total-price h3 {
  margin-bottom: 1vh;
  font-size: clamp(1.1rem, 3.5vw, 1.3rem);
}

.total-price p {
  font-size: clamp(1.2rem, 4vw, 1.5rem);
  font-weight: bold;
  color: var(--black);
  margin-bottom: 1vh;
}

.checkout-button {
  margin-top: 2vh;
  padding: clamp(1.2vh, 1.5vh, 2vh) clamp(2vw, 3vw, 4vw);
  background-color: var(--purple);
  color: var(--white);
  border: 0.4vw solid var(--blue);
  border-radius: 1vw;
  font-weight: bold;
  width: 100%;
  cursor: pointer;
  transition: background-color 0.3s ease, transform 0.2s ease;
  font-size: clamp(0.9rem, 2.8vw, 1.1rem);
}

.checkout-button:hover {
  background-color: var(--blue);
  transform: scale(1.02);
}

/* Home Page Text Boxes Replacing Images */
.text-only-box {
  background-color: var(--yellow);
  color: var(--black);
  padding: clamp(1.5vh, 2vh, 3vh) clamp(1.5vw, 2vw, 3vw);
  border: 0.4vw solid var(--purple);
  border-radius: 1vw;
  font-size: clamp(0.9rem, 2.8vw, 1.1rem);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-height: clamp(15vh, 20vh, 25vh);
  line-height: 1.4;
}

/* CONTACT PAGE & REGISTER PAGE FORM STYLES */
body.contact-page form {
  background-color: #ffffff;
  max-width: min(600px, 90vw);
  margin: 0 auto;
  padding: clamp(1rem, 3vw, 1.5rem);
  border: solid 2px #8e44ad;
  border-radius: 8px;
}

body.contact-page div {
  clear: both;
  padding-top: 10px;
}

body.contact-page div.two label {
  font-weight: bold;
  float: left;
  width: clamp(80px, 20vw, 100px);
  text-align: right;
  padding-right: 10px;
  position: relative;
  font-size: clamp(0.875rem, 2.5vw, 1rem);
}

body.contact-page div.two input,
body.contact-page div.two select {
  float: left;
  width: clamp(120px, 30vw, 150px);
  text-align: left;
  padding: 6px;
  border: 1px solid #8e44ad;
  border-radius: 4px;
  font-size: clamp(0.875rem, 2.5vw, 1rem);
}

body.contact-page div.two select {
  width: clamp(127px, 32vw, 157px);
}

body.contact-page div.one {
  text-align: center;
  margin-top: 1.5em;
}

body.contact-page #submit {
  clear: both;
  width: clamp(100px, 25vw, 125px);
  height: clamp(32px, 8vw, 36px);
  background: #f29f05;
  text-align: center;
  line-height: clamp(32px, 8vw, 36px);
  font-size: clamp(12px, 3.5vw, 14px);
  font-weight: bold;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

body.contact-page #submit:hover {
  background: #3498db;
}

body.contact-page .tooltip {
  display: block;
  position: absolute;
  visibility: hidden;
  left: clamp(15em, 25em, 30em);
  top: 0;
  width: clamp(8em, 10em, 12em);
  padding: 0.5em;
  font-weight: normal;
  color: #fff;
  background-color: #8e44ad;
  border: solid 2px #8e44ad;
  border-radius: 4px;
  font-size: clamp(0.75rem, 2vw, 0.875rem);
}

body.contact-page .error {
  color: #d92525;
}

body.contact-page span.error {
  padding-left: 10px;
  font-size: clamp(0.75rem, 2vw, 0.9rem);
}

/* Mobile-first responsive design */
@media (max-width: 768px) {
  nav ul {
    flex-direction: column;
    align-items: center;
    gap: 1vh;
  }

  nav a {
    padding: 1.5vh 4vw;
    width: 80%;
    text-align: center;
  }

  .item {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 1.5vh;
  }

  .item img {
    width: clamp(40vw, 50vw, 60vw);
    max-width: 200px;
  }

  .item-details {
    width: 100%;
    align-items: center;
    text-align: center;
  }

  .home-page .image-container {
    grid-template-columns: 1fr;
  }

  .home-page .small-image-container {
    flex-direction: column;
    align-items: center;
  }

  body.contact-page div.two label,
  body.contact-page div.two input,
  body.contact-page div.two select {
    float: none;
    width: 100%;
    text-align: left;
    margin-bottom: 0.5rem;
  }

  body.contact-page div.two label {
    text-align: left;
    padding-right: 0;
  }

  body.contact-page .tooltip {
    position: static;
    visibility: visible;
    width: 100%;
    margin-top: 0.5rem;
  }
}

@media (max-width: 480px) {
  #wrapper {
    padding: 1vh 1vw;
    gap: 1vh;
  }

  main {
    padding: clamp(1.5vh, 2vh, 2.5vh) clamp(1.5vw, 2vw, 2.5vw);
  }

  .item {
    padding: 1.5vh 1.5vw;
  }

  .item img {
    width: clamp(50vw, 60vw, 70vw);
    max-width: 180px;
  }

  .text-only-box {
    min-height: clamp(12vh, 15vh, 18vh);
    padding: 1.5vh 1.5vw;
  }
}
