/* ============================
   MYSTIC DESIGN — GLOBAL STYLE
   ============================ */

/*
  ============================
  THEME SETTINGS (EDIT HERE)
  ============================
  Change these values to swap fonts, colors, and key art quickly.
*/
:root {
  /* Brand colors */
  --mystic-purple: #6a0dad;
  --mystic-dark: #0b0014;
  --mystic-light: #d8b4ff;
  --mystic-accent: #9d4edd;
  --mystic-glow: rgba(157, 78, 221, 0.6);
  --mystic-white: #f8f4ff;
  --mystic-gray: #bda9d4;

  /* Typography */
  --font-logo: "Moralana", serif;
  --font-body: "KingthingsPetrock", sans-serif;
  --font-nav: var(--font-body);

  /* Header sizing */
  --logo-size: clamp(2.55rem, 4.4vw, 3.7rem);
  --nav-size: 1.12rem;

  /* Background art */
  --bg-overlay-top: rgba(40, 12, 78, 0.34);
  --bg-overlay-bottom: rgba(16, 3, 34, 0.45);
  --bg-image-main: url("../images/Witchcraft table sce.png");
  --bg-image-fallback: url("../assets/images/Witchcraft table sce.png");

  /* Button frame art */
  --button-frame-main: url("../images/Mystical%20purple%20cele.png");
  --button-frame-fallback: url("../assets/images/Mystical%20purple%20cele.png");
}

@font-face {
  font-family: "Moralana";
  src:
    url("../Fonts/Moralana%20DEMO.otf") format("opentype"),
    url("../assets/Fonts/Moralana%20DEMO.otf") format("opentype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "KingthingsPetrock";
  src: url("../Fonts/Kingthings Petrock.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

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

html,
body {
  min-height: 100%;
}

body {
  background:
    linear-gradient(var(--bg-overlay-top), var(--bg-overlay-bottom)),
    var(--bg-image-main) center / cover fixed no-repeat,
    var(--bg-image-fallback) center / cover fixed no-repeat;
  background-attachment: fixed;
  color: var(--mystic-white);
  font-family: var(--font-body);
  font-size: 1.03rem;
  line-height: 1.6;
  overflow-x: hidden;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main,
section,
article {
  margin-left: auto;
  margin-right: auto;
  text-align: center;
}

main {
  flex: 1 0 auto;
  width: 100%;
}

main > *,
section > *,
article > * {
  margin-left: auto;
  margin-right: auto;
}

/* Header */
header {
  width: 100%;
  padding: 20px 40px;
  background: transparent;
  backdrop-filter: none;
  border-bottom: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
}

header .logo {
  font-family: var(--font-logo);
  font-size: var(--logo-size);
  font-weight: 700;
  color: var(--mystic-light);
  letter-spacing: 0.7px;
  text-shadow: 0 0 12px rgba(157, 78, 221, 1), 0 0 28px rgba(157, 78, 221, 0.82);
  margin-bottom: 15px;
}

nav {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 30px;
}

nav a {
  color: var(--mystic-white);
  text-decoration: none;
  font-size: var(--nav-size);
  font-family: var(--font-nav);
  letter-spacing: 0.3px;
  transition: 0.3s;
  position: relative;
}

nav a:hover {
  color: var(--mystic-light);
  text-shadow: 0 0 8px var(--mystic-glow);
}

.header-checkout-link {
  display: inline;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

/* Fixed Cart Icon — top right corner */
#cart-icon-fixed {
  position: fixed;
  top: 16px;
  right: 20px;
  z-index: 9999;
  width: 68px;
  height: 68px;
  display: block;
  text-decoration: none;
}

#cart-icon-fixed img {
  width: 68px;
  height: 68px;
  filter: drop-shadow(0 0 8px rgba(157, 78, 221, 0.85));
  transition: transform 0.2s ease, filter 0.2s ease;
}

#cart-icon-fixed:hover img {
  transform: scale(1.1);
  filter: drop-shadow(0 0 16px rgba(157, 78, 221, 1));
}

#cart-icon-fixed .cart-count {
  display: none;
  position: absolute;
  top: 2px;
  right: 2px;
  background: #d4a0ff;
  color: #0b0014;
  font-size: 0.72rem;
  font-weight: 800;
  min-width: 20px;
  height: 20px;
  border-radius: 50%;
  align-items: center;
  justify-content: center;
  font-family: "KingthingsPetrock", serif;
  box-shadow: 0 0 6px rgba(157, 78, 221, 1);
  text-align: center;
  line-height: 20px;
}

/* Small right search under cart */
#mystic-right-search {
  position: fixed;
  top: 92px;
  right: 20px;
  z-index: 9998;
  width: 178px;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px;
  border-radius: 999px;
  border: 1px solid rgba(216, 180, 255, 0.85);
  background: linear-gradient(180deg, rgba(55, 14, 107, 0.9), rgba(35, 7, 72, 0.9));
  box-shadow: 0 0 14px rgba(157, 78, 221, 0.68);
}

#mystic-right-search input {
  width: 100%;
  min-width: 0;
  padding: 7px 9px;
  border-radius: 999px;
  border: 1px solid rgba(216, 180, 255, 0.75);
  background: rgba(26, 4, 53, 0.7);
  color: var(--mystic-white);
  font-family: "KingthingsPetrock", sans-serif;
  font-size: 0.9rem;
}

#mystic-right-search input::placeholder {
  color: rgba(248, 244, 255, 0.8);
}

#mystic-right-search input:focus {
  outline: none;
  border-color: var(--mystic-light);
  box-shadow: 0 0 8px rgba(157, 78, 221, 0.72);
}

#mystic-right-search button {
  flex: 0 0 auto;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid rgba(216, 180, 255, 0.85);
  background: rgba(33, 5, 65, 0.9);
  color: var(--mystic-light);
  font-size: 0.95rem;
  line-height: 1;
  cursor: pointer;
}

#mystic-right-search button:hover {
  box-shadow: 0 0 8px rgba(157, 78, 221, 0.85);
}

/* Hero section */
.hero {
  width: 100%;
  padding: 72px 30px;
  text-align: center;
  background: linear-gradient(
    180deg,
    rgba(106, 13, 173, 0.4),
    rgba(11, 0, 20, 1)
  );
}

.hero h1 {
  font-family: var(--font-logo);
  font-size: 3.5rem;
  color: var(--mystic-light);
  text-shadow: 0 0 12px rgba(157, 78, 221, 0.92), 0 0 24px rgba(157, 78, 221, 0.72);
}

.hero p {
  font-family: var(--font-body);
  margin-top: 20px;
  font-size: 1.3rem;
  color: var(--mystic-gray);
}

.hero-home {
  background: transparent;
  min-height: calc(100vh - 200px);
  padding: 20px 24px 14px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.home-intro {
  width: 100%;
  padding: 26px 24px 14px;
  text-align: center;
  background: transparent;
}

.magical-poem {
  max-width: 720px;
  margin: 0 auto;
  text-align: center;
  font-size: clamp(1.1rem, 2.05vw, 1.32rem);
  line-height: 1.58;
  color: #d9b8ff;
  text-shadow: 0 0 10px rgba(212, 181, 255, 0.62), 0 0 20px rgba(157, 78, 221, 0.52);
  font-family: var(--font-body);
}

.magical-poem p + p {
  margin-top: 3px;
}

.hero-enter-wrap {
  text-align: center;
  margin-top: 8px;
}

/* =============================================
   BUTTONS — all share the mystical frame image
   ============================================= */
.btn,
.checkout-btn,
.upload-btn,
.mystical-button,
.btn-secondary,
.btn-small,
.btn-remove-upload {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 8px;
  padding: 0 24px;
  height: 52px;
  min-width: 160px;
  background-image: url('../images/Mystical%20purple%20cele.png');
  background-size: 100% 100%;
  background-repeat: no-repeat;
  background-position: center;
  background-color: transparent;
  color: #fff;
  border: none;
  border-radius: 0;
  text-decoration: none;
  font-size: 0.9rem;
  font-family: var(--font-body);
  letter-spacing: 0.5px;
  cursor: pointer;
  transition: transform 0.18s ease, filter 0.18s ease;
  filter: drop-shadow(0 0 6px rgba(157, 78, 221, 0.8));
  text-shadow: 0 0 8px rgba(216, 180, 255, 0.9), 0 1px 3px rgba(0,0,0,0.9);
  white-space: nowrap;
}

.btn:hover,
.checkout-btn:hover,
.upload-btn:hover,
.mystical-button:hover,
.btn-secondary:hover,
.btn-small:hover,
.btn-remove-upload:hover {
  transform: translateY(-2px) scale(1.04);
  filter: drop-shadow(0 0 16px rgba(157, 78, 221, 1)) drop-shadow(0 0 4px rgba(255,200,255,0.6));
}

/* Footer */
footer {
  margin-top: auto;
  padding: 40px;
  text-align: center;
  color: var(--mystic-gray);
  border-top: 1px solid var(--mystic-accent);
  background: rgba(56, 18, 99, 0.12);
}

@media (max-width: 980px) {
  #mystic-right-search {
    top: 88px;
    width: 164px;
  }

  #mystic-right-search input {
    font-size: 0.85rem;
  }
}

/* ── Mobile: prevent cart/search overlapping nav ── */
@media (max-width: 768px) {
  /* Tighten header padding on mobile */
  header {
    padding: 14px 16px;
  }

  header .logo {
    margin-bottom: 8px;
  }

  nav {
    gap: 14px;
  }

  nav a {
    font-size: 0.88rem;
  }

  /* Move cart to bottom-right corner so it never overlaps nav */
  #cart-icon-fixed {
    top: auto;
    bottom: 18px;
    right: 14px;
    width: 52px;
    height: 52px;
  }

  #cart-icon-fixed img {
    width: 52px;
    height: 52px;
  }

  /* Hide fixed search bar on mobile — too cramped at top */
  #mystic-right-search {
    display: none;
  }
}