/* Loom2 — standalone placeholder-product prototype. Self-contained CSS,
   no dependency on the main site's stylesheets. */

/* Native browser-to-browser page transition (Chrome/Edge today, other
   engines ignore this harmlessly) — cross-fades the old/new page instead of
   the old one just vanishing and the new one popping in unstyled for a
   frame. This is what actually makes navigating between loom2 pages feel
   smooth instead of a hard jump-cut; the nav/footer being static HTML
   (rather than JS-injected after load) is what stops the header itself
   from visibly flashing empty-then-populated on every navigation. */
@view-transition {
  navigation: auto;
}

* { box-sizing: border-box; }

.none { display: none !important; }

:root {
  --l2-accent: #2e9e6b;
  --l2-accent-dark: #24805a;
  --l2-text: #1a1a1a;
  --l2-text-secondary: #5f5f5f;
  --l2-bg: #ffffff;
  --l2-bg-alt: #f7f7f5;
  --l2-border: #e3e3e0;
  --l2-radius: 12px;
  --l2-radius-sm: 6px;
}

html, body {
  margin: 0;
  padding: 0;
  background: var(--l2-bg-alt);
  color: var(--l2-text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.5;
}

a { color: inherit; }

img, svg { max-width: 100%; display: block; }

button {
  font-family: inherit;
  font-size: 16px;
  cursor: pointer;
}

/* ---------- Layout shell ---------- */
.l2-page {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 20px 60px;
}

.l2-nav {
  background: var(--l2-bg);
  border-bottom: 1px solid var(--l2-border);
  margin-bottom: 28px;
}
.l2-nav-inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
}
.l2-logo {
  font-size: 22px;
  font-weight: 800;
  text-decoration: none;
  color: var(--l2-text);
  flex-shrink: 0;
}
.l2-nav-links {
  display: flex;
  gap: 20px;
  flex: 1;
  flex-wrap: wrap;
}
.l2-nav-links a {
  text-decoration: none;
  font-size: 16px;
  font-weight: 600;
  color: var(--l2-text-secondary);
  padding: 6px 2px;
  border-bottom: 2px solid transparent;
}
.l2-nav-links a:hover, .l2-nav-links a.active {
  color: var(--l2-text);
  border-bottom-color: var(--l2-accent);
}
.l2-cart-link {
  position: relative;
  display: flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  font-size: 16px;
  font-weight: 700;
  color: var(--l2-text);
  background: var(--l2-bg-alt);
  border: 1px solid var(--l2-border);
  border-radius: 50px;
  padding: 8px 16px;
  flex-shrink: 0;
}
.l2-cart-badge {
  background: var(--l2-accent);
  color: #fff;
  font-size: 13px;
  font-weight: 800;
  border-radius: 50px;
  min-width: 20px;
  height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 6px;
}
.l2-cart-badge.none { display: none; }

.l2-footer {
  background: var(--l2-text);
  margin-top: 60px;
  padding: 40px 20px 28px;
}
.l2-footer-inner {
  max-width: 1180px;
  margin: 0 auto;
  text-align: center;
}
.l2-footer-logo {
  display: inline-block;
  font-size: 20px;
  font-weight: 800;
  color: #fff;
  text-decoration: none;
  margin-bottom: 10px;
}
.l2-footer-tagline {
  font-size: 14px;
  color: #9aa0a6;
  max-width: 520px;
  margin: 0 auto 20px;
}
.l2-footer-links {
  display: flex;
  justify-content: center;
  gap: 24px;
  margin-bottom: 16px;
}
.l2-footer-links a {
  color: #cfd3d6;
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
}
.l2-footer-links a:hover { color: #fff; text-decoration: underline; }
.l2-footer-copyright {
  font-size: 13px;
  color: #7a7f85;
  border-top: 1px solid rgba(255,255,255,.08);
  padding-top: 16px;
  margin-top: 4px;
}

/* ---------- Legal pages (Privacy / Terms) ---------- */
.l2-legal {
  max-width: 760px;
  margin: 0 auto;
}
.l2-legal .l2-legal-updated {
  color: var(--l2-text-secondary);
  font-size: 14px;
  margin-bottom: 32px;
}
.l2-legal h2 {
  font-size: 21px;
  margin: 36px 0 12px;
  color: var(--l2-text);
}
.l2-legal h2:first-of-type { margin-top: 0; }
.l2-legal p {
  font-size: 16px;
  line-height: 1.65;
  color: var(--l2-text);
  margin: 0 0 14px;
}
.l2-legal ul {
  margin: 0 0 14px;
  padding-left: 22px;
}
.l2-legal li {
  font-size: 16px;
  line-height: 1.65;
  color: var(--l2-text);
  margin-bottom: 6px;
}
.l2-legal a { color: var(--l2-accent); font-weight: 600; }

/* ---------- Buttons ---------- */
.l2-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: none;
  border-radius: 50px;
  padding: 13px 28px;
  font-size: 16px;
  font-weight: 700;
  background: var(--l2-accent);
  color: #fff;
  text-decoration: none;
  transition: background .15s ease, transform .1s ease;
}
.l2-btn:hover { background: var(--l2-accent-dark); }
.l2-btn:active { transform: scale(.98); }
.l2-btn-outline {
  background: transparent;
  color: var(--l2-text);
  border: 1px solid var(--l2-border);
}
.l2-btn-outline:hover { background: var(--l2-bg-alt); }
.l2-btn-block { width: 100%; }
.l2-btn:disabled { opacity: .5; cursor: default; }

/* ---------- Browse page ---------- */
.l2-hero {
  padding: 36px 0 24px;
}
.l2-hero h1 { font-size: 30px; margin: 0 0 8px; }
.l2-hero p { font-size: 17px; color: var(--l2-text-secondary); margin: 0; max-width: 640px; }

.l2-filters {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}
.l2-cat-buttons {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.l2-filter-btn {
  background: var(--l2-bg);
  border: 1px solid var(--l2-border);
  border-radius: 50px;
  padding: 9px 18px;
  font-size: 15px;
  font-weight: 600;
  color: var(--l2-text-secondary);
}
.l2-filter-btn.active {
  background: var(--l2-text);
  color: #fff;
  border-color: var(--l2-text);
}
.l2-search {
  flex: 1;
  min-width: 200px;
  border: 1px solid var(--l2-border);
  border-radius: 50px;
  padding: 10px 18px;
  font-size: 16px;
  background: var(--l2-bg);
  color: var(--l2-text);
}
.l2-search:focus { outline: 2px solid var(--l2-accent); outline-offset: 1px; }

.l2-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 22px;
}
.l2-card {
  background: var(--l2-bg);
  border: 1px solid var(--l2-border);
  border-radius: var(--l2-radius);
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  transition: transform .15s ease, box-shadow .15s ease;
}
.l2-card:hover { transform: translateY(-3px); box-shadow: 0 10px 24px rgba(0,0,0,.08); }
.l2-card-img { aspect-ratio: 1; width: 100%; }
.l2-card-body { padding: 14px 16px 16px; }
.l2-card-cat { font-size: 13px; font-weight: 700; color: var(--l2-accent); text-transform: uppercase; letter-spacing: .03em; margin-bottom: 4px; }
.l2-card-title {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 6px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.l2-card-price { font-size: 17px; font-weight: 800; }

.l2-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 60px 20px;
  color: var(--l2-text-secondary);
  font-size: 17px;
}

/* ---------- Product detail page ---------- */
.l2-breadcrumb {
  font-size: 15px;
  color: var(--l2-text-secondary);
  margin-bottom: 20px;
}
.l2-breadcrumb a { text-decoration: none; color: var(--l2-text-secondary); }
.l2-breadcrumb a:hover { text-decoration: underline; }

.l2-product {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 44px;
  align-items: start;
}
.l2-gallery-main { border-radius: var(--l2-radius); overflow: hidden; aspect-ratio: 1; margin-bottom: 12px; }
.l2-gallery-thumbs { display: flex; gap: 10px; flex-wrap: wrap; }
.l2-thumb {
  width: 76px; height: 76px; border-radius: var(--l2-radius-sm);
  overflow: hidden; border: 2px solid transparent; padding: 0; background: none;
  flex-shrink: 0;
}
.l2-thumb.active { border-color: var(--l2-accent); }

.l2-info-cat { font-size: 14px; font-weight: 700; color: var(--l2-accent); text-transform: uppercase; letter-spacing: .03em; margin-bottom: 8px; }
.l2-info h1 { font-size: 27px; line-height: 1.3; margin: 0 0 12px; }
.l2-info-price { font-size: 26px; font-weight: 800; margin-bottom: 18px; }
.l2-info-desc { font-size: 16px; color: var(--l2-text-secondary); line-height: 1.6; margin-bottom: 22px; }
.l2-badge {
  display: inline-block;
  font-size: 13px;
  font-weight: 700;
  background: var(--l2-bg-alt);
  border: 1px solid var(--l2-border);
  border-radius: 50px;
  padding: 5px 12px;
  margin-bottom: 20px;
}

.l2-qty-row { display: flex; align-items: center; gap: 16px; margin-bottom: 18px; }
.l2-qty-stepper {
  display: flex; align-items: center;
  border: 1px solid var(--l2-border); border-radius: 50px; overflow: hidden;
}
.l2-qty-stepper button {
  background: var(--l2-bg-alt); border: none; width: 40px; height: 40px;
  font-size: 18px; font-weight: 700; color: var(--l2-text);
}
.l2-qty-stepper span { width: 40px; text-align: center; font-size: 16px; font-weight: 700; }

.l2-add-row { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 24px; }
.l2-add-note { font-size: 14px; color: var(--l2-accent); font-weight: 700; display: none; }
.l2-add-note.show { display: block; }

.l2-related h2 { font-size: 20px; margin: 50px 0 18px; }

/* ---------- Cart page ---------- */
.l2-cart-item {
  display: flex;
  gap: 16px;
  padding: 18px 0;
  border-bottom: 1px solid var(--l2-border);
  align-items: center;
}
.l2-cart-item-img { width: 88px; height: 88px; border-radius: var(--l2-radius-sm); overflow: hidden; flex-shrink: 0; }
.l2-cart-item-info { flex: 1; min-width: 0; }
.l2-cart-item-title { font-size: 16px; font-weight: 700; margin-bottom: 4px; }
.l2-cart-item-cat { font-size: 14px; color: var(--l2-text-secondary); }
.l2-cart-item-price { font-size: 16px; font-weight: 700; white-space: nowrap; }
.l2-cart-remove {
  background: none; border: none; color: var(--l2-text-secondary);
  font-size: 14px; text-decoration: underline; padding: 0; margin-top: 6px;
}
.l2-cart-remove:hover { color: #c0392b; }

.l2-cart-summary {
  background: var(--l2-bg);
  border: 1px solid var(--l2-border);
  border-radius: var(--l2-radius);
  padding: 22px;
  margin-top: 24px;
  max-width: 380px;
  margin-left: auto;
}
.l2-summary-row { display: flex; justify-content: space-between; font-size: 16px; margin-bottom: 10px; }
.l2-summary-total { font-size: 19px; font-weight: 800; border-top: 1px solid var(--l2-border); padding-top: 12px; margin-top: 4px; }

.l2-checkout-confirm {
  text-align: center;
  padding: 60px 20px;
}
.l2-checkout-confirm .l2-check {
  width: 64px; height: 64px; border-radius: 50%; background: var(--l2-accent);
  color: #fff; display: flex; align-items: center; justify-content: center;
  font-size: 32px; margin: 0 auto 18px;
}
.l2-checkout-confirm h2 { font-size: 24px; margin: 0 0 10px; }
.l2-checkout-confirm p { color: var(--l2-text-secondary); font-size: 16px; max-width: 420px; margin: 0 auto 24px; }

/* ---------- Admin: dashboard + editor (ghost2gether only) ---------- */
.l2-admin-gate {
  text-align: center;
  padding: 80px 20px;
  color: var(--l2-text-secondary);
  font-size: 17px;
}
.l2-admin-gate a { color: var(--l2-accent); font-weight: 700; text-decoration: none; }

.l2-admin-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--l2-bg);
  border: 1px solid var(--l2-border);
  border-radius: var(--l2-radius);
  overflow: hidden;
}
.l2-admin-table th, .l2-admin-table td {
  text-align: left;
  padding: 12px 14px;
  border-bottom: 1px solid var(--l2-border);
  font-size: 15px;
  vertical-align: middle;
}
.l2-admin-table th { background: var(--l2-bg-alt); font-weight: 700; color: var(--l2-text-secondary); font-size: 13px; text-transform: uppercase; letter-spacing: .03em; }
.l2-admin-table tr:last-child td { border-bottom: none; }
.l2-admin-thumb { width: 44px; height: 44px; border-radius: var(--l2-radius-sm); object-fit: cover; display: block; }
.l2-admin-actions { display: flex; gap: 10px; align-items: center; margin-bottom: 18px; justify-content: space-between; flex-wrap: wrap; }
.l2-admin-link { font-size: 15px; font-weight: 700; color: var(--l2-accent); text-decoration: none; }
.l2-admin-link:hover { text-decoration: underline; }
.l2-admin-danger { color: #c0392b; }

.l2-form-row { margin-bottom: 18px; }
.l2-form-row label { display: block; font-size: 14px; font-weight: 700; color: var(--l2-text-secondary); margin-bottom: 6px; }
.l2-form-input, .l2-form-select, .l2-form-textarea {
  width: 100%;
  border: 1px solid var(--l2-border);
  border-radius: var(--l2-radius-sm);
  padding: 11px 13px;
  font-size: 16px;
  font-family: inherit;
  color: var(--l2-text);
  background: var(--l2-bg);
}
.l2-form-input:focus, .l2-form-select:focus, .l2-form-textarea:focus { outline: 2px solid var(--l2-accent); outline-offset: 1px; }
.l2-form-textarea { min-height: 140px; resize: vertical; }
.l2-form-check { display: flex; align-items: center; gap: 8px; font-size: 16px; }
.l2-form-two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }

.l2-image-manager { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 10px; }
.l2-image-slot {
  width: 130px;
  border: 1px solid var(--l2-border);
  border-radius: var(--l2-radius-sm);
  overflow: hidden;
  background: var(--l2-bg);
}
.l2-image-slot img { width: 100%; aspect-ratio: 1; object-fit: cover; display: block; }
.l2-image-slot-controls { display: flex; align-items: center; justify-content: space-between; padding: 6px 8px; font-size: 13px; }
.l2-image-slot-controls button {
  background: none; border: none; cursor: pointer; font-size: 14px; color: var(--l2-text-secondary); padding: 2px 4px;
}
.l2-image-slot-controls button:hover { color: var(--l2-text); }
.l2-image-slot-controls button:disabled { opacity: .3; cursor: default; }
.l2-image-upload-slot {
  width: 130px; aspect-ratio: 1;
  border: 2px dashed var(--l2-border);
  border-radius: var(--l2-radius-sm);
  display: flex; align-items: center; justify-content: center;
  color: var(--l2-text-secondary); font-size: 14px; text-align: center; cursor: pointer;
  background: var(--l2-bg-alt);
}
.l2-image-upload-slot:hover { border-color: var(--l2-accent); color: var(--l2-accent); }

.l2-save-status { font-size: 15px; font-weight: 700; margin-left: 12px; color: var(--l2-accent); }

/* ---------- Responsive ---------- */
@media (max-width: 760px) {
  .l2-product { grid-template-columns: 1fr; gap: 26px; }
  .l2-hero h1 { font-size: 25px; }
  .l2-info h1 { font-size: 23px; }
  .l2-nav-inner { gap: 14px; }
  .l2-nav-links { gap: 14px; order: 3; width: 100%; }
  .l2-cart-item { flex-wrap: wrap; }
  .l2-form-two-col { grid-template-columns: 1fr; }
  .l2-admin-table { display: block; overflow-x: auto; }
}

/* ---------- Buy Now button ---------- */
.l2-btn-buy {
  background: #1a1a1a;
}
.l2-btn-buy:hover { background: #000; }

/* ---------- Alina-style chat widget ---------- */
#l2-chat-widget {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 500;
  font-family: Arial, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
#l2-chat-tab {
  display: flex;
  align-items: center;
  gap: 10px;
  border: none;
  border-radius: 50px;
  padding: 12px 20px 12px 12px;
  background: var(--l2-text);
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(0,0,0,.25);
}
.l2-chat-tab-avatar {
  width: 30px; height: 30px; border-radius: 50%; flex: none;
  background: var(--l2-accent);
}
.l2-chat-tab-lastseen { opacity: .85; font-size: 13px; font-weight: 400; white-space: nowrap; }
#l2-chat-popup {
  position: absolute;
  right: 0;
  bottom: 62px;
  width: 320px;
  max-width: calc(100vw - 40px);
  max-height: 50vh;
  background: var(--l2-bg);
  border: 1px solid var(--l2-border);
  border-radius: var(--l2-radius);
  box-shadow: 0 10px 40px rgba(0,0,0,.3);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: max-height .15s ease;
}
#l2-chat-popup.expanded { max-height: 70vh; }
#l2-chat-popup.none { display: none; }
#l2-chat-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px;
  background: var(--l2-bg-alt);
  border-bottom: 1px solid var(--l2-border);
}
.l2-chat-avatar {
  width: 40px; height: 40px; border-radius: 50%; flex: none;
  background: var(--l2-accent);
}
.l2-chat-header-text { flex: 1; min-width: 0; }
#l2-chat-name { font-size: 16px; font-weight: 700; color: var(--l2-text); }
#l2-chat-lastseen { font-size: 13px; color: var(--l2-text-secondary); }
#l2-chat-expand, #l2-chat-close {
  border: 1px solid var(--l2-border); background: var(--l2-bg); font-size: 13px; font-weight: 700;
  color: var(--l2-text); cursor: pointer; padding: 6px 10px; border-radius: 8px; flex: none;
}
#l2-chat-expand:hover, #l2-chat-close:hover { background: var(--l2-bg-alt); }
#l2-chat-messages {
  padding: 14px;
  max-height: 280px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.l2-chat-msg {
  font-size: 16px;
  line-height: 1.4;
  padding: 10px 13px;
  border-radius: 14px;
  max-width: 85%;
  word-wrap: break-word;
}
.l2-chat-msg-them { align-self: flex-start; background: var(--l2-bg-alt); color: var(--l2-text); }
.l2-chat-msg-me { align-self: flex-end; background: var(--l2-accent); color: #fff; }
#l2-chat-input-row {
  display: flex;
  gap: 8px;
  padding: 12px;
  border-top: 1px solid var(--l2-border);
}
#l2-chat-input {
  flex: 1;
  font-size: 16px;
  padding: 10px 12px;
  border: 1px solid var(--l2-border);
  border-radius: 50px;
  outline: none;
}
#l2-chat-send {
  border: none;
  background: var(--l2-accent);
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  padding: 0 18px;
  border-radius: 50px;
  cursor: pointer;
}

/* ---------- Buy Now checkout modal ---------- */
#l2-checkout-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.5);
  z-index: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  font-family: Arial, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
#l2-checkout-overlay.none { display: none; }
#l2-checkout-modal {
  position: relative;
  background: var(--l2-bg);
  border-radius: var(--l2-radius);
  padding: 28px;
  width: 420px;
  max-width: 100%;
  max-height: 90vh;
  overflow-y: auto;
}
#l2-checkout-modal h2 { font-size: 22px; margin: 0 0 14px; color: var(--l2-text); }
#l2-checkout-close {
  position: absolute;
  top: 14px; right: 14px;
  border: none; background: none; font-size: 22px; line-height: 1;
  color: var(--l2-text-secondary); cursor: pointer;
}
#l2-checkout-summary { margin-bottom: 16px; }
.l2-co-summary-row {
  display: flex; justify-content: space-between;
  font-size: 16px; font-weight: 700; color: var(--l2-text);
  padding: 10px 0; border-bottom: 1px solid var(--l2-border);
}
.l2-co-row { margin-bottom: 14px; }
.l2-co-row label { display: block; font-size: 15px; font-weight: 600; color: var(--l2-text); margin-bottom: 6px; }
.l2-co-row input {
  width: 100%;
  font-size: 16px;
  padding: 11px 13px;
  border: 1px solid var(--l2-border);
  border-radius: var(--l2-radius-sm);
  box-sizing: border-box;
  font-family: inherit;
}
.l2-co-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.l2-co-error { color: #c0392b; font-size: 15px; margin-bottom: 10px; min-height: 18px; }
.l2-co-fineprint { font-size: 13px; color: var(--l2-text-secondary); margin-top: 12px; text-align: center; }
#l2-checkout-success { text-align: center; padding: 10px 0; }
#l2-checkout-success h2 { color: var(--l2-accent); }
#l2-checkout-success p { font-size: 16px; color: var(--l2-text-secondary); margin: 10px 0 20px; }

@media (max-width: 480px) {
  #l2-chat-popup { width: calc(100vw - 40px); }
}
