/* =========================================
   Color Palette 
   ========================================= */
:root {
  /* --- Light Mode --- */
  --bg-body: #fffdf5;
  --bg-surface: #ffffff;
  --text-main: #4a3b32;
  --border-line: #d8d0c0;

  --brand-green: #7d9d86;
  --action-orange: #d98324;
  --action-hover: #bf6f1a;
  --state-error: #d32f2f;
}

body.dark-mode {
  /* --- Dark Mode (Swap Values Only) --- */
  --bg-body: #26201b;
  --bg-surface: #120f0d;
  --text-main: #efe8d8;
  --border-line: #4a3f38;

  --brand-green: #9abfb2;
  --action-orange: #e69a45;
  --action-hover: #d98324;
  --state-error: #ef5350;
}

/* =========================================
   Reset & Base Styles
   ========================================= */
* {
  box-sizing: border-box;
}

body {
  width: 1280px;
  margin: 0 auto;

  font-family: "Quicksand", "Helvetica", sans-serif;
  letter-spacing: 0.5px;

  background-color: var(--bg-body);
  color: var(--text-main);
  padding: 20px 40px;
  min-height: 100vh;
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.05);
  transition: background-color 0.3s, color 0.3s;
}

/* Resets */
h1,
h2,
h3,
h4,
p,
ul,
li,
figure {
  margin: 0;
  padding: 0;
}

ul {
  list-style: none;
}

img {
  max-width: 100%;
  display: block;
}

button {
  cursor: pointer;
  font-family: inherit;
}

address {
  font-style: normal;
}

fieldset {
  border: none;
  padding: 0;
  margin: 0;
  min-width: 0;
}

/* =========================================
   Header & Navigation
   ========================================= */
header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 30px 0;
}

hgroup h1 {
  font-size: 2.2rem;
  color: var(--text-main);
  margin-bottom: 5px;
}
hgroup h1 a {
  text-decoration: none;
  color: inherit;
}
hgroup h1 a:hover {
  color: var(--action-orange);
}

hgroup p {
  color: var(--brand-green);
  font-size: 1rem;
  font-weight: 500;
  letter-spacing: 1px;
}

#theme-toggle {
  background: transparent;
  border: 1px solid var(--text-main);
  color: var(--text-main);
  padding: 8px 16px;
  border-radius: 4px;
  font-weight: bold;
  font-size: 0.9rem;
}

nav {
  border-top: 1px solid var(--border-line);
  border-bottom: 1px solid var(--border-line);
  padding: 15px 0;
  margin-bottom: 40px;
}

nav ul {
  display: flex;
  justify-content: center;
  gap: 60px;
}

nav a {
  text-decoration: none;
  color: var(--text-main);
  font-weight: bold;
  font-size: 1.1rem;
  text-transform: uppercase;
  letter-spacing: 1px;
}

nav a:hover {
  color: var(--action-orange);
}

/* =========================================
   Hero Carousel
   ========================================= */
#hero {
  position: relative;
  height: 400px;
  margin-bottom: 50px;
  border-radius: 6px;
  overflow: hidden;
  background-color: var(--border-line);
}

#hero-slider,
.slide {
  width: 100%;
  height: 100%;
}

.slide {
  position: absolute;
  top: 0;
  left: 0;
  opacity: 0;
  transition: opacity 1s ease-in-out;
  z-index: 1;
}
.slide.active {
  opacity: 1;
  z-index: 2;
}
.slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 3;
  font-size: 3rem;
  color: #4a3b32;
  background-color: rgba(255, 255, 255, 0.5);
  padding: 15px 40px;
  border-radius: 4px;
  white-space: nowrap;

  font-family: "Caveat", cursive;
}

/* =========================================
   About Section
   ========================================= */
#about {
  text-align: left;
  max-width: 800px;
  margin: 0 auto 60px auto;
  line-height: 1.5;

  font-family: "Caveat", cursive;
  font-size: 1.6rem;
  color: var(--text-main);
  opacity: 0.9;
}

#about h2 {
  color: var(--brand-green);
  margin-bottom: 15px;
  font-size: 2rem;
  border-bottom: 2px solid var(--brand-green);
  display: inline-block;
  padding-bottom: 5px;
}

#about img {
  float: right;
  max-height: 300px;
  border-radius: 50%;
  margin-left: 20px;
  margin-top: 20px;
}

/* =========================================
   Shop Layout
   ========================================= */
#shop-layout {
  clear: both;
  display: flex;
  gap: 40px;
  align-items: flex-start;
  margin-bottom: 80px;
}


.product-list {
  flex: 2;
}
.product-list > h2 {
  font-size: 1.8rem;
  margin-bottom: 30px;
  color: var(--text-main);
}

.category-title {
  font-size: 1.4rem;
  color: var(--brand-green);
  margin: 30px 0 15px 0;
  padding-left: 10px;
  border-left: 4px solid var(--action-orange);
}
.category-title:first-of-type {
  margin-top: 0;
}

.grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 25px;
  margin-bottom: 10px;
}

.product-card {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-line);
  padding: 20px;
  border-radius: 4px;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.product-card figure {
  margin-bottom: 15px;
  border-radius: 4px;
  overflow: hidden;
  /* border: 1px solid var(--border-line); */
}

.product-card h3 {
  font-size: 1.2rem;
  margin-bottom: 8px;
  color: var(--text-main);
}
.product-card .desc {
  font-size: 0.9rem;
  color: var(--text-main);
  opacity: 0.8;
  margin-bottom: 15px;
  flex-grow: 1;
}
.product-card .price {
  font-size: 1.1rem;
  font-weight: bold;
  color: var(--action-orange);
  margin-bottom: 15px;
}

.add-btn {
  width: 100%;
  padding: 12px;
  background-color: var(--action-orange);
  color: #ffffff;
  border: none;
  border-radius: 50px;
  font-weight: bold;
  font-size: 1rem;
  transition: background-color 0.2s;
}
.add-btn:hover {
  background-color: var(--action-hover);
}

.shop-cta {
  margin-top: 0.2rem;
  margin-bottom: 1.5rem;
  font-size: 1.05rem;
  color: var(--action-orange);
  font-weight: 500;
}

/* Cart */

aside {
  margin-top: 155px;
}

.cart-calculator {
  flex: 1;
  background-color: var(--bg-surface);
  padding: 25px;
  border: 1px solid var(--border-line);
  border-top: 4px solid var(--brand-green);
  border-radius: 4px;
  position: sticky;
  top: 20px;
}

.cart-calculator h3 {
  margin-bottom: 15px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border-line);
  color: var(--text-main);
}

#cart-items li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  padding-bottom: 10px;
  border-bottom: 1px dashed var(--border-line);
  font-size: 0.95rem;
}

.remove-btn {
  background-color: var(--state-error);
  color: #fff;
  border: none;
  height: 22px;
  border-radius: 2px;
  font-size: 12px;
  margin-left: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.empty-msg {
  color: var(--text-main);
  opacity: 0.6;
  font-style: italic;
  text-align: center;
  padding: 10px 0;
}

.cart-summary {
  margin-top: 20px;
  padding-top: 15px;
}
.cart-summary p {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
}

.final-total {
  font-weight: bold;
  font-size: 1.25rem;
  color: var(--action-orange);
  border-top: 2px solid var(--border-line);
  padding-top: 15px;
  margin-top: 10px;
}

#checkout-btn {
  width: 100%;
  padding: 12px;
  margin-top: 20px;
  background-color: var(--text-main);
  color: var(--bg-body);
  border: none;
  border-radius: 50px;
  font-weight: bold;
  font-size: 1.1rem;
}
#checkout-btn:hover {
  opacity: 0.9;
}

/* =========================================
   Contact Form
   ========================================= */
#contact {
  max-width: 500px;
  margin: 0 auto 80px auto;
}

#contact h2 {
  text-align: center;
  margin-bottom: 30px;
  color: var(--brand-green);
  font-size: 1.8rem;
}

#contact-form > label {
  display: block;
  margin-bottom: 20px;
  font-weight: bold;
  color: var(--text-main);
}

/* Inputs */
#contact-form input:not([type="radio"]),
#contact-form textarea {
  display: block;
  width: 100%;
  margin-top: 8px;
  padding: 12px;
  background-color: var(--bg-surface);
  color: var(--text-main);
  border: 1px solid var(--border-line);
  border-radius: 4px;
  font-size: 1rem;
  font-family: inherit;
}

#contact-form input:focus,
#contact-form textarea:focus {
  outline: none;
  border-color: var(--brand-green);
  box-shadow: 0 0 0 2px rgba(125, 157, 134, 0.2);
}

.radio-group {
  display: flex;
  gap: 40px;
  margin: 10px 0 25px 0;
  padding: 15px;
  background-color: var(--bg-surface);
  border: 1px solid var(--border-line);
  border-radius: 4px;
}

.radio-group legend {
  font-weight: bold;
  margin-bottom: 10px;
  color: var(--text-main);
}

.radio-group label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: normal;
  cursor: pointer;
  color: var(--text-main);
}

#contact button[type="submit"] {
  width: 100%;
  padding: 15px;
  background-color: var(--action-orange);
  color: #fff;
  border: none;
  border-radius: 50px;
  font-weight: bold;
  font-size: 1.1rem;
}

#contact button[type="submit"]:hover {
  background-color: var(--action-hover);
}

/* =========================================
   Footer & Back to Top
   ========================================= */
footer {
  text-align: center;
  padding: 40px 0;
  border-top: 1px solid var(--border-line);
  color: var(--text-main);
  opacity: 0.7;
  font-size: 0.9rem;
}

footer address {
  margin-top: 8px;
}

/* Back to Top */
html {
  scroll-behavior: smooth;
}

.back-to-top {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 50px;
  height: 50px;
  background-color: var(--brand-green);
  color: #fff;
  border-radius: 50%;
  text-decoration: none;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 1.5rem;
  font-weight: bold;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
  z-index: 999;
  transition: transform 0.3s, background-color 0.3s;
}

.back-to-top:hover {
  background-color: var(--action-orange);
  transform: translateY(-5px);
}

/* Fixed Cart FAB */
.cart-fab {
  position: fixed;
  bottom: 90px;
  right: 30px;
  width: 50px;
  height: 50px;
  background-color: var(--action-orange);
  color: #fff;
  border-radius: 50%;
  text-decoration: none;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 1.4rem;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
  z-index: 999;
  transition: transform 0.3s, background-color 0.3s;
}

.cart-fab:hover {
  background-color: var(--action-hover);
  transform: translateY(-5px);
}

.cart-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 20px;
  height: 20px;
  background-color: var(--state-error);
  color: #fff;
  border-radius: 50px;
  font-size: 0.7rem;
  font-weight: bold;
  font-family: "Quicksand", sans-serif;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 5px;
}

/* =========================================
   Media Queries – Responsive Design
   ========================================= */

/* --- Fluid body on screens narrower than 1280px --- */
@media (max-width: 1280px) {
  body {
    width: 100%;
    padding: 20px 30px;
  }
}

/* --- Tablet: 1024px and below --- */
@media (max-width: 1024px) {
  nav ul {
    gap: 30px;
  }

  #shop-layout {
    gap: 25px;
  }

  .hero-text {
    font-size: 2.4rem;
  }
}

/* --- Tablet portrait / large mobile: 768px and below --- */
@media (max-width: 768px) {
  body {
    padding: 15px 20px;
  }

  /* Header stacks vertically */
  header {
    flex-direction: column;
    align-items: flex-start;
    gap: 15px;
  }

  /* Nav links wrap with smaller gap */
  nav ul {
    gap: 20px;
    flex-wrap: wrap;
    justify-content: center;
  }

  /* Hero */
  #hero {
    height: 260px;
    margin-bottom: 35px;
  }

  .hero-text {
    font-size: 2rem;
    padding: 10px 25px;
  }

  /* About: clear float so image stacks above text */
  #about img {
    float: none;
    margin: 0 auto 20px auto;
    max-height: 200px;
  }

  /* Shop layout stacks to a single column */
  #shop-layout {
    flex-direction: column;
  }

  /* Remove the offset that only makes sense in side-by-side layout */
  aside {
    margin-top: 0;
  }

  /* Cart goes full width and loses sticky positioning */
  .cart-calculator {
    position: static;
    width: 100%;
  }
}

/* --- Mobile: 480px and below --- */
@media (max-width: 480px) {
  body {
    padding: 10px 15px;
  }

  hgroup h1 {
    font-size: 1.6rem;
  }

  nav ul {
    gap: 15px;
  }

  nav a {
    font-size: 0.95rem;
  }

  #hero {
    height: 200px;
    margin-bottom: 25px;
  }

  /* Allow hero text to wrap and shrink on small screens */
  .hero-text {
    font-size: 1.5rem;
    padding: 8px 16px;
    white-space: normal;
    text-align: center;
    width: 90%;
  }

  #about {
    font-size: 1.3rem;
    margin-bottom: 40px;
  }

  /* Product grid collapses to a single column */
  .grid {
    grid-template-columns: 1fr;
  }

  #contact {
    max-width: 100%;
  }

  /* Radio options stack vertically */
  .radio-group {
    flex-direction: column;
    gap: 15px;
  }
}
