:root {
  --primary: #0a8a83;
  --accent: #ca8a04;
  --dark: #1e1b4b;
  --light: #fefcf6;
  --border: #f0e6d2;
  --gold: #CC9900;
  --emerald: #022c03;
  --light-purple: #F0D9FF;
  --border-light: rgba(0, 0, 0, 0.12);
  --bright-yellow: #f6f607;
}

body {
  font-family: 'Montserrat', sans-serif;
  background-color: var(--light);
  color: var(--dark);
  margin: 0;
  padding: 20px;
}

header {
  max-width: 1100px;
  margin: 0 auto 40px auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 3px solid var(--gold);
}

.brand-container {
  display: flex;
  align-items: center;
  gap: 25px;
}

.store-logo {
  width: 100px;
  height: auto;
  object-fit: contain;
  /* Base state shadow */
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.2));
  /* Smooth animation transition */
  transition: transform 0.3s ease, filter 0.3s ease;
  cursor: pointer;
}

/* Hover Effect */
.store-logo:hover {
  /* Gently lifts the logo */
  transform: scale(1.06) translateY(-2px);
  
  /* Multi-layered emerald glow contouring the fairy & wings */
  filter: 
    drop-shadow(0 0 6px rgba(16, 185, 129, 0.7)) 
    drop-shadow(0 0 12px rgba(5, 150, 105, 0.4));
}

header h1 {
  margin: 0;
  font-size: 38px;
  font-family: 'Marcellus', serif;
  color: var(--emerald);
  text-shadow: 2px 2px 4px var(--gold); 
}

.promo-banner {
  max-width: 1100px;
  margin: 0 auto 30px auto;
  text-align: center;
}

.promo-headers {
  display: flex;
  gap: 15px;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 15px;
}

.promo-headers h3 {
  margin: 0;
  font-size: 22px;
  font-family: 'Marcellus', serif;
  color: var(--dark);
}

.bullet-divider {
  color: var(--gold);
  font-size: 20px;
}

.italic-gold {
  color: var(--gold);
  font-style: italic;
}

.promo-text {
  margin: 0;
  padding: 15px 30px;
  font-size: 17px;
  line-height: 1.5;
  color: var(--emerald);
  font-weight: 600;
  background-color: var(--light-purple);
  border-radius: 12px;
  border: 2px solid var(--gold);
}

.container {
  max-width: 1100px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 30px;
  padding-bottom: 50px;
}

@media (max-width: 900px) {
  .container {
    grid-template-columns: 1fr;
  }
}

.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 25px;
}

/* Reduced Vertical Height Matrix to Eliminate Unnecessary White Space */
.card-perspective {
  perspective: 1500px;
  height: 520px; 
}

.product-card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
}

.product-card-inner.flipped {
  transform: rotateY(180deg);
}

.card-face {
  position: absolute;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  border-radius: 14px;
  background: aliceblue;
  border: 3px solid var(--gold);
  box-shadow: 0 4px 12px rgba(0,0,0,0.05);
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.card-back {
  background: linear-gradient(135deg,#2904a7 30%, #9762cc 50%, #2904a7 100%);
  color: white;
  transform: rotateY(180deg);
  padding: 16px;
  border-color: var(--gold);
}

.product-image-container {
  position: relative;
  width: 100%;
  height: 200px; 
  background-color: #fafafa;
  overflow: hidden;
  border-bottom: 1px solid var(--border);
  cursor: zoom-in;
}

.product-image-element {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.product-image-container:hover .product-image-element {
  transform: scale(1.05);
}

.zoom-magnify-hint {
  position: absolute;
  bottom: 6px;
  right: 8px;
  background: rgba(30, 27, 75, 0.85);
  color: var(--gold);
  font-size: 14px;
  padding: 3px 6px;
  border-radius: 4px;
  pointer-events: none;
  font-weight: 500;
  letter-spacing: 0.04em;
}

.color-name-badge {
  text-align: center;
  font-size: 11px;
  font-weight: bold;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--accent);
  padding: 6px 0 2px 0;
  background: #fdfdfd;
}

/* Swatch Interactive Flash Callout with Smooth Pulsing Background Keyframes */
.swatch-instruction-hint {
  text-align: center;
  font-size: 12px;
  color: #475569;
  font-weight: 500;
  padding: 4px 0;
  background-color: #f8fafc;
  letter-spacing: 0.04em;
  pointer-events: none;
  animation: swatchAlertFlash 3.5s ease-in-out infinite;
}

@keyframes swatchAlertFlash {
  0%, 100% { background-color: #f8fafc; color: #475569; }
  30% { background-color: #fef08a; color: #854d0e; font-weight: 600; }
  60% { background-color: #ccfbf1; color: #115e59; }
}

.color-swatch-wrapper {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 5px;
  padding: 2px 10px 10px 10px;
  background: #fdfdfd;
  border-bottom: 1px dashed var(--border);
}

/* Color Dot Swatches - Sized Up precisely by 30% from 6px base measurements */
.color-dot-swatch {
  margin-top: 3%;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 1px solid rgba(0,0,0,0.22);
  cursor: pointer;
  transition: transform 0.1s ease;
  flex-shrink: 0;
}

.color-dot-swatch:hover {
  transform: scale(1.5);
  box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

.color-dot-swatch.selected {
  border: 2px solid var(--primary);
  outline: 1px solid white;
}

.product-info {
  padding: 12px;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
  justify-content: space-between;
}

.product-title {
  font-family: 'Marcellus', serif;
  font-size: 16px;
  font-weight: bold;
  color: var(--gold);
  text-align: center;
  margin-bottom: 2px;
}

.product-desc {
  font-size: 15px; 
  color: #64748b;
  margin: 2px 0;
  text-align: center;
}

.product-price {
  font-size: 18px;
  font-weight: 700;
  color: var(--primary);
  text-align: center;
  margin-bottom: 6px;
}

.btn-add {
  background-color: var(--primary);
  color: white;
  border: none;
  padding: 8px 12px;
  font-family: 'Montserrat', sans-serif;
  font-weight: 600;
  font-size: 12px;
  border-radius: 6px;
  cursor: pointer;
  width: 100%;
  transition: background-color 0.2s;
}

.btn-add:hover {
  background-color: #056661;
}

.flip-hint {
  font-size: 12px;
  font-weight: 600;
  color: var(--gold);
  text-align: center;
  margin-top: 4px;
  font-style: italic;
}

.back-content-wrapper {
  display: flex;
  flex-direction: column;
  height: 100%;
  justify-content: space-between;
}

.back-title {
  font-family: 'Marcellus', serif;
  font-size: 18px;
  border-bottom: 2px solid var(--gold);
  padding-bottom: 6px;
  color: #38bdf8;
  margin-bottom: 10px;
  text-align: center;
}

.back-disclaimer {
  font-size: 11px;
  font-style: italic;
  color: #fef08a; /* Soft gold text for readability on dark background */
  text-align: center;
  margin-top: -2px;
  margin-bottom: 16px;
  letter-spacing: 0.02em;
}

.dual-list-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  overflow-y: auto;
  flex-grow: 1;
  margin-bottom: 8px;
}

.back-list-column {
  margin: 0;
  padding-left: 14px;
  font-size: 11px;
  line-height: 1.5;
  color: white;
}

.back-list-column li {
  margin-bottom: 4px;
}

.back-footer {
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Sidebar Summary Styles with Premium Box Shadow */
.cart-sidebar {
  background: white;
  padding: 20px;
  border-radius: 14px;
  border: 1px solid rgba(240, 230, 210, 0.7);
  box-shadow: 
    0 10px 25px -5px rgba(30, 27, 75, 0.05),
    0 8px 16px -6px rgba(10, 138, 131, 0.03),
    inset 0 0 0 1px rgba(204, 153, 0, 0.04);
  height: fit-content;
  transition: box-shadow 0.3s ease;
}

.cart-sidebar:hover {
  box-shadow: 
    0 20px 35px -8px rgba(30, 27, 75, 0.08),
    0 12px 20px -8px rgba(10, 138, 131, 0.05),
    inset 0 0 0 1px rgba(204, 153, 0, 0.06);
}

.cart-title {
  font-family: 'Marcellus', serif;
  font-size: 18px;
  font-weight: bold;
  color: var(--dark);
  margin-bottom: 15px;
  border-bottom: 2px solid var(--gold);
  padding-bottom: 6px;
}

.cart-item-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.cart-item-row:last-of-type {
  border-bottom: none;
}

.cart-item-thumbnail {
  width: 0.5in;
  height: 0.5in;
  object-fit: cover;
  border-radius: 4px;
  border: 1px solid var(--border);
  flex-shrink: 0;
}

.cart-item-details {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

.cart-item-header {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  font-weight: 600;
  color: var(--dark);
}

.cart-item-subtitle {
  font-size: 11px;
  color: #64748b;
  margin-top: 2px;
  font-style: italic;
}

.quantity-stepper {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
}

.quantity-stepper button {
  background-color: var(--primary);
  border: 1px solid var(--primary);
  color: white;
  width: 22px;
  height: 22px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: bold;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: background-color 0.1s ease;
}

.quantity-stepper button:hover {
  background-color: #056661;
  border-color: #056661;
}

.quantity-stepper span {
  font-size: 12px;
  font-weight: 600;
  min-width: 14px;
  text-align: center;
}

.shipping-box {
  background-color: #fcf8ff;
  border: 1px solid #e2cbf7;
  padding: 12px;
  border-radius: 6px;
  margin: 15px 0;
}

.shipping-box label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  margin-bottom: 6px;
}

.shipping-input {
  width: 100%;
  box-sizing: border-box;
  padding: 8px 10px;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-family: 'Montserrat', sans-serif;
}

.summary-line {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  margin-bottom: 8px;
  color: #555;
}

.cart-total-row {
  display: flex;
  justify-content: space-between;
  font-size: 17px;
  font-weight: bold;
  border-top: 1px solid var(--border-light);
  margin-top: 12px;
  padding-top: 12px;
  color: var(--dark);
}

#payment-buttons-container {
  margin-top: 15px;
}

.image-zoom-modal {
  display: none; 
  position: fixed;
  z-index: 9999; 
  padding-top: 20px;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(30, 27, 75, 0.92); 
  justify-content: center;
  align-items: center;
  cursor: zoom-out;
}

.zoom-modal-content {
  margin: auto;
  display: block;
  max-width: 85%;
  max-height: 85%;
  object-fit: contain;
  border: 3px solid var(--gold);
  border-radius: 12px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
  animation: lightboxFadeIn 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.close-zoom-btn {
  position: absolute;
  top: 20px;
  right: 35px;
  color: var(--light);
  font-size: 40px;
  font-weight: 300;
  cursor: pointer;
  transition: color 0.2s ease;
}

.close-zoom-btn:hover {
  color: var(--gold);
}

@keyframes lightboxFadeIn {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

/* ==========================================================================
   Enchanted Bookish Gifts - Footer Core Interface Styles
   ========================================================================== */

footer {
  background-color: #1a1a1a; /* Dark anchor color */
  color: #e5e5e5;
  padding: 4rem 2rem 2rem 2rem;
  font-family: 'Georgia', serif;
  border-top: 1px solid #c9a66b; /* Muted gold border link to the brand theme */
}

.footer-container {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 2.5rem;
  padding-bottom: 3rem;
}

.footer-column h3, 
.footer-column h4 {
  color: #c9a66b; /* Accent Gold */
  font-size: 1.2rem;
  font-weight: 600;
  margin-bottom: 1.5rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.footer-column ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer-column ul li {
  margin-bottom: 0.75rem;
}

.footer-column a {
  color: #cccccc;
  text-decoration: none;
  transition: color 0.2s ease-in-out;
  font-size: 0.95rem;
}

.footer-column a:hover {
  color: #c9a66b; /* Hover gold accent shift */
}

/* Brand Story & Newsletter Customization */
.brand-story .footer-logo {
  max-width: 180px;
  height: auto;
  margin-bottom: 1rem;
}

.footer-tagline {
  font-style: italic;
  color: #a3a3a3;
  margin-bottom: 2rem;
  font-size: 0.95rem;
}

.newsletter-signup p {
  font-size: 0.9rem;
  color: #bcbcbc;
  margin-bottom: 1rem;
  line-height: 1.4;
}

.footer-email-form {
  display: flex;
  gap: 0.5rem;
  margin-top: 1rem;
}

.footer-email-form input[type="email"] {
  flex: 1;
  padding: 0.75rem 1rem;
  background-color: #262626;
  border: 1px solid #404040;
  color: #ffffff;
  border-radius: 4px;
  font-family: inherit;
  font-size: 0.9rem;
}

.footer-email-form input[type="email"]:focus {
  outline: none;
  border-color: #c9a66b;
}

.footer-email-form button {
  padding: 0.75rem 1.5rem;
  background-color: #c9a66b;
  color: #1a1a1a;
  border: none;
  border-radius: 4px;
  font-weight: bold;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.footer-email-form button:hover {
  background-color: #b59258;
}

/* Social & Payments Alignment */
.social-links {
  display: flex;
  gap: 1rem;
  margin-bottom: 2rem;
}

.payment-methods p {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #8a8a8a;
  margin-bottom: 0.5rem;
}

/* Bottom Technical & Legal Bar */
.footer-bottom {
  max-width: 1200px;
  margin: 0 auto;
  padding-top: 2rem;
  border-top: 1px solid #262626;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
  color: #8a8a8a;
}

.legal-links {
  display: flex;
  gap: 1.5rem;
}

.legal-links a {
  color: #8a8a8a;
  text-decoration: none;
}

.legal-links a:hover {
  color: #c9a66b;
}

/* Responsive Structural Adjustments */
@media (max-width: 900px) {
  .footer-container {
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
  }
}

@media (max-width: 600px) {
  .footer-container {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
  
  .footer-bottom {
    flex-direction: column;
    gap: 1rem;
    text-align: center;
  }

/* ==========================================================================
   Enchanted Bookish Gifts - Cart, Sidebar & Checkout Responsiveness
   ========================================================================== */

/* Main Container Layout */
.container {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 30px;
  padding: 20px;
}

@media (max-width: 900px) {
  .container {
    grid-template-columns: 1fr;
  }
}

/* Sidebar Styling */
.cart-sidebar {
  background-color: #ffffff;
  border: 1px solid #e4e4e7;
  border-radius: 8px;
  padding: 24px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.02);
  height: fit-content;
}

.cart-title {
  font-family: 'Marcellus', serif;
  font-size: 1.3rem;
  color: #1a1a1a;
  margin-bottom: 20px;
  border-bottom: 2px solid #f4f4f5;
  padding-bottom: 10px;
  font-weight: bold;
}

/* Dynamic Cart Items */
.cart-item-row {
  display: flex;
  gap: 15px;
  margin-bottom: 15px;
  padding-bottom: 15px;
  border-bottom: 1px solid #e4e4e7;
}

.cart-item-thumbnail {
  width: 60px;
  height: 60px;
  object-fit: cover;
  border-radius: 4px;
}

.cart-item-details {
  flex: 1;
}

.cart-item-header {
  display: flex;
  justify-content: space-between;
  font-weight: 600;
  font-size: 0.95rem;
}

.cart-item-title {
  color: #1a1a1a;
}

.cart-item-price {
  color: #c9a66b;
}

.cart-item-subtitle {
  font-size: 0.85rem;
  color: #71717a;
  margin: 4px 0 8px 0;
}

/* Quantity Stepper Interface */
.quantity-stepper {
  display: flex;
  align-items: center;
  gap: 12px;
}

.quantity-stepper button {
  background: #f4f4f5;
  border: 1px solid #e4e4e7;
  width: 24px;
  height: 24px;
  border-radius: 4px;
  cursor: pointer;
  font-weight: bold;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.quantity-stepper button:hover {
  background: #e4e4e7;
}

/* Shipping Destination Form Box */
.shipping-box {
  margin: 20px 0;
  background: #f8f9fa;
  padding: 15px;
  border-radius: 6px;
  border: 1px solid #e4e4e7;
}

.shipping-box label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: #4b5563;
  margin-bottom: 6px;
}

.shipping-input {
  width: 100%;
  box-sizing: border-box;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 0.95rem;
  font-family: inherit;
}

.shipping-input:focus {
  outline: none;
  border-color: #c9a66b;
}

/* Summary Math Columns */
.summary-line {
  display: flex;
  justify-content: space-between;
  font-size: 0.95rem;
  color: #4b5563;
  margin-bottom: 8px;
}

.cart-total-row {
  display: flex;
  justify-content: space-between;
  font-size: 1.2rem;
  font-weight: 700;
  color: #1a1a1a;
  margin-top: 15px;
  padding-top: 15px;
  border-top: 2px dashed #e4e4e7;
}

/* Payment SDK Container */
#payment-buttons-container {
  width: 100%;
  box-sizing: border-box;
}

/* ==========================================================================
   Enchanted Bookish Gifts - Visual Layout Spacing & Text Wrap Suite
   ========================================================================== */

/* Full-Viewport Overlay Box Framework */
.legal-overlay-container {
  display: none; 
  position: fixed; 
  z-index: 9999; 
  left: 0; 
  top: 0; 
  width: 100%; 
  height: 100%; 
  background-color: rgba(30, 27, 75, 0.7); /* Midnight indigo deep backdrop wash */
  backdrop-filter: blur(5px); 
  align-items: center; 
  justify-content: center;
  padding: 16px;
  box-sizing: border-box;
}

/* Interior Modal Document Box Frame */
.legal-modal-frame {
  background-color: #F0D9FF; 
  border: 2px solid var(--gold, #CC9900); 
  border-radius: 14px; 
  width: 100%;
  max-width: 680px; 
  max-height: 85vh; 
  display: flex; 
  flex-direction: column; 
  overflow: hidden; 
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35);
  animation: legalModalReveal 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Modal Title Header Bar */
.legal-modal-header {
  padding: 16px 20px; 
  border-bottom: 2px solid var(--gold, #CC9900); 
  display: flex; 
  justify-content: space-between; 
  align-items: center; 
  background-color: #3B0060; 
  color: #FFFFFF;
}

.legal-modal-header h3 {
  margin: 0; 
  font-family: 'Marcellus', serif; 
  font-size: 22px; 
  color: #FFFFFF;
  letter-spacing: 0.02em;
  padding-right: 15px;
  /* Prevent overflow clipping of long title elements */
  word-wrap: break-word;
  overflow-wrap: break-word;
  white-space: normal;
}

.legal-modal-close-trigger {
  cursor: pointer; 
  font-size: 32px; 
  font-weight: bold; 
  line-height: 20px;
  color: rgba(255, 255, 255, 0.8);
  user-select: none;
  transition: color 0.15s ease;
}

.legal-modal-close-trigger:hover {
  color: #FFFFFF;
}

/* Scrollable Inner Legal Document Content Body */
.legal-modal-document-body {
  padding: 24px; 
  overflow-y: auto; 
  font-family: 'Montserrat', sans-serif; 
  font-size: 15px; 
  line-height: 1.65; 
  color: #1e1b4b; 
  background-color: #FFFFFF; 
  text-align: left;
  /* Protect against text spill paths on small viewports */
  word-wrap: break-word;
  overflow-wrap: break-word;
  word-break: break-word;
  -webkit-overflow-scrolling: touch;
}

.legal-modal-document-body p {
  margin: 0 0 16px 0;
}

/* Base Footer Controls Bar Area */
.legal-modal-action-footer {
  padding: 12px 20px; 
  border-top: 1px solid rgba(0, 0, 0, 0.06); 
  text-align: right; 
  background-color: #fcf9ff;
}

.legal-modal-dismiss-btn {
  background-color: #3B0060; 
  color: #FFFFFF; 
  border: none; 
  padding: 10px 22px; 
  border-radius: 6px; 
  cursor: pointer; 
  font-family: 'Marcellus', serif; 
  font-size: 14px;
  letter-spacing: 0.03em;
  transition: background-color 0.15s ease, transform 0.1s ease;
}

.legal-modal-dismiss-btn:hover {
  background-color: #25003b;
}

.legal-modal-dismiss-btn:active {
  transform: scale(0.98);
}

/* Fluid Spacing and Layout Breakpoint Adaptive Rules */
@media screen and (max-width: 480px) {
  .legal-modal-frame {
    max-height: 90vh;
    border-radius: 12px;
  }
  .legal-modal-header {
    padding: 12px 16px;
  }
  .legal-modal-header h3 {
    font-size: 18px;
  }
  .legal-modal-document-body {
    padding: 16px;
    font-size: 13.5px;
    line-height: 1.6;
  }
  .legal-modal-action-footer {
    padding: 10px 16px;
  }
  .legal-modal-dismiss-btn {
    width: 100%; /* Spans full width on small layouts */
    text-align: center;
    padding: 12px;
  }
}

@keyframes legalModalReveal {
  from { opacity: 0; transform: scale(0.97); }
  to { opacity: 1; transform: scale(1); }
}



}