/* --- 1. CSS VARIABLES & RESET --- */
@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@400;500&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;500&family=Roboto+Mono:wght@400;500&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital@1&family=Roboto:wght@300;400;500&family=Roboto+Mono:wght@400;500&display=swap');

@font-face {
    font-family: 'OWSans300';
    src: url('../assets/fonts/OWSans300.woff2') format('woff2');
    font-weight: 300;
    font-style: normal;
}

@font-face {
    font-family: 'OWSans700';
    src: url('../assets/fonts/OWSans700.woff2') format('woff2');
    font-weight: 700;
    font-style: normal;
}
:root {
  --stone-50: #f8f9fa;
  --stone-100: #f1f3f5;
  --stone-200: #e9ecef;
  --stone-300: #dee2e6;
  --stone-400: #ced4da;
  --stone-500: #adb5bd;
  --stone-600: #6c757d;
  --stone-700: #495057;
  --stone-800: #343a40;
  --stone-900: #212529;
  --red-50: #fef2f2;
  --red-100: #fee2e2;
  --red-500: #ef4444;
  --red-700: #b91c1c;
  --red-800: #991b1b;
  
  --font-sans: 'Inter', Helvetica, Arial, sans-serif;
  --font-serif: 'Palash', Georgia, serif;
}

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

body {
  font-family: var(--font-sans);
  background-color: white;
  color: var(--stone-900);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -ms-overflow-style: none;
  scrollbar-width: none;
}

body::-webkit-scrollbar {
  display: none;
}


button, input, select {
  font-family: inherit;
  border: none;
  background: none;
  outline: none;
}

button { cursor: pointer; }
a { text-decoration: none; color: inherit; }



/* --- 2. LAYOUT & TYPOGRAPHY --- */
.container {
  max-width: 1152px; /* 72rem / 6xl */
  margin: 0 auto;
  padding: 0 1rem;
}

.text-center { text-align: center; }
.font-serif { font-family: var(--font-serif); }
.hidden { display: none !important; }

/* --- 3. HEADER & HERO --- */
.side-cart-toggle {
  position: fixed;
  top: 4rem;
  right: 0;
  background-color: #f5f5f5;
  color: var(--stone-900);
  font-family: 'Roboto Mono', monospace;
  padding: 1.5rem 0.5rem;
  font-size: 0.875rem;
  font-weight: 400;
  letter-spacing: 0.1em;
  border-radius: 0.7rem 0 0 0.7rem;
  border: 1px solid var(--stone-200);
  border-right: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: -4px 4px 15px rgba(0,0,0,0.05);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), background-color 0.15s;
  z-index: 60;
}

.side-cart-toggle:hover {
  background-color: #e5e5e5;
}

.cart-tab-text {
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  display: inline-block;
}

.side-cart-toggle:not(.is-open):hover {
  background-color: #e5e5e5;
  transform: translateX(-10px);
}

.side-cart-toggle.is-open {
  transform: translateX(-100vw);
  background-color: #f5f5f5 !important;
}
@media (min-width: 24rem) {
  .side-cart-toggle.is-open {
    transform: translateX(-24rem);
  }
}

.side-cart-toggle:not(.is-open):hover ~ .cart-panel {
  transform: translateX(calc(100% - 10px));
}

.side-cart-toggle.scrolled-past-hero:not(.is-open) {
  background-color: #ffa7dd;
}

.main-content {
  padding: 3rem 1rem;
  min-height: 100vh;
}

/* --- 3.5 NEW FULLSCREEN HERO --- */
.hero {
    position: relative;
    height: 110vh;
    width: 100%;
    background-color: #a9c7d1;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}


.hero::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 30vh;
    background: linear-gradient(to bottom, rgba(169, 199, 209, 0) 0%, rgba(255, 255, 255, 1) 100%);
    z-index: 2;
    pointer-events: none;
}

.hero-content {
    position: relative;
    z-index: 3;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    padding: 0 1.5rem;
    text-align: center;
    width: 100vw;
    will-change: opacity, transform;
}

.hero-logo {
    width: 50%;
    height: auto;
    filter: brightness(0) invert(1);
    max-width: 850px;
    min-width: 300px;
}

.hero-text {
    font-family: 'Roboto', sans-serif;
    color: white;
    font-size: clamp(0.75rem, 3.5vw, 2.15rem);
    line-height: 1.6;
    margin-top: clamp(1vw, 2vw, 3vw);
    font-weight: 300;
    white-space: nowrap;
}

/* --- ANIMATED CLOUDS --- */
.cloud {
    position: absolute;
    background-size: contain;
    background-repeat: no-repeat;
    z-index: 1;
}

/* The animation: Move across the screen while swelling up to 1.1x size and shrinking back */
@keyframes driftAndSwell {
    0% { transform: translateX(-100%) scale(1); }
    50% { transform: translateX(50vw) scale(1.15); }
    100% { transform: translateX(100vw) scale(1); }
}

@keyframes driftAndSwellReverse {
    0% { transform: translateX(100vw) scale(1); }
    50% { transform: translateX(50vw) scale(1.15); }
    100% { transform: translateX(-100%) scale(1); }
}

.cloud-1 {
    background-image: url('../assets/images/cloud1.png');
    width: 1050px;
    height: 550px;
    top: 10%;
    animation: driftAndSwell 60s linear infinite -15s;
    left: 0px;
}

.cloud-2 {
    background-image: url('../assets/images/cloud2.png');
    width: 950px;
    height: 550px;
    top: 40%;
    right: 0px;
    animation: driftAndSwellReverse 80s linear infinite -50s;
}

.cloud-3 {
    background-image: url('../assets/images/cloud3.png');
    width: 750px;
    height: 550px;
    top: 70%;
    left: 0px;
    animation: driftAndSwell 50s linear infinite -5s;
}

.cloud-4 {
    background-image: url('../assets/images/cloud4.png');
    width: 1250px;
    height: 620px;
    top: -20%;
    right: 0px;
    animation: driftAndSwellReverse 95s linear infinite -75s;
}

/* --- 3.8 STORE CONTROLS (SEARCH & SORT) --- */
.store-controls {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 2.5rem;
    font-family: 'OWSans300', sans-serif;
    text-transform: uppercase;
    font-size: 0.875rem;
    letter-spacing: 0.05em;
}

.store-search {
    font-family: 'OWSans300', sans-serif;
    font-size: 0.875rem;
    text-transform: uppercase;
    border: none;
    border-bottom: 1px solid white; /* Initial white border */
    background: transparent;
    padding: 0.25rem 0;
    width: 200px;
    color: var(--stone-900);
    transition: border-color 0.2s ease;
}

.store-search::placeholder { color: var(--stone-900); }
.store-search:hover, .store-search:focus {
    border-bottom-color: var(--stone-900); /* Turns black on hover/focus */
    outline: none;
}

.custom-sort-wrapper { position: relative; }

.sort-toggle-btn {
    font-family: 'OWSans300', sans-serif;
    text-transform: uppercase;
    background: transparent;
    border: none;
    color: var(--stone-900);
    letter-spacing: 0.05em;
    font-size: 0.875rem;
    padding: 0.25rem 0;
}

.sort-menu {
    position: absolute;
    top: 100%;
    right: 0;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.75rem;
    padding-top: 1rem;
    padding-bottom: 15px;
    padding-left: 15px;
    background-color: white;
    z-index: 20;
    min-width: max-content;
}

.sort-option {
    font-family: 'OWSans300', sans-serif;
    text-transform: uppercase;
    background: transparent;
    border: none;
    color: var(--stone-700); /* Options start gray */
    font-size: 0.875rem;
    letter-spacing: 0.05em;
    transition: color 0.15s ease;
}

.sort-option:hover { color: var(--stone-900); } /* Turn black on hover */

/* --- 4. BOOK GRID & CARDS --- */
.book-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

@media (min-width: 768px) { .book-grid { grid-template-columns: repeat(3, 1fr); gap: 2rem; } }

.book-card { display: flex; flex-direction: column; gap: 1rem; }
.book-image-wrap {
  background-color: var(--stone-200);
  aspect-ratio: 2/3;
  width: 100%;
  border-radius: 0.125rem;
  overflow: hidden;
}
.book-image-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.book-image-wrap img.out-of-stock {
  opacity: 0.6;
  filter: grayscale(100%);
}

.book-title { font-size: 1.125rem; line-height: 1.25; margin-bottom: 0.25rem; }
.book-author { color: var(--stone-500); font-size: 0.875rem; margin-bottom: 0.5rem; }
.book-footer { display: flex; justify-content: space-between; align-items: center; }
.book-price { font-weight: 500; }
.book-price.strikethrough { color: var(--stone-400); text-decoration: line-through; }

.btn-add-cart {
  background-color: white;
  color: black;
  font-family: 'Inter', sans-serif;
  font-size: 1rem;
  text-transform: uppercase;
  border: 1px solid black;
  border-radius: 9999px;
  padding: 0.25rem 0.75rem;
  transition: background-color 0.15s;
}
.btn-add-cart:hover { 
  background-color: #c9d672; 
  color: #30804e;
  border-color: #30804e;
}
.sold-out-text { font-size: 0.75rem; color: var(--stone-500); font-style: italic; padding: 0.25rem 0.5rem; }

/* --- 5. CART DRAWER --- */
.cart-overlay {
  position: fixed;
  inset: 0;
  background-color: rgba(33, 37, 41, 0.5);
  z-index: 50;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}
.cart-overlay.is-open { opacity: 1; pointer-events: auto; }

.cart-panel {
  position: fixed;
  top: 0; right: 0;
  height: 100%;
  width: 100%;
  max-width: 24rem;
  background-color: var(--stone-50);
  box-shadow: 0 25px 50px -12px rgba(0,0,0,0.25);
  z-index: 50;
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
}
.cart-panel.is-open { transform: translateX(0); }

.cart-header {
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--stone-200);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: white;
}
.cart-header h2 { font-size: 1.25rem; }
.cart-close { font-size: 1.5rem; color: var(--stone-400); }
.cart-close:hover { color: var(--stone-900); }

.cart-body {
  flex: 1;
  overflow-y: auto;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.cart-item {
  display: flex;
  gap: 1rem;
  border-bottom: 1px solid var(--stone-100);
  padding-bottom: 1rem;
}
.cart-item-img {
  width: 60px; height: 90px;
  background-color: var(--stone-200);
  border-radius: 0.125rem;
  border: 1px solid var(--stone-100);
  overflow: hidden;
  flex-shrink: 0;
}
.cart-item-img img { width: 100%; height: 100%; object-fit: cover; }
.cart-item-details { flex: 1; display: flex; flex-direction: column; justify-content: space-between; }
.cart-item-header { display: flex; justify-content: space-between; align-items: flex-start; }
.cart-item-title { line-height: 1.25; padding-right: 0.5rem; font-family: 'OWSans300', sans-serif; }
.cart-item-remove { color: var(--stone-400); font-size: 1.125rem; line-height: 1; }
.cart-item-remove:hover { color: var(--red-500); }
.cart-item-meta { font-size: 0.95rem; color: var(--stone-700); margin-top: 0.25rem; font-family: 'Cormorant Garamond', serif; font-style: italic;}
.cart-item-footer { display: flex; justify-content: space-between; align-items: center; margin-top: 0.5rem; }

.qty-control {
  display: flex;
  align-items: center;
  border: 1px solid var(--stone-200);
  border-radius: 0.125rem;
}
.qty-btn {
  padding: 0 0.5rem;
  color: var(--stone-500);
  background-color: var(--stone-50);
}
.qty-btn:hover { color: var(--stone-900); }
.qty-num { font-size: 0.75rem; font-weight: 500; padding: 0 0.5rem; }

.cart-footer {
  padding: 1.5rem;
  background-color: white;
  border-top: 1px solid var(--stone-200);
}
.cart-subtotal-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1.5rem; }
.cart-subtotal-label, .cart-subtotal-value { font-family: 'OWSans700', sans-serif; font-size: 1.125rem; color: black; }

.btn-checkout {
  display: block;
  width: 100%;
  text-align: center;
  padding: 0.75rem;
  background-color: #5d824a;
  color: #fffbc6;
  font-family: 'OWSans300', sans-serif;
  border-radius: 9999px;
  border: none;
  transition: all 0.2s ease;
  font-size: 1rem;
}

.btn-checkout:hover:not(:disabled) {
  background-color: #c9d672;
  color: #30804e;
}


.btn-primary {
  display: block;
  width: 100%;
  text-align: center;
  padding: 0.75rem;
  border-radius: 0.125rem;
  background-color: var(--stone-900);
  color: white;
  font-weight: 500;
  transition: background-color 0.15s, opacity 0.15s;
}
.btn-primary:hover { background-color: var(--stone-800); }
.btn-primary:disabled { opacity: 0.5; pointer-events: none; }

/* --- 6. CHECKOUT MODAL --- */
.checkout-modal {
  position: fixed;
  inset: 0;
  background-color: white;
  z-index: 60;
  overflow-y: auto;
}

.checkout-header {
  background-color: white;
  border-bottom: 1px solid var(--stone-200);
  padding: 1rem 1.5rem;
  position: sticky;
  top: 0;
  z-index: 20;
}
.checkout-header-inner { position: relative; display: flex; align-items: center; justify-content: center; }
.btn-back { position: absolute; left: 0; display: flex; align-items: center; gap: 0.5rem; color: var(--stone-500); font-weight: 500; font-size: 0.875rem; }
.btn-back:hover { color: var(--stone-900); }

.checkout-layout {
  display: grid;
  grid-template-columns: 1fr;
  min-height: calc(100vh - 61px);
}
@media (min-width: 1024px) { .checkout-layout { grid-template-columns: 7fr 5fr; } }

.checkout-form-side { padding: 2rem; background-color: white; }
@media (min-width: 1024px) { .checkout-form-side { padding-right: 3rem; } }

.checkout-section { margin-bottom: 2rem; }
.checkout-section-title { font-size: 1.125rem; margin-bottom: 1rem; border-bottom: 1px solid var(--stone-200); padding-bottom: 0.5rem; }

.form-grid { display: grid; grid-template-columns: 1fr; gap: 1rem; }
@media (min-width: 768px) { .form-grid { grid-template-columns: 1fr 1fr; } }
.col-full { grid-column: 1 / -1; }

.form-input, .form-select {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid var(--stone-300);
  border-radius: 0.125rem;
  font-size: 0.875rem;
  background-color: white;
}
.form-input:focus, .form-select:focus { border-color: var(--stone-900); }

.radio-card {
  display: flex;
  align-items: center;
  padding: 1rem;
  border: 1px solid var(--stone-300);
  border-radius: 0.125rem;
  cursor: pointer;
  margin-bottom: 0.75rem;
  transition: background-color 0.15s;
}
.radio-card:hover { background-color: var(--stone-50); }
.radio-card input { margin-right: 1rem; accent-color: var(--stone-900); }
.radio-label { flex: 1; }
.radio-title { display: block; font-weight: 500; font-size: 0.875rem; }
.radio-desc { font-size: 0.75rem; color: var(--stone-500); }

.info-box { background-color: var(--stone-100); padding: 1.5rem; border: 1px solid var(--stone-200); border-radius: 0.125rem; font-size: 0.875rem; color: var(--stone-700); }
.info-box p { margin-bottom: 0.5rem; }
.text-danger { color: var(--red-700); font-weight: 500; }

.checkbox-label { display: flex; align-items: flex-start; margin-top: 1rem; cursor: pointer; }
.checkbox-label input { margin-top: 0.25rem; margin-right: 0.75rem; accent-color: var(--stone-900); }
.checkbox-label span { font-size: 0.75rem; color: var(--stone-600); line-height: 1.6; }

.checkout-summary-side { background-color: var(--stone-50); border-top: 1px solid var(--stone-200); }
@media (min-width: 1024px) { .checkout-summary-side { border-top: none; border-left: 1px solid var(--stone-200); } }
.checkout-summary-inner { padding: 2rem; position: sticky; top: 85px; }

#modal-checkout-items {
  margin-bottom: 1.5rem;
  max-height: 45vh;
  overflow-y: auto;
  padding-right: 0.5rem;
  padding-top: 0.75rem;
}

.modal-item { display: flex; gap: 0.75rem; align-items: center; margin-bottom: 1rem; }
.modal-item-img { position: relative; width: 48px; height: 72px; background-color: var(--stone-200); border: 1px solid var(--stone-100); border-radius: 0.125rem; flex-shrink: 0; }
.modal-item-img img { width: 100%; height: 100%; object-fit: cover; border-radius: 0.125rem; }
.modal-item-badge { position: absolute; top: -8px; right: -8px; background-color: var(--stone-900); color: white; font-size: 10px; width: 20px; height: 20px; border-radius: 50%; display: flex; align-items: center; justify-content: center; }
.modal-item-details { flex: 1; padding-left: 0.75rem; }
.modal-item-title { font-weight: 500; font-size: 0.875rem; line-height: 1.25; }
.modal-item-meta { font-size: 10px; color: var(--stone-500); text-transform: uppercase; letter-spacing: 0.05em; margin-top: 0.25rem; }
.modal-item-price { font-weight: 500; font-size: 0.875rem; }

.summary-totals { border-top: 1px solid var(--stone-200); padding-top: 1rem; margin-top: 1.5rem; font-size: 0.875rem; }
.summary-row { display: flex; justify-content: space-between; color: var(--stone-600); margin-bottom: 0.75rem; }
.summary-total-row { display: flex; justify-content: space-between; align-items: center; border-top: 1px solid var(--stone-200); padding-top: 1rem; margin-top: 1rem; font-size: 1.125rem; font-family: var(--font-serif); color: var(--stone-900); }

/* --- 7. FOOTER --- */
.site-footer { background-color: var(--stone-900); color: var(--stone-300); padding: 2rem 1rem; text-align: center; font-size: 0.875rem; }

/* --- 8. PAYMENT PAGE --- */
.payment-main {
  max-width: 56rem; /* 4xl */
  margin: 0 auto;
  padding: 3rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
}

.payment-intro { text-align: center; max-width: 42rem; margin: 0 auto; }
.payment-intro h1 { font-size: 1.875rem; margin-bottom: 1rem; }
.payment-intro p { color: var(--stone-600); margin-bottom: 1rem; line-height: 1.6; }

.payment-grid { display: grid; grid-template-columns: 1fr; gap: 1.5rem; align-items: stretch; }
@media (min-width: 768px) { .payment-grid { grid-template-columns: 1fr 1fr; } }
.items-start { align-items: flex-start; }

.payment-card { padding: 1.5rem; border: 1px solid var(--stone-200); border-radius: 0.125rem; display: flex; flex-direction: column; }
@media (min-width: 768px) { .payment-card { padding: 2rem; } }
.payment-card.bg-stone-100 { background-color: var(--stone-100); }
.payment-card.bg-white { background-color: white; box-shadow: 0 1px 2px 0 rgba(0,0,0,0.05); }

.payment-card-title { font-size: 1.125rem; border-bottom: 1px solid var(--stone-200); padding-bottom: 0.5rem; margin-bottom: 1rem; }

.details-list { display: flex; flex-direction: column; gap: 1rem; color: var(--stone-600); flex: 1; }
.detail-label { display: block; font-size: 0.75rem; color: var(--stone-400); text-transform: uppercase; letter-spacing: 0.05em; }
.detail-value { font-weight: 500; color: var(--stone-900); }

.summary-items { overflow-y: auto; max-height: 10rem; padding-right: 0.5rem; margin-bottom: 1rem; border-bottom: 1px solid var(--stone-200); padding-bottom: 1rem; flex: 1; display: flex; flex-direction: column; gap: 0.75rem; }
.summary-item-row { display: flex; justify-content: space-between; align-items: flex-start; }
.summary-item-info { padding-right: 1rem; }
.summary-item-title { display: block; font-weight: 500; color: var(--stone-900); }
.summary-item-meta { font-size: 0.75rem; color: var(--stone-500); }
.summary-item-price { font-weight: 500; color: var(--stone-900); }

.summary-totals { display: flex; flex-direction: column; gap: 0.5rem; color: var(--stone-600); margin-top: auto; }
.summary-totals-row { display: flex; justify-content: space-between; }
.summary-totals-total { display: flex; justify-content: space-between; align-items: center; font-size: 1.125rem; font-family: var(--font-serif); color: var(--stone-900); padding-top: 1rem; border-top: 1px solid var(--stone-200); margin-top: 0.5rem; }

.express-note { font-size: 0.6875rem; line-height: 1.25; color: var(--stone-500); font-style: italic; margin-top: 0.5rem; background-color: rgba(233,236,239,0.5); padding: 0.5rem; border: 1px solid var(--stone-200); border-radius: 0.125rem; }
.shipping-express-text { color: var(--stone-500); font-style: italic; font-size: 0.75rem; }

.bank-details p { margin-top: 0.75rem; }
.qr-box { text-align: center; border-top: 1px solid var(--stone-100); padding-top: 1rem; margin-top: 1rem; }
.qr-box img { width: 12rem; height: 12rem; border: 1px solid var(--stone-200); padding: 0.5rem; border-radius: 0.125rem; margin: 0 auto; }

.payment-alert { background-color: var(--red-50); color: var(--red-800); padding: 1.5rem; border: 1px solid var(--red-100); border-radius: 0.125rem; font-size: 0.875rem; line-height: 1.6; }

.sticky-col { position: sticky; top: 2rem; display: flex; flex-direction: column; gap: 1.5rem; }

.payment-form-group { display: flex; flex-direction: column; gap: 0.25rem; margin-bottom: 1.5rem; }
.payment-form-label { font-size: 0.875rem; font-weight: 500; color: var(--stone-700); cursor: pointer; }
.payment-form-input { padding: 0.5rem 0.75rem; border: 1px solid var(--stone-200); border-radius: 0.125rem; background-color: var(--stone-100); color: var(--stone-500); font-family: monospace; font-size: 0.875rem; cursor: not-allowed; width: 100%; }
.payment-form-help { font-size: 0.75rem; color: var(--stone-400); }

.upload-box { border: 1px dashed var(--stone-300); padding: 1.5rem; border-radius: 0.125rem; background-color: var(--stone-50); text-align: center; margin-bottom: 1.5rem; }
.upload-input { font-size: 0.875rem; color: var(--stone-500); cursor: pointer; width: 100%; margin: 0 auto; display: block; }
.upload-input::file-selector-button { margin-right: 1rem; padding: 0.5rem 1rem; border-radius: 0.125rem; border: none; font-size: 0.875rem; font-weight: 500; background-color: var(--stone-200); color: var(--stone-800); cursor: pointer; transition: background-color 0.15s; }
.upload-input::file-selector-button:hover { background-color: var(--stone-300); }

.success-message { text-align: center; margin-top: 1.5rem; display: flex; flex-direction: column; gap: 1rem; }
.success-icon { color: #16a34a; font-size: 3rem; line-height: 1; }
.success-link { display: inline-block; margin-top: 1rem; font-size: 0.875rem; font-weight: 500; color: var(--stone-900); border-bottom: 1px solid var(--stone-900); padding-bottom: 0.25rem; transition: color 0.15s, border-color 0.15s; }
.success-link:hover { color: var(--stone-500); border-color: var(--stone-500); }

/* --- 9. ADMIN DASHBOARD --- */
.admin-header { background-color: var(--stone-900); color: var(--stone-100); padding: 1rem 0; box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1); }
.admin-header-inner { display: flex; justify-content: space-between; align-items: center; max-width: 76rem; margin: 0 auto; padding: 0 1rem; width: 100% !important; }
.admin-nav-link { font-size: 0.75rem; color: var(--stone-400); transition: color 0.15s; }
.admin-nav-link:hover { color: white; }
.btn-logout { font-size: 0.75rem; background-color: var(--stone-800); color: white; padding: 0.25rem 0.75rem; border-radius: 0.125rem; transition: background-color 0.15s; }
.btn-logout:hover { background-color: var(--stone-700); }

.admin-main { max-width: 76rem !important; margin: 0 auto; padding: 3rem 1rem; display: flex; flex-direction: column; gap: 3rem; }

.admin-card { background-color: white; padding: 2rem; border: 1px solid var(--stone-200); border-radius: 0.125rem; box-shadow: 0 1px 2px 0 rgba(0,0,0,0.05); }
.admin-card-title { font-size: 1.5rem; margin-bottom: 1.5rem; border-bottom: 1px solid var(--stone-100); padding-bottom: 1rem; }

.upload-row { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.upload-help { font-size: 0.75rem; color: var(--stone-400); margin-top: 0.5rem; }

.imported-books-container { margin-top: 2rem; display: flex; flex-direction: column; gap: 2rem; }
.imported-book-card { padding: 1.5rem; background-color: var(--stone-50); border: 1px solid var(--stone-200); border-radius: 0.125rem; margin-bottom: 1rem; display: flex; flex-direction: column; gap: 1.5rem; }
@media (min-width: 768px) { .imported-book-card { flex-direction: row; } }
.imported-book-info { flex: 1; display: flex; flex-direction: column; gap: 0.5rem; }
.imported-book-title { font-size: 1.125rem; font-weight: bold; }
.imported-book-meta { font-size: 0.875rem; color: var(--stone-600); }
.imported-book-blurb { font-size: 0.75rem; color: var(--stone-500); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.imported-book-cover-wrap { display: flex; flex-direction: column; justify-content: center; width: 100%; border-top: 1px solid var(--stone-200); padding-top: 1.5rem; }
@media (min-width: 768px) { .imported-book-cover-wrap { width: 33.333%; border-top: none; border-left: 1px solid var(--stone-200); padding-top: 0; padding-left: 1.5rem; } }

.single-upload-form { display: flex; flex-direction: column; gap: 1rem; }
.cover-upload-box { background-color: var(--stone-50); padding: 1.5rem; border: 1px dashed var(--stone-300); border-radius: 0.125rem; text-align: center; }
.cover-upload-box label { display: block; font-size: 0.875rem; font-weight: 500; margin-bottom: 0.5rem; }

.admin-table-wrapper { overflow-x: auto; }
.admin-table { width: 100%; text-align: left; font-size: 0.875rem; border-collapse: collapse; white-space: normal; }
.admin-table th { background-color: var(--stone-100); color: var(--stone-600); font-weight: 500; padding: 1rem 1rem; border-bottom: 1px solid var(--stone-200); }
.admin-table td { padding: 1rem 1rem; border-bottom: 1px solid var(--stone-100); vertical-align: middle; }
.admin-table tr:last-child td { border-bottom: none; }
.text-right { text-align: right; }

.status-select { background-color: var(--stone-50); border: 1px solid var(--stone-200); font-size: 0.875rem; padding: 0.25rem 0.5rem; border-radius: 0.125rem; cursor: pointer; outline: none; }
.status-select:focus { border-color: var(--stone-900); }

.action-btn { font-weight: 500; transition: color 0.15s; font-size: 0.875rem; cursor: pointer; }
.action-btn.view { color: var(--stone-500); }
.action-btn.view:hover { color: var(--stone-900); }
.action-btn.notify { color: var(--stone-900); padding-left: 0.75rem; border-left: 1px solid var(--stone-200); margin-left: 0.75rem; }
.action-btn.notify:hover { color: var(--stone-600); }
.action-btn.delete { color: var(--red-700); margin-left: 1rem; }
.action-btn.delete:hover { color: var(--red-800); }

.stock-input { width: 5rem; padding: 0.25rem 0.5rem; border: 1px solid var(--stone-200); border-radius: 0.125rem; text-align: center; }

.receipt-modal-overlay { position: fixed; inset: 0; background-color: rgba(28, 25, 23, 0.8); z-index: 50; display: flex; align-items: center; justify-content: center; padding: 1rem; }
.receipt-modal-box { background-color: white; padding: 1.5rem; border-radius: 0.125rem; max-width: 42rem; width: 100%; position: relative; }
.btn-close-modal { position: absolute; top: 1rem; right: 1rem; font-size: 1.5rem; color: var(--stone-400); transition: color 0.15s; }
.btn-close-modal:hover { color: var(--stone-900); }
.receipt-img { width: 100%; height: auto; max-height: 70vh; object-fit: contain; }


/* --- 10. ADMIN TABS --- */
.admin-tabs-wrapper {
  background-color: white;
  border-bottom: 1px solid var(--stone-200);
}

.admin-tabs-nav {
  display: flex;
  gap: 2rem;
  margin: 0 auto;
  padding: 0 1rem;
  width: 100% !important;
  max-width: 76rem;
}

.admin-tab-btn {
  padding: 1rem 0;
  font-weight: 500;
  color: var(--stone-500);
  border-bottom: 2px solid transparent;
  transition: all 0.15s;
  font-size: 0.875rem;
}

.admin-tab-btn:hover { color: var(--stone-900); }

.admin-tab-btn.active {
  color: var(--stone-900);
  border-bottom-color: var(--stone-900);
}

.admin-tab-content {
  display: flex;
  flex-direction: column;
  gap: 3rem;
}

/* --- 11. EXPANDABLE ORDER ROWS --- */
.admin-table tbody tr.main-order-row { transition: background-color 0.15s; cursor: pointer; }
.admin-table tbody tr.main-order-row:hover { background-color: var(--stone-50); }

.btn-expand {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 0.75rem;
  color: var(--stone-400);
  padding: 0.25rem 0.5rem;
  margin-right: 0.5rem;
  transition: transform 0.2s, color 0.15s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.btn-expand:hover { color: var(--stone-900); }
.btn-expand.is-open { transform: rotate(90deg); color: var(--stone-900); }

.order-details-row { display: none; background-color: var(--stone-50); box-shadow: inset 0 2px 4px 0 rgba(0,0,0,0.02); }
.order-details-row.is-open { display: table-row; }

.order-details-inner {
  padding: 1.5rem 2rem;
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  font-size: 0.875rem;
  color: var(--stone-700);
}
@media (min-width: 768px) {
  .order-details-inner { grid-template-columns: 1fr 1fr; gap: 4rem; }
}

.details-section h4 { font-family: var(--font-serif); font-size: 1.125rem; color: var(--stone-900); margin-bottom: 1rem; border-bottom: 1px solid var(--stone-200); padding-bottom: 0.5rem; }

.breakdown-list { display: flex; flex-direction: column; gap: 0.75rem; margin-bottom: 1.5rem; }
.breakdown-item { display: flex; justify-content: space-between; align-items: flex-start; }
.breakdown-item-info { flex: 1; padding-right: 1rem; }
.breakdown-item-title { font-weight: 500; color: var(--stone-900); display: block; }
.breakdown-item-meta { font-size: 0.75rem; color: var(--stone-500); }
.breakdown-item-price { font-weight: 500; color: var(--stone-900); }

.breakdown-totals { display: flex; flex-direction: column; gap: 0.5rem; border-top: 1px solid var(--stone-200); padding-top: 1rem; }
.breakdown-totals-row { display: flex; justify-content: space-between; }
.breakdown-totals-main { display: flex; justify-content: space-between; font-size: 1rem; font-weight: bold; color: var(--stone-900); border-top: 1px solid var(--stone-200); margin-top: 0.5rem; padding-top: 0.5rem; }

.shipping-details-list { display: flex; flex-direction: column; gap: 0.75rem; }
.shipping-details-row { display: flex; flex-direction: column; gap: 0.125rem; }
.shipping-details-label { font-size: 0.75rem; color: var(--stone-500); text-transform: uppercase; letter-spacing: 0.05em; }
.shipping-details-value { font-weight: 500; color: var(--stone-900); line-height: 1.4; }


/* --- 12. ADMIN SUBTABS (PILLS) --- */
.admin-subtabs-nav {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid var(--stone-100);
  padding-bottom: 1rem;
  overflow-x: auto; 
}

.admin-subtab-btn {
  padding: 0.375rem 1rem;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--stone-600);
  background-color: var(--stone-100);
  border-radius: 9999px;
  transition: all 0.15s;
  white-space: nowrap;
}

.admin-subtab-btn:hover {
  background-color: var(--stone-200);
  color: var(--stone-900);
}

.admin-subtab-btn.active {
  background-color: var(--stone-900);
  color: white;
}

/* --- 13. COPYABLE ADDRESS --- */
.copyable-address {
  background-color: var(--stone-50);
  border: 1px dashed var(--stone-200);
  padding: 0.75rem;
  border-radius: 0.125rem;
  cursor: pointer;
  position: relative;
  transition: background-color 0.15s, border-color 0.15s;
}
.copyable-address:hover {
  background-color: var(--stone-100);
  border-color: var(--stone-300);
}
.copy-indicator {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  font-size: 0.6875rem;
  color: var(--stone-500);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  pointer-events: none;
  font-weight: 500;
}

/* --- 14. INVENTORY UPLOAD FORM --- */
.upload-form-layout {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}
@media (min-width: 768px) {
  .upload-form-row {
    display: grid;
    grid-template-columns: 200px 1fr;
    align-items: center;
    gap: 1.5rem;
  }
  .upload-form-row.align-top {
    align-items: flex-start;
  }
}

.upload-form-label {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--stone-800);
}
.upload-form-multi {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  align-items: center;
}
@media (max-width: 767px) {
  .upload-form-multi {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
}

/* Hide number input arrows for a cleaner look */
.no-spinners::-webkit-outer-spin-button,
.no-spinners::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.no-spinners {
  -moz-appearance: textfield;
}

/* --- 14. INVENTORY UPLOAD FORM --- */
.upload-form-layout {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}
@media (min-width: 768px) {
  .upload-form-row {
    display: grid;
    grid-template-columns: 200px 1fr;
    align-items: center;
    gap: 1.5rem;
  }
  .upload-form-row.align-top {
    align-items: flex-start;
  }
}
.upload-form-label {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--stone-800);
}
.upload-form-multi {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  align-items: center;
}
@media (max-width: 767px) {
  .upload-form-multi {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
}

/* Hide number input arrows for a cleaner look */
.no-spinners::-webkit-outer-spin-button,
.no-spinners::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.no-spinners {
  -moz-appearance: textfield;
}

/* --- 15. TWO COLUMN ADMIN LAYOUT --- */
.admin-2col-layout {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

@media (min-width: 1024px) {
  .admin-2col-layout {
    display: grid;
    grid-template-columns: 1fr 1.5fr; 
    align-items: start;
  }
  
  .upload-form-row {
    grid-template-columns: 140px 1fr !important; 
  }
}
