@import url('https://fonts.googleapis.com/css2?family=Unna:wght@400;700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Unna:wght@400;700&family=Oswald:wght@400;700&display=swap');

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

body::before {
  mix-blend-mode: overlay;
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0.35), rgba(0, 0, 0, 0.15));
  z-index: 0;
}

body {
  font-family: 'Oswald', sans-serif;
  line-height: 1.6;
  color: #333;
  background: url('/assets/crest-main.jpg') center/cover no-repeat;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: rgba(0, 0, 0, 0.5);
  padding: 0.5rem 1rem;
  display: flex;
  gap: 1rem;
  align-items: center;
  z-index: 100;
  backdrop-filter: blur(10px);
}

nav .logo img {
  height: 30px;
  width: auto;
  display: block;
}

nav a {
  color: white;
  text-decoration: none;
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  transition: color 0.3s;
}

nav a:hover {
  color: #ddd;
}

body.thanks {
  background: url('/assets/crest-thanks.jpg') top/cover no-repeat;
}

main {
  min-width: 900px;
  max-width: 900px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 2.5rem;
  background: rgba(255, 255, 255, 0.7);
  border-radius: 3px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
  position: relative;
  z-index: 1;
}

body.home main {
  padding-bottom: 100px;
}

body.thanks main {
  padding-left: 4rem;
  padding-right: 4rem;
}

body.gallery main {
  min-width: 640px;
}

h1 {
  font-size: 2.5rem;
  margin-bottom: 1.5rem;
}

h2 {
  font-size: 2.25rem;
  color: #900;
  margin-bottom: 1.5rem;
}

h1, h2 {
  font-family: 'Unna', serif;
  letter-spacing: 0.75px;
}

p {
  color: #333;
  line-height: 1.75;
  font-size: 18px;
  margin-bottom: 0.75rem;
}

p.price {
  font-size: 1.75rem;
  font-weight: bold;
  color: #900;
  margin: 1rem 0;
}

/* Product Carousel */
.product-carousel {
  position: relative;
  width: 100%;
  margin: 1.5rem 0;
}

.product-carousel .carousel-container {
  position: relative;
  width: 70%;
  margin: 0 auto;
  aspect-ratio: 1;
  border-radius: 4px;
  overflow: hidden;
}

.product-carousel .carousel-image {
  position: absolute;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.5s;
}

.product-carousel .carousel-image.active {
  opacity: 1;
}

.carousel-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.8);
  color: #333;
  border: none;
  font-size: 2rem;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.3s;
  z-index: 10;
}

.carousel-nav:hover {
  background: rgba(255, 255, 255, 1);
}

.carousel-nav.prev {
  left: 10px;
}

.carousel-nav.next {
  right: 10px;
}

.carousel-dots {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 1rem;
}

.dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2px solid #800;
  background: transparent;
  cursor: pointer;
  transition: background 0.3s;
  padding: 0;
}

.dot.active {
  background: #800;
}

.dot:hover {
  background: #622;
  border-color: #622;
}

/* Accordion */
.accordion {
  margin: 1.5rem 0;
  border: 1px solid #ddd;
  overflow: hidden;
  border-radius: 4px;
}

.accordion-header {
  width: 100%;
  padding: 1rem;
  background: #f8f8f8;
  color: #333;
  border: none;
  border-radius: 4px 4px 0 0;
  text-align: left;
  font-size: 1rem;
  cursor: pointer;
  transition: background 0.3s;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.accordion-header:after {
  content: '+';
  font-size: 1.5rem;
  transition: transform 0.3s;
}

.accordion-header.active:after {
  content: '−';
}

.accordion-header:hover {
  background: #f0f0f0;
}

.accordion-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease-out;
  background: white;
}

.accordion-content.active {
  max-height: none;
  border-radius: 0 0 4px 4px;
}

ul.specs {
  list-style: none;
  margin: 0;
  padding: 1rem;
}

ul.specs li {
  padding: 0.5rem 0;
  color: #333;
  font-size: 18px;
}

ul.specs li:before {
  content: "• ";
  color: #900;
  font-weight: bold;
  margin-right: 0.5rem;
}

/* Gallery Carousel (auto-advance) */
.carousel {
  position: relative;
  width: 100%;
  margin-top: 1rem;
}

.carousel .carousel-container {
  position: relative;
  width: 100%;
  aspect-ratio: 4/3;
  cursor: pointer;
}

.carousel .carousel-image {
  position: absolute;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.5s;
}

.carousel .carousel-image.active {
  opacity: 1;
}

/* CTA Button */
.cta-button {
  position: fixed;
  bottom: calc((100vh - 90vh) / 2 + 20px);
  left: 50%;
  transform: translateX(-50%);
  width: 500px;
  max-width: calc(100% - 40px);
  z-index: 50;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

.cta-button:hover {
  background: #622;
}

form {
  margin-top: 2rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

input[type="email"] {
  padding: 0.75rem;
  font-size: 1rem;
  border: 2px solid #ddd;
  border-radius: 4px;
  transition: border-color 0.3s;
}

input[type="email"]:focus {
  outline: none;
  border-color: #333;
}

button {
  padding: 0.75rem;
  font-size: 1rem;
  background: #800;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.3s;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

button:hover {
  background: #622;
}

button:disabled {
  background: #999;
  cursor: not-allowed;
}

#message {
  margin-top: 1rem;
  padding: 0.75rem;
  border-radius: 4px;
}

#message.success {
  background: #d4edda;
  color: #155724;
}

#message.error {
  background: #f8d7da;
  color: #721c24;
}

.hidden {
  display: none;
}

/* Order Form */
.order-form {
  margin-top: 2rem;
}

.form-group {
  margin-bottom: 1.5rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: bold;
  color: #333;
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 0.75rem;
  font-size: 1rem;
  border: 2px solid #ddd;
  border-radius: 4px;
  font-family: 'Oswald', sans-serif;
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: #800;
}

.paypal-button-container {
  margin-top: 2rem;
}

body.order main {
  max-width: 600px;
}

@media (max-width: 768px) {
  body {
    display: block;
  }

  body.thanks {
    display: flex;
  }
  
  main {
    min-width: 100%;
    max-width: 100%;
    max-height: none;
    overflow-y: visible;
    border-radius: 0;
    background: rgba(255, 255, 255, 0.6);
    margin: 0;
  }

  h1, h2 {
    margin: 0;
  }

  body.gallery main {
    min-width: 0;
    padding: 1rem;
  }

  body.order main {
    min-width: 100%;
    max-width: 100%;
  }

  .product-carousel .carousel-container {
    width: 100%;
  }

  .carousel-nav {
    width: 35px;
    height: 35px;
    font-size: 1.5rem;
  }

  .accordion {
    overflow: visible;
  }

  .accordion-header:after {
    display: none;
  }
  
  .accordion-content {
    border-top: 1px solid #ccc;
    max-height: none !important;
    display: block !important;
  }

  .cta-button {
    bottom: 20px;
  }
}
