:root {
  --saffron: #ff9933;
  --saffron-soft: #ffd19c;
  --navy: #001f3f;
  --navy-soft: #123b64;
  --cream: #fffaf2;
  --text: #1f2a37;
  --white: #ffffff;
  --shadow: 0 14px 32px rgba(0, 31, 63, 0.14);
  --radius: 18px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  font-family: "Lora", "Segoe UI", serif;
  background: radial-gradient(circle at 15% 25%, #ffe8cc, transparent 40%),
    radial-gradient(circle at 80% 0%, #bcd3ee, transparent 35%),
    linear-gradient(160deg, #fffdf9 0%, #f8fbff 100%);
  color: var(--text);
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  max-width: 100%;
  display: block;
}

.container {
  gap: 3rem;
  width: min(1200px, 92%);
  margin: 0 auto;
}

.checkout-page {
  padding-bottom: 1.5rem;
}

.checkout-intro {
  margin: 0 0 1rem;
  color: #5a6a7a;
}

.checkout-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(320px, 0.75fr);
  gap: 1.1rem;
  align-items: start;
}

.checkout-form-panel,
.checkout-summary-panel {
  background: var(--white);
  border: 1px solid rgba(0, 31, 63, 0.1);
  box-shadow: var(--shadow);
}

.checkout-form {
  display: grid;
  gap: 1.15rem;
}

.checkout-grid {
  display: grid;
  gap: 0.95rem 0.9rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.checkout-grid .full-width {
  grid-column: 1 / -1;
}

.checkout-grid .form-field {
  display: grid;
  gap: 0.35rem;
  align-content: start;
}

.checkout-grid .form-field span {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--navy);
  letter-spacing: 0.01em;
}

.checkout-grid .form-control {
  width: 100%;
  background: #fff;
  border: 1px solid rgba(0, 31, 63, 0.18);
  border-radius: 14px;
  min-height: 48px;
  padding: 0.72rem 0.9rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.checkout-grid .form-control:focus {
  outline: none;
  border-color: rgba(255, 153, 51, 0.75);
  box-shadow: 0 0 0 4px rgba(255, 153, 51, 0.16);
}

.checkout-notes {
  min-height: 120px;
  resize: vertical;
}

.checkout-actions {
  display: grid;
  gap: 0.65rem;
  align-items: start;
}

.checkout-actions .btn {
  width: 100%;
  min-height: 52px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.checkout-message {
  margin: 0;
  color: #5a6a7a;
}

.section-heading {
  font-family: "Cinzel", serif;
  color: var(--navy);
  margin: 0 0 0.85rem;
}

.checkout-summary-list {
  display: grid;
  gap: 0.8rem;
}

.checkout-summary-panel {
  position: sticky;
  top: 92px;
}

.checkout-summary-item {
  display: grid;
  grid-template-columns: 64px 1fr auto;
  gap: 0.8rem;
  align-items: center;
  padding: 0.7rem;
  border-radius: 14px;
  background: rgba(0, 31, 63, 0.03);
}

.checkout-summary-item img {
  width: 64px;
  height: 64px;
  object-fit: cover;
  border-radius: 12px;
}

.checkout-summary-copy {
  display: grid;
  gap: 0.2rem;
}

.checkout-summary-copy strong {
  color: var(--navy);
}

.checkout-summary-copy span {
  color: #5a6a7a;
  font-size: 0.92rem;
}

.checkout-summary-total {
  font-weight: 700;
  color: var(--navy);
}

.checkout-summary-totals {
  background: rgba(0, 31, 63, 0.03);
  border-radius: 14px;
  padding: 0.9rem;
}

.checkout-summary-totals > div {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.35rem 0;
}

.checkout-grand-total {
  border-top: 1px solid rgba(0, 31, 63, 0.12);
  margin-top: 0.35rem;
  padding-top: 0.65rem !important;
  font-size: 1.04rem;
}

.empty-state {
  margin: 0;
  color: #5a6a7a;
}

.checkout-summary-panel .empty-state {
  border: 1px dashed rgba(0, 31, 63, 0.18);
  border-radius: 14px;
  padding: 1rem;
  text-align: center;
  background: linear-gradient(180deg, rgba(0, 31, 63, 0.03), rgba(255, 255, 255, 0));
}
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(8px);
  background: rgba(255, 255, 255, 0.9);
  border-bottom: 1px solid rgba(0, 31, 63, 0.08);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 76px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-family: "Cinzel", serif;
  font-size: 1.1rem;
  color: var(--navy);
  flex: 0 1 auto;
  min-width: 0;
}

.brand strong {
  display: block;
  white-space: normal;
  word-break: keep-all;
  line-height: 1.2;
}

.brand-logo {
  width: 64px;
  height: 64px;
  object-fit: contain;
  border-radius: 50%;
  flex: 0 0 auto;
}

.brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--white);
  font-weight: 700;
  background: linear-gradient(150deg, var(--saffron), #e56b1f);
  box-shadow: var(--shadow);
}

.nav-links {
  display: flex;
  gap: 0.35rem;
  flex-wrap: nowrap;
  align-items: center;
}

.nav-links a {
  padding: 0.5rem 0.85rem;
  border-radius: 999px;
  font-size: 0.95rem;
  color: var(--navy);
  white-space: nowrap;
}

.nav-links a:hover,
.nav-links a.active {
  background: rgba(255, 153, 51, 0.2);
}

.nav-feature {
  background: linear-gradient(135deg, var(--saffron), #ffb25c);
  color: #fff;
  font-weight: 700;
  box-shadow: 0 8px 18px rgba(255, 153, 51, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.35);
}

.nav-feature:hover,
.nav-feature.active {
  background: linear-gradient(135deg, #ff8a1f, #ffb25c);
  color: #fff;
  box-shadow: 0 10px 22px rgba(255, 138, 31, 0.38);
}

.nav-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0.72rem 1.15rem;
  border-radius: 999px;
  white-space: nowrap;
  flex: 0 0 auto;
}

.nav-cta::before {
  content: "";
  width: 0.45rem;
  height: 0.45rem;
  margin-right: 0.55rem;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.18);
}

.nav-dropdown {
  position: relative;
  padding-bottom: 10px;
  margin-bottom: -10px;
}

.nav-dropdown > a {
  display: inline-block;
}

.nav-shop {
  position: static;
}

.nav-shop > a::after {
  content: "\25BE";
  font-size: 0.68rem;
  margin-left: 0.38rem;
  opacity: 0.8;
}

.dropdown-menu {
  position: absolute;
  top: calc(100% - 2px);
  left: 0;
  min-width: 220px;
  background: #fff;
  border: 1px solid rgba(0, 31, 63, 0.12);
  border-radius: 14px;
  box-shadow: 0 12px 26px rgba(0, 31, 63, 0.14);
  padding: 0.45rem;
  display: none;
  z-index: 40;
}

.dropdown-menu::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: -12px;
  height: 12px;
}

.dropdown-menu a {
  display: block;
  border-radius: 10px;
  padding: 0.45rem 0.65rem;
  font-size: 0.88rem;
}

.dropdown-menu a:hover {
  background: rgba(255, 153, 51, 0.17);
}

.mega-menu {
  position: fixed;
  top: 74px;
  left: 50%;
  transform: translateX(-50%);
  width: min(960px, calc(100vw - 28px));
  padding: 0.7rem;
  display: none;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.45rem;
  max-height: min(72vh, 560px);
  overflow-y: auto;
  overflow-x: hidden;
  z-index: 80;
  overscroll-behavior: contain;
}

.mega-section {
  background: #fff;
  border: 1px solid rgba(0, 31, 63, 0.08);
  border-radius: 10px;
  padding: 0.46rem;
}

.mega-category {
  display: block;
  color: var(--navy);
  font-weight: 700;
  font-size: 0.82rem;
  margin-bottom: 0.28rem;
}

.mega-subs {
  display: grid;
  gap: 0.08rem;
}

.mega-sub {
  display: block;
  padding: 0.18rem 0.35rem;
  border-radius: 6px;
  font-size: 0.76rem;
  line-height: 1.25;
  color: #334e68;
}

.nav-dropdown:hover .dropdown-menu,
.nav-dropdown:focus-within .dropdown-menu {
  display: block;
}

.nav-shop:hover .mega-menu,
.nav-shop:focus-within .mega-menu {
  display: grid;
}

.search-box {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--white);
  border: 1px solid rgba(0, 31, 63, 0.12);
  border-radius: 999px;
  padding: 0.45rem 0.8rem;
}

.search-box input {
  border: 0;
  outline: none;
  width: 170px;
  font-family: inherit;
  background: transparent;
}

.btn {
  border: 0;
  border-radius: 999px;
  padding: 0.72rem 1.1rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.24s ease, box-shadow 0.24s ease;
}

.btn:hover {
  transform: translateY(-2px);
}

.btn-primary {
  background: linear-gradient(140deg, var(--saffron), #f67d1f);
  color: var(--white);
  box-shadow: 0 8px 20px rgba(245, 132, 45, 0.38);
}

.btn-secondary {
  background: var(--navy);
  color: var(--white);
}

.hero {
  padding: 4rem 0 1.4rem;
  margin-top: 1.4rem;
  margin-bottom: 1.4rem;
}

.hero-shell {
  border-radius: 32px;
  overflow: hidden;
  background: radial-gradient(circle at 18% 22%, rgba(255, 255, 255, 0.08), transparent 24%),
    radial-gradient(circle at 82% 18%, rgba(255, 153, 51, 0.14), transparent 22%),
    linear-gradient(115deg, rgba(0, 31, 63, 0.96), rgba(0, 31, 63, 0.82));
  box-shadow: var(--shadow);
  display: grid;
  gap: 1rem;
  grid-template-columns: 1.4fr 1fr;
  align-items: center;
  min-height: 420px;
}

.hero-copy {
  padding: 2rem 2.4rem;
  color: var(--white);
  max-width: 680px;
}

.hero-school-name {
  margin: 0 0 0.55rem;
  color: rgba(255, 255, 255, 0.92);
  font-family: inherit;
  font-size: clamp(1.15rem, 1.8vw, 1.45rem);
  font-weight: 700;
  letter-spacing: 0.01em;
  text-transform: none;
  opacity: 0.92;
}

.hero-copy h1 {
  margin: 0 0 0.7rem;
  font-family: "Cinzel", serif;
  font-size: clamp(1.8rem, 2.8vw, 2.7rem);
  line-height: 1.15;
}

.hero-copy p {
  color: rgba(255, 255, 255, 0.88);
  line-height: 1.65;
}

.hero-prayer {
  margin-right: 1.4rem;
  background: rgba(255, 153, 51, 0.12);
  border: 1px solid rgba(255, 153, 51, 0.36);
  border-radius: 18px;
  color: var(--white);
  padding: 1.2rem;
  backdrop-filter: blur(4px);
}

section {
  margin: 2.7rem 0;
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 0.8rem;
  margin-bottom: 1.1rem;
}

.section-head h2 {
  margin: 0;
  font-family: "Cinzel", serif;
  color: var(--navy);
  font-size: 1.5rem;
}

.section-head p {
  margin: 0;
  color: #4b5f74;
}

.grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

#bestPicksGrid,
#bestSellersGrid {
  margin-bottom: 2rem;
}

.product-card {
  background: var(--white);
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid rgba(0, 31, 63, 0.08);
  box-shadow: 0 8px 22px rgba(0, 31, 63, 0.08);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.product-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 14px 26px rgba(0, 31, 63, 0.14);
}

.product-image {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  background: #eef3f8;
}

.product-body {
  padding: 0.9rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  flex: 1;
}

.product-title {
  margin: 0;
  font-size: 1rem;
  color: var(--navy);
  line-height: 1.3;
}

.product-meta {
  margin: 0;
  font-size: 0.88rem;
  color: #5a6a7a;
}

.price-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.6rem;
  margin-top: auto;
}

.price-row .btn {
  padding: 0.58rem 0.92rem;
  white-space: nowrap;
}

.price {
  color: var(--saffron);
  font-weight: 700;
  font-size: 1.05rem;
}

.product-detail-layout {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 1.2rem;
  align-items: start;
}

.product-detail-gallery {
  display: grid;
  gap: 0.75rem;
}

.product-detail-image {
  width: 100%;
  border-radius: 16px;
  height: min(65vh, 520px);
  object-fit: contain;
  object-position: center;
  background: #eef3f8;
}

@media (max-width: 760px) {
  .product-detail-image {
    height: min(52vh, 380px);
  }
}

.product-detail-thumbs {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.product-detail-thumb {
  border: 2px solid transparent;
  padding: 0;
  background: transparent;
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  width: 74px;
  height: 74px;
  flex: 0 0 auto;
}

.product-detail-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.product-detail-thumb.active {
  border-color: var(--saffron);
}

.product-detail-copy .page-title {
  margin-top: 0;
}

.product-detail-description {
  line-height: 1.7;
}

.product-detail-price {
  font-size: 1.4rem;
}

.ideas-form {
  display: grid;
  gap: 0.8rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.ideas-form .full-width {
  grid-column: 1 / -1;
}

.ideas-helper {
  margin: 0;
  color: #5a6a7a;
  font-size: 0.92rem;
}

.panel {
  background: var(--white);
  border: 1px solid rgba(0, 31, 63, 0.1);
  border-radius: var(--radius);
  padding: 1rem;
}

.category-button-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin: 1rem 0 1.3rem;
}

.category-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.55rem 1rem;
  border: 1px solid rgba(0, 31, 63, 0.18);
  border-radius: 999px;
  color: var(--navy);
  background: rgba(255, 255, 255, 0.86);
  transition: all 0.2s ease;
}

.category-pill:hover,
.category-pill.active {
  background: rgba(255, 153, 51, 0.2);
  border-color: rgba(255, 153, 51, 0.55);
}

#categoryPreviewSections {
  display: grid;
  gap: 1rem;
}

.category-preview-panel {
  margin-bottom: 0.2rem;
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-bottom: 1rem;
}

.filters select,
.filters input,
.form-control,
textarea {
  border: 1px solid rgba(0, 31, 63, 0.2);
  border-radius: 12px;
  padding: 0.62rem 0.75rem;
  font: inherit;
  min-height: 40px;
}

.page-title {
  font-family: "Cinzel", serif;
  color: var(--navy);
  margin-bottom: 0.35rem;
}

.cart-item {
  display: grid;
  grid-template-columns: 80px 1fr auto;
  gap: 1rem;
  padding: 0.8rem 0;
  border-bottom: 1px solid rgba(0, 31, 63, 0.1);
}

.cart-summary {
  margin-top: 1rem;
  display: grid;
  gap: 0.7rem;
}

.footer {
  margin-top: 3rem;
  background: linear-gradient(130deg, #001f3f, #143f6a);
  color: rgba(255, 255, 255, 0.92);
  padding: 2rem 0;
}

.reveal {
  animation: revealUp 0.6s ease both;
}

@keyframes revealUp {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 1024px) {
  .grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .hero-shell {
    grid-template-columns: 1fr;
  }

  .hero-prayer {
    margin: 0 2rem 2rem;
  }
}

@media (max-width: 760px) {
  .topbar {
    position: static;
  }

  .container {
    width: min(1200px, 95%);
  }

  .nav {
    flex-direction: column;
    align-items: stretch;
    gap: 0.65rem;
    min-height: 0;
    padding: 0.65rem 0;
  }

  .brand {
    justify-content: center;
  }

  .brand-logo {
    width: 54px;
    height: 54px;
  }

  .nav-links {
    justify-content: flex-start;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 0.2rem;
    scrollbar-width: thin;
  }

  .nav-cta {
    width: 100%;
    margin: 0.1rem 0 0.15rem;
  }

  .nav-links a {
    flex: 0 0 auto;
    padding: 0.45rem 0.75rem;
    font-size: 0.9rem;
  }

  .nav-dropdown {
    width: auto;
    text-align: left;
    flex: 0 0 auto;
  }

  .dropdown-menu {
    position: static;
    display: none;
    margin-top: 0.35rem;
    min-width: unset;
    width: 100%;
  }

  .mega-menu {
    position: static;
    top: auto;
    width: 100%;
    max-height: 300px;
    overflow: auto;
    grid-template-columns: 1fr;
    transform: none;
    left: 0;
  }

  .nav-dropdown:hover .dropdown-menu,
  .nav-dropdown:focus-within .dropdown-menu {
    display: block;
  }

  .search-box input {
    min-width: 0;
    width: 100%;
  }

  .search-box {
    width: 100%;
    padding: 0.38rem 0.55rem;
  }

  .search-box .btn {
    padding: 0.5rem 0.8rem;
    flex: 0 0 auto;
  }

  .grid {
    grid-template-columns: 1fr;
  }

  .checkout-layout,
  .checkout-grid {
    grid-template-columns: 1fr;
  }

  .checkout-summary-panel {
    position: static;
    top: auto;
  }

  .checkout-summary-item {
    grid-template-columns: 56px 1fr;
  }

  .checkout-summary-total {
    grid-column: 2;
  }

  .hero-copy {
    padding: 1.4rem;
  }

  .product-detail-layout {
    grid-template-columns: 1fr;
    gap: 0.9rem;
  }

  .ideas-form {
    grid-template-columns: 1fr;
  }

  .hero {
    padding: 1rem 0 0.7rem;
    margin-top: 0.7rem;
    margin-bottom: 1rem;
  }

  .hero-shell {
    border-radius: 20px;
    min-height: 0;
  }

  .hero-prayer {
    margin: 0 1rem 1rem;
    padding: 1rem;
  }

  section {
    margin: 1.8rem 0;
  }

  .section-head {
    align-items: flex-start;
    flex-direction: column;
    margin-bottom: 0.8rem;
  }

  .panel {
    padding: 0.82rem;
  }

  .filters > * {
    min-width: 0;
    width: 100%;
  }

  .price-row {
    align-items: stretch;
    flex-wrap: wrap;
  }

  .price-row .btn {
    text-align: center;
    width: 100%;
  }

  .cart-summary .btn {
    width: 100%;
  }

  .category-button-bar {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 0.25rem;
    -webkit-overflow-scrolling: touch;
  }

  .category-pill {
    flex: 0 0 auto;
    white-space: nowrap;
  }

  #bestPicksGrid,
  #bestSellersGrid {
    margin-bottom: 1.2rem;
  }

  .cart-item {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 1200px) {
  .mega-menu {
    width: min(880px, calc(100vw - 20px));
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .mega-menu {
    width: min(760px, calc(100vw - 18px));
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 480px) {
  .grid {
    grid-template-columns: 1fr;
  }
}

/* Toast Notifications */
.toast {
  position: relative;
  padding: 1rem 1.5rem;
  border-radius: var(--radius);
  font-size: 0.95rem;
  font-weight: 500;
  max-width: min(90vw, 400px);
  word-wrap: break-word;
  box-shadow: var(--shadow);
  animation: slideIn 0.3s ease-out forwards;
  margin-bottom: 0.5rem;
}

.toast-success {
  background-color: #22c55e;
  color: white;
}

.toast-error {
  background-color: #ef4444;
  color: white;
}

@keyframes slideIn {
  from {
    transform: translateX(100px);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* Loading States */
.loading {
  opacity: 0.7;
  pointer-events: none;
}

.spinner {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 200px;
}

.spinner-ring {
  display: inline-block;
  position: relative;
  width: 50px;
  height: 50px;
  animation: spin 1.2s cubic-bezier(0.5, 0, 0.5, 1) infinite;
}

.spinner-ring::after {
  content: " ";
  display: block;
  position: absolute;
  width: 40px;
  height: 40px;
  margin: 5px;
  border-radius: 50%;
  border: 5px solid var(--saffron);
  border-color: var(--saffron) transparent transparent transparent;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}
