/* styles.css
   - All visual styling for the OvenAlchemy site.
   - Comments explain purpose of each section and important properties.
   - Keep this file synced with index.html (only link to this CSS).
*/

/* ---------------------------
   Fonts
   - Import Google fonts (network request happens when CSS loads).
   - Provide a local @font-face for decorative 'Bukhari Script'.
   --------------------------- */
@import url('https://fonts.googleapis.com/css2?family=Architects+Daughter&family=Jua&display=swap');

@font-face {
  /* Local font used for the decorative subtitle */
  font-family: 'Bukhari Script';
  font-weight: 100;
  src: url('fonts/Bukhari Script.ttf') format('truetype');
}

/* Branding variables: declared early so all rules can use them */
:root {
  --brand: #b2572f;
  --brand-dark: #623727;
  --accent: #f6e4db;
  --brand-bg: #fff6ea;
  --muted: #eee;
  --text: #222;
  --panel-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
  --overlay-shadow: 0 8px 30px rgba(0, 0, 0, 0.25);
  --dim-backdrop: rgba(0, 0, 0, 0.6);
  --overlay-margin: 40px;
  --max-overlay-size: 1000px;
  --card-w: 180px;
  --gap: 20px;
}

.filter-brand {
  filter: invert(39%) sepia(63%) saturate(2643%) hue-rotate(340deg) brightness(95%) contrast(89%);
}

.filter-brand-dark {
  filter: invert(22%) sepia(44%) saturate(2021%) hue-rotate(340deg) brightness(85%) contrast(85%);
}

/* ---------------------------
   Global / page-level styles
   - Sets base font stack, background and outer spacing.
   - Use system-ui for quick fallback while webfonts load.
   --------------------------- */
body {
  font-family: system-ui, sans-serif;
  /* fallback stack for speed and legibility */
  background: var(--brand-bg);
  /* page background color from brand */
  margin: 40px;
  /* outer whitespace around page content */
}

/* Header area: vertically stack and center title, subtitle and logo */
.site-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.header-text {
  position: relative;
  display: grid;
  grid-template-columns: 1fr;
  text-align: center;
  margin-bottom: 10px;
  width: fit-content;
  user-select: none;
}

/* Main title uses the imported decorative font */
h1 {
  font-size: 5rem;
  margin: 0;
  font-family: 'Architects Daughter', cursive;
  color: var(--brand);
}

/* Subtitle uses another imported font */
h2 {
  font-size: 3rem;
  margin: 0;
  font-family: 'Jua', sans-serif;
  color: var(--brand);
}

/* Smaller decorative heading using the bundled Bukhari Script */
h3 {
  font-size: 2rem;
  margin: 0;
  font-family: 'Bukhari Script';
  color: var(--brand-dark);
}

/* Minor heading style used in some places */
h5 {
  text-align: center;
  font-size: 2rem;
  margin-top: 5px;
  margin-bottom: 20px;
}

/* Logo sizing and spacing */
.logo {
  width: 200px;
  margin-top: 15px;
  margin-bottom: 20px;
}

.logo-container {
  position: relative;
  width: 200px;
  margin-top: 15px;
  margin-bottom: 15px;
}

.overlay-icon {
  position: absolute;
  width: 15px;
  height: 15px;
  opacity: 0.6;
}

/* Controls wrapper holds tabs + search */
.controls {
  display: grid;
  grid-template-columns: auto;
  justify-content: center;
  padding-bottom: 10px;
}

/* ---------------------------
   Search box
   - Centered input with distinct border and focus styles for accessibility.
   --------------------------- */
.search-container {
  display: flex;
  justify-content: center;
  margin-bottom: 10px;
  gap: 5px;
  padding: 0;
}

/* Tidy #searchBox: remove duplicate padding-left and use box-sizing for predictable sizing */
#searchBox {
  display: block;
  box-sizing: border-box;
  padding: 10px 20px;
  width: 200px;
  /* fixed width for compact layout */
  border: 2px solid var(--brand);
  /* brand color */
  background: white;
  color: var(--brand);
  border-radius: 6px;
  font-weight: 600;
}

/* Visual focus ring to improve keyboard navigation visibility */
#searchBox:focus {
  outline: none;
  border-color: var(--brand-dark);
  box-shadow: 0 0 5px rgba(139, 69, 19, 0.5);
}

/* Optional search button styling if used */
#searchBtn {
  padding: 10px 20px;
  border: 2px solid var(--brand);
  background: white;
  color: var(--brand);
  cursor: pointer;
  border-radius: 6px;
  transition: background 0.2s ease;
}

/* ---------------------------
   Tabs (category buttons)
   - A simple horizontal list of buttons used to switch categories.
   --------------------------- */
.tabs {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-bottom: 20px;
}

.tab-btn {
  padding: 10px 20px;
  border: 2px solid var(--brand);
  background: white;
  color: var(--brand);
  cursor: pointer;
  border-radius: 6px;
  font-weight: 600;
  transition: background 0.2s ease;
}

.tab-btn:hover {
  background: var(--accent);
  /* hover tint from palette */
}

.tab-btn.active {
  background: var(--brand);
  /* filled state for selected tab */
  color: white;
}

/* ---------------------------
   Item container & Cards
   - Cards are small tiles showing item image, title and price badge.
   - Use flex-wrap so cards flow responsively.
   --------------------------- */
.item-container {
  width: min(1000px, 85%);
  position: relative;
  display: flex;
  flex-wrap: wrap;
  /* wrap cards to next rows on narrow widths */
  justify-content: center;
  gap: 20px;
  /* space between cards */
  padding: 0 50px;
  /* left/right padding so cards don't touch edges on wide screens */
}

/* Main layout to hold items and cart side-by-side on wide screens */
.main-content {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
}

/* Cart sidebar */
.cart-container {
  width: 300px;
  max-width: 300px;
  background: white;
  border: 1px solid #e6e6e6;
  border-radius: 10px;
  padding: 12px;
  box-shadow: var(--panel-shadow);
  /* place the cart below the search bar and center it */
  position: static;
  margin: 12px auto;
  z-index: auto;
  height: fit-content;
}

.cart-container h4 {
  margin: 0 0 8px 0;
  color: var(--brand);
  text-align: center;
}

.cart-items {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 360px;
  overflow: auto;
  padding: 6px 2px;
}

.cart-empty {
  color: #777;
  font-size: 0.95rem;
  margin: 6px 0;
}

.cart-item {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px dashed #f0f0f0;
  padding: 6px 2px;
}

.cart-item .left {
  display: flex;
  gap: 8px;
  align-items: center;
}

.cart-item img {
  width: 48px;
  height: 48px;
  object-fit: contain;
  border-radius: 6px;
}

.cart-item .meta {
  font-size: 0.9rem;
  color: #333;
}

.cart-qty {
  display: inline-flex;
  gap: 6px;
  align-items: center;
}

.cart-qty button {
  width: 26px;
  height: 26px;
  padding: 0;
  border-radius: 5px;
  border: 1px solid var(--brand);
  background: white;
  color: var(--brand);
  cursor: pointer;
}

.cart-summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 8px;
}

.cart-total {
  font-weight: 700;
  color: var(--brand-dark);
}

/* Small screens: cart becomes full width and stacked under items */
@media (max-width: 900px) {
  .main-content {
    flex-direction: column-reverse;
    align-items: center;
  }

  .cart-container {
    width: 100%;
    position: static;
    top: unset;
  }
}

/* Small buttons used to add items to cart */
.card-add-btn {
  position: absolute;
  /* move to bottom-right where the expand-arrow used to live */
  bottom: 8px;
  right: 10px;
  background: var(--brand);
  color: white;
  border: none;
  border-radius: 6px;
  width: 28px;
  height: 28px;
  cursor: pointer;
  font-weight: 700;
  font-size: 16px;
}

.price-add-btn {
  margin-left: 8px;
  background: var(--brand);
  color: white;
  border: none;
  border-radius: 6px;
  width: 28px;
  height: 24px;
  cursor: pointer;
  font-weight: 700;
  font-size: 16px;
}

/* Card box: relative so absolute children (badges, floating panels) are positioned relative to it */
.item-card {
  position: relative;
  border: 1px solid #ccc;
  border-radius: 10px;
  padding: 15px;
  width: 180px;
  /* fixed card width for consistent grid */
  text-align: center;
  background: white;
  cursor: pointer;
  transition: all 0.3s ease;
}

/* Hover affordance: lift and shadow */
.item-card:hover {
  box-shadow: var(--panel-shadow);
  transform: translateY(-3px);
}

/* Expanded card receives larger scale and higher stacking context */
.item-card.expanded {
  z-index: 10;
  transform: scale(1.05);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

/* ---------------------------
   Card contents: image, title, price tooltip, arrow
   --------------------------- */

/* Thumbnail image: keep aspect ratio and ensure the whole image is visible */
.item-card img {
  width: 100px;
  height: 100px;
  object-fit: contain;
  /* preserve aspect and show the full image */
  margin-bottom: 10px;
}

/* Item title styling */
.item-title {
  font-weight: bold;
  color: #222;
}

.price-tooltip {
  position: absolute;
  top: 6px;
  right: 8px;
  background: var(--brand);
  color: white;
  padding: 3px 6px;
  border-radius: 4px;
  font-size: 0.8rem;
  opacity: 0.8;
  transition: all 0.15s ease;
  pointer-events: none;
}

.item-card:hover .price-tooltip {
  opacity: 1;
}

/* Expand arrow at bottom-right to indicate more details */
.expand-arrow {
  position: absolute;
  bottom: 8px;
  right: 10px;
  font-size: 0.9rem;
  color: var(--brand);
  transition: transform 0.3s ease, color 0.3s ease;
}

/* Rotate arrow when expanded */
.item-card.expanded .expand-arrow {
  transform: rotate(180deg);
  color: var(--brand-dark);
}

/* ---------------------------
   Static description block (fallback)
   - Not used when floating panels are preferred, but kept for accessibility.
   --------------------------- */
.item-description {
  font-size: 0.85rem;
  color: #555;
  margin-top: 8px;
  line-height: 1.4;
  text-align: justify;
  display: none;
  opacity: 0;
  transition: all 0.3s ease;
}

/* ---------------------------
   Floating description & price panels
   - These appear when card is clicked. They are absolutely positioned,
     wider than the card so more content fits.
   - z-index keeps them above cards but below global overlays.
   --------------------------- */

/* Floating description: wider panel centered under the card */
.description-floating {
  position: absolute;
  left: 50%;
  bottom: -10px;
  transform: translate(-50%, 0%);
  /* center horizontally relative to card */
  width: 175%;
  /* intentionally larger than card */
  background: white;
  border: 1px solid var(--muted);
  box-shadow: var(--panel-shadow);
  opacity: 0;
  pointer-events: none;
  /* disable interactions when hidden */
  transition: all 0.25s ease;
  padding: 10px 15px;
  text-align: justify;
  z-index: 20;
}

/* Only show description when the parent card is expanded AND the panel has .show */
.item-card.expanded .description-floating.show {
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, 0%);
}

/* Floating price details: structured list of unit/price pairs */
.price-floating {
  position: absolute;
  left: 50%;
  bottom: -10px;
  transform: translate(-50%, 0%);
  width: 110%;
  background: white;
  border: 1px solid var(--muted);
  box-shadow: var(--panel-shadow);
  opacity: 0;
  pointer-events: none;
  transition: all 0.25s ease;
  padding: 10px 15px;
  text-align: left;
  z-index: 20;
}

/* Only show price panel when the parent card is expanded AND the panel has .show */
.item-card.expanded .price-floating.show {
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, 0%);
}

/* Price rows layout */
.price-floating div {
  display: flex;
  justify-content: space-between;
  padding: 3px 0;
  font-size: 0.9rem;
  border-bottom: 1px dashed #eee;
  /* subtle divider between rows */
}

.price-floating div:last-child {
  border-bottom: none;
  /* remove divider on last row */
}

.price-floating div span:first-child {
  color: #444;
  font-weight: 500;
  /* unit or label */
}

.price-floating div span:last-child {
  color: var(--brand);
  font-weight: 600;
  /* amount emphasis */
}

/* ---------------------------
   Image overlay (enlarged view)
   - Fullscreen backdrop + centered inner container for enlarged image.
   - Uses padding + overflow: visible to avoid clipping transparent image corners.
   - Image size constrained by viewport minus margin and a hard cap (1000px).
   --------------------------- */

/* Backdrop covering entire viewport (hidden by default) */
.image-overlay {
  position: fixed;
  inset: 0;
  /* shorthand for top/right/bottom/left: 0 */
  background: var(--dim-backdrop);
  /* dim backdrop */
  display: flex;
  align-items: center;
  justify-content: center;
  /* center inner content */
  opacity: 0;
  pointer-events: none;
  /* disable interaction when hidden */
  transition: opacity 0.18s ease;
  z-index: 9999;
  /* above cards and floating panels */
}

/* Make overlay interactive/visible when .show is added by JS */
.image-overlay.show {
  opacity: 1;
  pointer-events: auto;
}

/* Inner wrapper: subtle frame and padding prevents clipping of transparent PNG corners */
.image-overlay-inner {
  position: relative;
  max-width: 92%;
  max-height: 92%;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: visible;
  /* allow image bleed beyond rounded corners */
  padding: 10px;
  /* spacing between image and rounded frame */
  background: rgba(255, 255, 255, 0.02);
  /* faint frame background */
}

/* Enlarged image constraints:
   - max-size = min(viewport margin, 1000px)
   - width/height auto preserves aspect ratio */
.image-overlay-inner img {
  max-width: min(calc(100vw - var(--overlay-margin)), var(--max-overlay-size));
  max-height: min(calc(100vh - var(--overlay-margin)), var(--max-overlay-size));
  width: auto;
  height: auto;
  object-fit: contain;
  /* preserve image without distortion */
  display: block;
  border-radius: 0;
  /* don't round the image itself */
  background: transparent;
  box-shadow: var(--overlay-shadow);
}

/* Floating circular close button that sits slightly outside the inner box */
.overlay-close {
  position: absolute;
  top: -8px;
  right: -8px;
  background: white;
  border: none;
  border-radius: 50%;
  width: 36px;
  height: 36px;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

/* ---------------------------
   Loading overlay
   - Fullscreen center box with spinner and message.
   - Created/controlled by JS: showLoading/hideLoading toggle the .show class.
   - Highest z-index to block interaction during data fetch.
   --------------------------- */
.loading-overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.45);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease;
  z-index: 10000;
  /* above image overlay to guarantee no interaction during loading */
}

.loading-overlay.show {
  opacity: 1;
  pointer-events: auto;
}

.loading-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  background: rgba(255, 255, 255, 0.98);
  padding: 18px 24px;
  border-radius: 10px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.25);
  min-width: 180px;
}

/* Simple CSS spinner using border-top color */
.loading-spinner {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 4px solid rgba(160, 160, 160, 0.25);
  border-top-color: var(--brand);
  animation: spin 1s linear infinite;
}

.loading-text {
  color: #333;
  font-weight: 600;
  font-size: 0.95rem;
}

/* ---------------------------
   Footer area: contact details, socials, disclaimers
   - Uses a grid layout for contact rows.
   --------------------------- */

.disclamer {
  text-align: left;
  font-size: 1rem;
  color: var(--brand-dark);
  margin-top: 15px;
  /* reduced from 15px */
  margin-bottom: 15px;
  user-select: none;
}

.disclamer h4 {
  margin: 0;
  padding: 0;
  font-size: 1rem;
  color: var(--brand);
  text-align: left;
  margin-bottom: 0px;
}

.disclamer ul {
  margin: 5px 0 0 20px;
  padding: 0;
  list-style-type: disc;
}

.divider,
hr.divider {
  display: block;
  width: min(1000px, 85%);
  margin: 20px auto;
  height: 0;
  border: 0;
  border-top: 1px solid var(--brand);
  opacity: 0.6;
}

.divider-small,
hr.divider-small {
  display: block;
  width: min(200px, 50%);
  margin: 10px auto;
  height: 0;
  border: 0;
  border-top: 1px solid var(--brand);
  opacity: 0.6;
}

/* Variants */
.divider.brand,
hr.divider.brand {
  border-top-color: var(--brand);
  opacity: 0.6;
}

.divider.dashed,
hr.divider.dashed {
  border-top-style: dashed;
}

.divider.thick,
hr.divider.thick {
  border-top-width: 2px;
}

.five-star-icon {
  width: 120px;
  height: auto;
  vertical-align: middle;
  padding-top: 10px;
  padding-bottom: 10px;
}

.contacts {
  text-align: left;
  font-size: 0.9rem;
  color: #555;
  margin-top: 15px;
  margin-bottom: 15px;
  display: flex;
  justify-content: center;
  /* center .contacts-grid */
}

/* Map wrapper used under contact details */
.map-wrapper {
  width: 100%;
  max-width: 680px;
  margin: 12px auto;
  border-radius: 8px;
  overflow: hidden;
  /* keep iframe corners clipped */
  box-shadow: var(--panel-shadow);
}

/* Stack rows vertically; constrain width so parent centering works reliably */
.contacts-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
  max-width: 680px;
}

/* Each logical row is a 2-column grid: label/icon (right) | value (left) */
.contact-row {
  display: grid;
  grid-template-columns: 140px 1fr 140px;
  /* fixed label column, flexible value column */
  column-gap: 16px;
  align-items: center;
}

/* Label column: right aligned, slightly muted */
.contact-label {
  text-align: right;
  color: var(--text);
  font-weight: 600;
  padding-right: 8px;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.contact-right-padding {
  width: 140px;
}

/* Value column: left aligned; links inherit brand color */
.contact-value {
  text-align: left;
  color: #444;
  word-break: break-word;
}

.contact-value a {
  color: var(--brand);
  text-decoration: none;
}

.contact-value a:hover,
.contact-value a:focus {
  text-decoration: underline;
}

/* Icon sizing and spacing for label icons */
.contact-icon,
.social-icon {
  width: 20px;
  height: 20px;
  object-fit: contain;
  display: inline-block;
  vertical-align: middle;
}

/* Mobile: collapse to single column for narrow screens */
@media (max-width: 520px) {
  .contacts {
    justify-content: flex-start;
    /* flow naturally on very small screens */
    padding: 0 12px;
  }

  .contacts-grid {
    max-width: none;
    width: 100%;
  }

  .contact-row {
    grid-template-columns: 1fr;
    /* stack label above value */
  }

  .contact-label {
    justify-content: flex-start;
    text-align: left;
    padding-right: 0;
  }

  .contact-value {
    margin-left: 0;
  }
}

.bottom-details {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: 12px;
  margin-bottom: 12px;
}

.socials {
  display: flex;
  justify-content: center;
  text-align: center;
  font-size: 0.9rem;
  color: #555;
  margin-top: 20px;
  margin-bottom: 10px;
  gap: 15px;
}

.site-footer {
  text-align: center;
  font-size: 0.85rem;
  color: var(--brand-dark);
  margin-top: 30px;
}

/* Ensure the actual h4 inside .bottom-heading has no large default margins */
.bottom-heading {
  text-align: center;
  color: var(--brand);
  line-height: 1.2;
  margin: 0;
  padding: 0;
}

.bottom-heading h4 {
  margin: 6px 0;
  /* small vertical gap only */
  padding: 0;
  font-size: 1.5rem;
  /* keep visual size */
  color: var(--brand);
  margin-bottom: 0px;
  margin-top: 0px;
}

/* Spinner rotation keyframe */
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ---------------------------
   Responsive adjustments for small screens
   - Reduce margins, stack cards vertically and make floating panels full-width.
   --------------------------- */
@media (max-width: 800px) {
  body {
    margin: 15px;
    /* less outer whitespace on small devices */
  }

  /* Two-up layout on small screens: show 2 cards per row, reduced padding/gap */
  .item-container {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    /* allow multiple items per row */
    align-items: flex-start;
    justify-content: center;
    gap: 12px;
    /* smaller gap to feel zoomed-in */
    padding: 0 8px;
    /* reduced side padding for more content space */
  }

  /* Each card takes roughly half the available width (minus gap) */
  .item-card {
    flex: 0 0 calc(50% - 12px);
    max-width: calc(50% - 12px);
    width: auto;
  }

  /* Make thumbnails larger on mobile for a zoomed-in look */
  .item-card img {
    width: 140px;
    height: 140px;
    object-fit: cover;
    /* crop a little for a tighter visual */
    margin-bottom: 10px;
  }

  /* Floating panels become full width and anchored to the left edge */
  .description-floating,
  .price-floating {
    width: 100%;
    left: 0;
    transform: none;
    /* anchored layout is simpler on small screens */
  }

  .expand-arrow {
    bottom: 5px;
    right: 8px;
  }

  /* Slightly different overlay inner limits on small displays */
  .image-overlay-inner {
    max-width: 98%;
    max-height: 80%;
  }
}

/* ---------------------------
   Accessibility: Reduced motion preference
   - Disable animations, transitions and smooth scrolling for users who prefer reduced motion.
   --------------------------- */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

/* ---------------------------
   Checkout overlay
   - Fullscreen overlay used to show the checkout cart, message box and actions
   --------------------------- */
.checkout-overlay {
  position: fixed;
  inset: 0;
  background: var(--dim-backdrop);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease;
  z-index: 9999;
}

.checkout-overlay.show {
  opacity: 1;
  pointer-events: auto;
}
.checkout-inner {
  width: min(800px, 90%);
  max-height: 92vh;
  overflow: visible;
  background: white;
  border-radius: 12px;
  padding: 18px;
  box-shadow: var(--overlay-shadow);
  position: relative;
}
.checkout-inner h4 {
  margin: 0 0 8px 0;
  color: var(--brand);
}
/* Fields for collecting customer's name and address inside checkout overlay */
.checkout-fields {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 10px;
}
.checkout-fields label {
  font-size: 0.95rem;
  font-weight: 600;
  color: #333;
}
.checkout-fields input,
.checkout-fields textarea {
  width: 100%;
  box-sizing: border-box;
  padding: 8px 10px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 0.95rem;
  color: #222;
}
.checkout-fields textarea { resize: vertical; min-height: 64px; }
.checkout-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 12px;
  /* scrollable */
  overflow-y: auto;
  max-height: 500px;
}
.checkout-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 8px 10px;
  border: 1px solid #f0f0f0;
  border-radius: 8px;
}
.checkout-item img { width: 56px; height: 56px; object-fit: contain; border-radius:6px }
.checkout-message {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.checkout-message textarea {
  width: 100%;
  min-height: 90px;
  resize: vertical;
  padding: 8px;
  border: 1px solid #ddd;
  border-radius: 6px;
}
/* Ensure textarea respects its container width and doesn't overflow */
#checkoutMessage,
.checkout-message textarea {
  box-sizing: border-box;
  max-width: 100%;
}

/* Markdown preview area under the checkout textarea */
.checkout-preview {
  margin-top: 10px;
  padding: 10px;
  border: 1px solid #eee;
  border-radius: 6px;
  background: #fafafa;
  color: #222;
  max-height: 220px;
  overflow: auto;
  font-size: 0.95rem;
}
.checkout-actions { display:flex; gap:10px; justify-content:flex-end; margin-top: 12px }
.checkout-close {
  position: absolute;
  top: -18px;
  right: -18px;
  background: white;
  border: none;
  border-radius: 50%;
  width: 36px;
  height: 36px;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}
