/* Nicte Flipbook Style - Warm Editorial & Dark Petroleum Themes */
@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,400..900;1,400..900&family=Inter:wght@300;400;500;600;700&family=Outfit:wght@300;400;500;600;700;800&family=Plus+Jakarta+Sans:wght@300;400;500;600;700&display=swap');

:root {
  /* Editorial Light Sand Theme (Primary) */
  --color-edit-bg: #F5EFEB; /* Sand base */
  --color-edit-paper: #FCFAF6; /* Warm white paper */
  --color-edit-spine: #E5DDD5;
  --color-edit-text: #1C2731; /* Charcoal */
  --color-edit-text-muted: #627281;
  --color-edit-border: #E8E0D7;
  
  /* Official Brand Accent Colors */
  --color-accent-cyan: #58BDB9;
  --color-accent-cyan-dark: #3B8C97;
  --color-petroleum-logo: #2A6177;
  --color-petroleum-text: #344352;
  
  /* Dark Petroleum Alternative Theme */
  --color-dark-bg: #0B131A;
  --color-dark-paper: #0F1B26;
  --color-dark-spine: #080D12;
  --color-dark-text: #F8FAFC;
  --color-dark-text-muted: #8E9BAE;
  --color-dark-border: rgba(88, 189, 185, 0.15);

  /* Fonts */
  --font-titles: 'Outfit', sans-serif;
  --font-body: 'Inter', sans-serif;
  --font-accent: 'Plus Jakarta Sans', sans-serif;

  /* Global Transitions */
  --transition-page: transform 0.8s cubic-bezier(0.2, 0.8, 0.2, 1);
  --transition-fast: all 0.2s ease;
}

/* Global Reset & Theme Base */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  background-color: var(--color-edit-bg);
  color: var(--color-edit-text);
  font-family: var(--font-body);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  transition: background-color 0.5s ease, color 0.5s ease;
}

/* Dark theme body helper */
body.dark-mode {
  background-color: var(--color-dark-bg);
  color: var(--color-dark-text);
}

.app-container {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Brand Top Bar */
.brand-bar {
  height: 80px;
  background: rgba(252, 250, 246, 0.8);
  border-bottom: 1px solid var(--color-edit-border);
  backdrop-filter: blur(10px);
  padding: 0 40px;
  display: flex;
  justify-content: center;
  gap: 25px;
  align-items: center;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  transition: all 0.5s ease;
}

body.dark-mode .brand-bar {
  background: rgba(15, 27, 38, 0.85);
  border-bottom: 1px solid var(--color-dark-border);
}

.brand-bar-logo {
  display: flex;
  align-items: center;
}

.bb-logo-img-svg {
  height: 48px;
  object-fit: contain;
}

.brand-bar-separator {
  color: var(--color-edit-border);
  font-size: 18px;
  font-weight: 300;
  user-select: none;
  transition: all 0.5s ease;
}

body.dark-mode .brand-bar-separator {
  color: var(--color-dark-border);
}

.logo-dark-only {
  display: none;
}

body.dark-mode .logo-light-only {
  display: none;
}

body.dark-mode .logo-dark-only {
  display: block;
}

.brand-bar-title {
  font-family: var(--font-titles);
  font-weight: 600;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--color-edit-text-muted);
}

body.dark-mode .brand-bar-title {
  color: var(--color-dark-text-muted);
}

/* Theme switch button */
.theme-btn {
  background: none;
  border: 1px solid var(--color-edit-border);
  padding: 8px 16px;
  border-radius: 20px;
  font-family: var(--font-titles);
  font-size: 13px;
  font-weight: 600;
  color: var(--color-edit-text);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: var(--transition-fast);
}

body.dark-mode .theme-btn {
  border-color: var(--color-dark-border);
  color: var(--color-dark-text);
}

.theme-btn:hover {
  background: rgba(59, 140, 151, 0.08);
}

/* 3D Flipbook Workspace Layout */
.flipbook-wrapper {
  flex: 1;
  margin-top: 80px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
}

.flipbook-container {
  width: 980px;
  height: 620px;
  position: relative;
  perspective: 2000px;
}

/* The Book Spread Container */
.book {
  width: 100%;
  height: 100%;
  position: relative;
  transform-style: preserve-3d;
  -webkit-transform-style: preserve-3d;
  transition: transform 0.5s ease;
}

/* Spine shadow base behind sheets */
.book::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 6px;
  height: 100%;
  background: rgba(0,0,0,0.1);
  box-shadow: 0 0 20px rgba(0,0,0,0.3);
  z-index: 1;
  pointer-events: none;
}

/* Pages / Sheets */
.page {
  width: 50%;
  height: 100%;
  position: absolute;
  top: 0;
  right: 0;
  transform-origin: left center;
  transform-style: preserve-3d;
  -webkit-transform-style: preserve-3d;
  transition: var(--transition-page);
  z-index: 2;
}

/* Front & Back Faces of each Sheet */
.page-side {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  background-color: var(--color-edit-paper);
  border: 1px solid var(--color-edit-border);
  padding: 40px 50px;
  display: flex;
  flex-direction: column;
  box-shadow: 5px 5px 20px rgba(0, 0, 0, 0.03), -5px -5px 20px rgba(255, 255, 255, 0.4);
  transition: background-color 0.5s ease, border-color 0.5s ease;
}

body.dark-mode .page-side {
  background-color: var(--color-dark-paper);
  border-color: var(--color-dark-border);
  box-shadow: 10px 10px 30px rgba(0, 0, 0, 0.3);
}

/* Fold orientation styling for book look */
.page-side.front {
  z-index: 2;
  border-radius: 0 16px 16px 0;
  transform: translateZ(1px);
  /* Spine shadow on the left edge */
  box-shadow: inset 18px 0 24px -12px rgba(0,0,0,0.06), 5px 5px 15px rgba(0,0,0,0.04);
}

body.dark-mode .page-side.front {
  box-shadow: inset 18px 0 24px -12px rgba(0,0,0,0.4), 10px 10px 30px rgba(0, 0, 0, 0.3);
}

.page-side.back {
  transform: rotateY(180deg) translateZ(1px);
  border-radius: 16px 0 0 16px;
  /* Spine shadow on the right edge */
  box-shadow: inset -18px 0 24px -12px rgba(0,0,0,0.06), -5px 5px 15px rgba(0,0,0,0.04);
}

body.dark-mode .page-side.back {
  box-shadow: inset -18px 0 24px -12px rgba(0,0,0,0.4), -10px 10px 30px rgba(0, 0, 0, 0.3);
}

/* Flipped State Class (triggered by JS) */
.page.flipped {
  transform: rotateY(-180deg);
}

/* Cover Styling (Front Page) */
.cover-page {
  background: var(--color-petroleum-text);
  border: 1px solid rgba(0,0,0,0.15);
  border-radius: 0 20px 20px 0 !important;
  color: #FFFFFF;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 60px 50px;
  position: relative;
  overflow: hidden;
  box-shadow: inset 2px 2px 1px rgba(255,255,255,0.08), inset 18px 0 24px -12px rgba(0,0,0,0.3), 10px 10px 40px rgba(0,0,0,0.15);
}

body.dark-mode .cover-page {
  background: #080D12;
  border-color: var(--color-dark-border);
}

.cover-accent {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 8px;
  background: linear-gradient(90deg, var(--color-accent-cyan) 0%, var(--color-accent-cyan-dark) 100%);
}

.cover-logo-area {
  display: flex;
  align-items: center;
}

.cover-logo-svg {
  height: 60px;
  object-fit: contain;
  filter: drop-shadow(0 0 8px rgba(88,189,185,0.3));
}

.cover-title-group {
  margin-top: -40px;
}

.cover-subtitle {
  font-family: var(--font-accent);
  font-size: 13px;
  font-weight: 700;
  color: var(--color-accent-cyan);
  letter-spacing: 3px;
  text-transform: uppercase;
  margin-bottom: 16px;
  display: block;
}

.cover-title {
  font-family: var(--font-titles);
  font-size: 36px;
  line-height: 1.15;
  font-weight: 600;
  letter-spacing: -1px;
  margin-bottom: 20px;
}

.cover-version {
  font-size: 14px;
  color: rgba(255,255,255,0.4);
}

.cover-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--font-accent);
  font-size: 12px;
  color: rgba(255,255,255,0.6);
}

.hint-icon {
  animation: bounceRight 2s infinite;
  color: var(--color-accent-cyan);
  font-size: 16px;
}

/* Page Headers & Footers */
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--color-edit-border);
  padding-bottom: 12px;
  margin-bottom: 30px;
}

body.dark-mode .page-header {
  border-color: var(--color-dark-border);
}

.page-num {
  font-family: var(--font-accent);
  font-size: 11px;
  font-weight: 700;
  color: var(--color-accent-cyan-dark);
}

body.dark-mode .page-num {
  color: var(--color-accent-cyan);
}

.page-header-title {
  font-family: var(--font-titles);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--color-edit-text-muted);
}

body.dark-mode .page-header-title {
  color: var(--color-dark-text-muted);
}

/* Table of Contents Page */
.index-page {
  justify-content: flex-start !important;
}

.index-content {
  display: flex;
  flex-direction: column;
  flex: 1;
  justify-content: center;
}

.index-list {
  list-style: none;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px 20px;
  margin-top: 15px;
  max-height: 420px;
  overflow-y: auto;
  padding-right: 8px;
}

.index-list::-webkit-scrollbar {
  width: 4px;
}

.index-list::-webkit-scrollbar-track {
  background: transparent;
}

.index-list::-webkit-scrollbar-thumb {
  background: var(--color-accent-cyan-dark);
  border-radius: 4px;
}

body.dark-mode .index-list::-webkit-scrollbar-thumb {
  background: var(--color-accent-cyan);
}

.index-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--font-titles);
  font-size: 11px;
  font-weight: 600;
  color: var(--color-edit-text);
  padding: 4px 0;
  border-bottom: 1px dashed var(--color-edit-border);
  cursor: pointer;
  transition: var(--transition-fast);
}

body.dark-mode .index-list li {
  color: var(--color-dark-text);
  border-color: var(--color-dark-border);
}

.index-list li:hover {
  color: var(--color-accent-cyan-dark);
  padding-left: 4px;
}

body.dark-mode .index-list li:hover {
  color: var(--color-accent-cyan);
}

/* Editorial Style Pages */
.editorial-style {
  justify-content: flex-start;
}

.editorial-content {
  display: flex;
  flex-direction: column;
  flex: 1;
}

.editorial-tag {
  font-family: var(--font-accent);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--color-accent-cyan-dark);
  margin-bottom: 12px;
}

body.dark-mode .editorial-tag {
  color: var(--color-accent-cyan);
}

.editorial-heading {
  font-family: var(--font-titles);
  font-size: 32px;
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 24px;
  letter-spacing: -0.5px;
}

.editorial-paragraph {
  font-size: 15px;
  line-height: 1.7;
  color: var(--color-edit-text-muted);
  margin-bottom: 16px;
}

body.dark-mode .editorial-paragraph {
  color: var(--color-dark-text-muted);
}

.italic-highlight {
  font-style: italic;
  color: var(--color-edit-text);
  font-weight: 500;
}

body.dark-mode .italic-highlight {
  color: var(--color-dark-text);
}

.decorative-line {
  height: 1px;
  background: var(--color-edit-border);
  width: 80px;
  margin: 20px 0;
}

body.dark-mode .decorative-line {
  background: var(--color-dark-border);
}

.editorial-blockquote {
  border-left: 3px solid var(--color-accent-cyan);
  padding-left: 20px;
  font-style: italic;
  font-size: 16px;
  color: var(--color-accent-cyan-dark);
  margin-top: 30px;
  line-height: 1.5;
}

body.dark-mode .editorial-blockquote {
  color: var(--color-accent-cyan);
}

/* Values stack page */
.editorial-values-stack {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.val-stack-item {
  border-bottom: 1px solid var(--color-edit-border);
  padding-bottom: 12px;
}

body.dark-mode .val-stack-item {
  border-color: var(--color-dark-border);
}

.val-stack-item:last-child {
  border-bottom: none;
}

.val-stack-item h5 {
  font-family: var(--font-titles);
  font-size: 16px;
  font-weight: 700;
  color: var(--color-edit-text);
  margin-bottom: 4px;
}

body.dark-mode .val-stack-item h5 {
  color: var(--color-dark-text);
}

.val-stack-item p {
  font-size: 13px;
  color: var(--color-edit-text-muted);
}

body.dark-mode .val-stack-item p {
  color: var(--color-dark-text-muted);
}

/* Voice example tone box */
.editorial-tone-rules {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 20px;
}

.tone-rule-box {
  padding: 20px;
  border-radius: 12px;
}

.tone-rule-box.yes {
  background: rgba(88, 189, 185, 0.06);
  border-left: 3px solid var(--color-accent-cyan);
}

.tone-rule-box.no {
  background: rgba(244, 63, 94, 0.04);
  border-left: 3px solid #F43F5E;
}

.tone-rule-box .label {
  font-family: var(--font-accent);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  margin-bottom: 6px;
  display: block;
}

.tone-rule-box.yes .label { color: var(--color-accent-cyan-dark); }
body.dark-mode .tone-rule-box.yes .label { color: var(--color-accent-cyan); }
.tone-rule-box.no .label { color: #F43F5E; }

.tone-rule-box p {
  font-size: 13.5px;
  line-height: 1.4;
}

/* Logo Viewport & Security controls in book */
.logo-viewport-editorial {
  width: 100%;
  height: 220px;
  background: rgba(0,0,0,0.03);
  border: 1px solid var(--color-edit-border);
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  margin-bottom: 20px;
}

body.dark-mode .logo-viewport-editorial {
  background: rgba(0,0,0,0.25);
  border-color: var(--color-dark-border);
}

.logo-wrapper-inner {
  max-width: 60%;
  max-height: 60%;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
  transition: var(--transition-fast);
}

.logo-wrapper-inner img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.blueprint-overlay-editorial {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  transition: opacity 0.2s ease;
  overflow: hidden;
  border-radius: 12px;
  z-index: 1;
}

.bp-line-h, .bp-line-v, .bp-line-d1, .bp-line-d2 {
  position: absolute;
  border-top: 1px dashed rgba(88, 189, 185, 0.35);
}

.bp-line-h {
  top: 50%;
  left: 0;
  width: 100%;
  transform: translateY(-50%);
}

.bp-line-v {
  left: 50%;
  top: 0;
  height: 100%;
  width: 0;
  border-left: 1px dashed rgba(88, 189, 185, 0.35);
  transform: translateX(-50%);
}

.bp-line-d1 {
  top: 0;
  left: 0;
  width: 150%;
  transform: rotate(32deg);
  transform-origin: top left;
}

.bp-line-d2 {
  top: 0;
  right: 0;
  width: 150%;
  transform: rotate(-32deg);
  transform-origin: top right;
}

.bp-grid {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: 
    linear-gradient(rgba(88, 189, 185, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(88, 189, 185, 0.08) 1px, transparent 1px);
  background-size: 20px 20px;
  background-position: center;
}

.slider-box-editorial {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-titles);
  font-size: 12px;
  color: var(--color-edit-text-muted);
}

body.dark-mode .slider-box-editorial {
  color: var(--color-dark-text-muted);
}

.slider-custom {
  flex: 1;
  -webkit-appearance: none;
  height: 4px;
  border-radius: 2px;
  background: rgba(88, 189, 185, 0.2);
  outline: none;
}

.slider-custom::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--color-accent-cyan);
  cursor: pointer;
  box-shadow: 0 0 8px rgba(88,189,185,0.5);
}

/* Double Pane Contrast Test */
.contrast-swaps-editorial {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin-top: 8px;
}

.light-logo-pane, .dark-logo-pane {
  border-radius: 12px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--color-edit-border);
  position: relative;
  height: 100px;
}

body.dark-mode .light-logo-pane, body.dark-mode .dark-logo-pane {
  border-color: var(--color-dark-border);
}

.light-logo-pane {
  background: #FFFFFF;
}

.dark-logo-pane {
  background: #0B131A;
}

.pane-tag {
  position: absolute;
  top: 8px;
  left: 10px;
  font-family: var(--font-accent);
  font-size: 7px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--color-edit-text-muted);
}

.light-logo-pane img {
  height: 42px;
  width: auto;
  max-width: 85%;
}

.dark-logo-pane img {
  height: 54px;
  width: auto;
  max-width: 85%;
}

.spec-footer-editorial {
  border-top: 1px solid var(--color-edit-border);
  padding-top: 10px;
  margin-top: 12px;
  font-size: 10.5px;
  color: var(--color-edit-text-muted);
  line-height: 1.4;
}

body.dark-mode .spec-footer-editorial {
  border-color: var(--color-dark-border);
  color: var(--color-dark-text-muted);
}

/* Color Palette Swatches */
.palette-swatches-editorial {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 10px;
}

.swatch-item-edit {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px;
  background: rgba(0,0,0,0.02);
  border: 1px solid var(--color-edit-border);
  border-radius: 12px;
  cursor: pointer;
  transition: var(--transition-fast);
}

body.dark-mode .swatch-item-edit {
  background: rgba(0,0,0,0.15);
  border-color: var(--color-dark-border);
}

.swatch-item-edit:hover {
  border-color: var(--color-accent-cyan-dark);
  transform: translateY(-2px);
}

body.dark-mode .swatch-item-edit:hover {
  border-color: var(--color-accent-cyan);
}

.color-dot {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  box-shadow: inset 0 0 1px rgba(255,255,255,0.15);
}

.color-info-edit {
  display: flex;
  flex-direction: column;
}

.color-info-edit strong {
  font-family: var(--font-titles);
  font-size: 15px;
  color: var(--color-edit-text);
  margin-bottom: 2px;
}

body.dark-mode .color-info-edit strong {
  color: var(--color-dark-text);
}

.color-info-edit span {
  font-family: var(--font-accent);
  font-size: 11px;
  color: var(--color-edit-text-muted);
}

body.dark-mode .color-info-edit span {
  color: var(--color-dark-text-muted);
}

/* Typography Split block */
.typography-splits-editorial {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 30px;
}

.typo-split-block {
  border-bottom: 1px solid var(--color-edit-border);
  padding-bottom: 16px;
}

body.dark-mode .typo-split-block {
  border-color: var(--color-dark-border);
}

.typo-split-block h4 {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 4px;
}

.role-tag {
  font-family: var(--font-accent);
  font-size: 10px;
  color: var(--color-accent-cyan-dark);
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 1px;
  margin-bottom: 12px;
  display: block;
}

body.dark-mode .role-tag {
  color: var(--color-accent-cyan);
}

.typo-playground-box {
  background: rgba(0,0,0,0.02);
  border: 1px solid var(--color-edit-border);
  border-radius: 12px;
  padding: 16px;
  flex: 1;
  display: flex;
  flex-direction: column;
  margin-top: 10px;
}

body.dark-mode .typo-playground-box {
  background: rgba(0,0,0,0.15);
  border-color: var(--color-dark-border);
}

.play-label {
  font-family: var(--font-accent);
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--color-edit-text-muted);
  margin-bottom: 10px;
  display: block;
}

.play-textarea {
  border: none;
  background: none;
  outline: none;
  font-size: 14px;
  line-height: 1.5;
  color: var(--color-edit-text);
  flex: 1;
  overflow-y: auto;
  resize: none;
  font-family: var(--font-body);
}

body.dark-mode .play-textarea {
  color: var(--color-dark-text);
}

/* Applications: Web Dashboard mini */
.mock-web-dashboard-editorial {
  width: 100%;
  height: 280px;
  background: #0B131A;
  border: 1px solid rgba(88, 189, 185, 0.15);
  border-radius: 14px;
  box-shadow: 0 15px 30px rgba(0,0,0,0.25);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.header-mock {
  height: 24px;
  background: rgba(21, 39, 54, 0.8);
  border-bottom: 1px solid rgba(88, 189, 185, 0.08);
  display: flex;
  align-items: center;
  padding: 0 10px;
  gap: 5px;
}

.mdot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255,255,255,0.2);
}

.body-mock {
  flex: 1;
  display: flex;
}

.sbar {
  width: 90px;
  background: rgba(11, 19, 26, 0.4);
  border-right: 1px solid rgba(88,189,185,0.05);
  padding: 12px 10px;
}

.mock-line {
  height: 6px;
  background: rgba(255,255,255,0.05);
  border-radius: 3px;
  margin-bottom: 8px;
}

.mock-line.active {
  background: rgba(88,189,185,0.18);
  width: 80%;
}

.cbox {
  flex: 1;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.mock-card-edit {
  background: rgba(21, 39, 54, 0.4);
  border: 1px solid rgba(88, 189, 185, 0.08);
  border-radius: 8px;
  padding: 12px;
}

.progress-bar-mock {
  height: 4px;
  background: rgba(255,255,255,0.05);
  border-radius: 2px;
  margin-top: 8px;
}

.progress-mock-inner {
  height: 100%;
  width: 68%;
  background: var(--color-accent-cyan);
  border-radius: 2px;
}

/* Packaging 3D Box mini */
.box-3d-wrapper-editorial {
  width: 100%;
  height: 250px;
  margin-top: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  perspective: 1000px;
}

.packaging-box-edit {
  position: relative;
  width: 135px;
  height: 135px;
  transform-style: preserve-3d;
  -webkit-transform-style: preserve-3d;
  transform: rotateX(-20deg) rotateY(45deg);
  animation: boxRotate 10s linear infinite;
}

.cube-face-edit {
  position: absolute;
  top: 0;
  left: 0;
  width: 135px;
  height: 135px;
  background: var(--color-dark-paper);
  border: 2px solid var(--color-accent-cyan-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: inset 0 0 20px rgba(88, 189, 185, 0.2);
}

.cube-face-edit img {
  width: 38px;
  height: 38px;
  object-fit: contain;
}

.c-front  { transform: rotateY(0deg) translateZ(67.5px); }
.c-right  { transform: rotateY(90deg) translateZ(67.5px); }
.c-left   { transform: rotateY(-90deg) translateZ(67.5px); }
.c-back   { transform: rotateY(180deg) translateZ(67.5px); }
.c-top    { transform: rotateX(90deg) translateZ(67.5px); background: #132433; }
.c-bottom { transform: rotateX(-90deg) translateZ(67.5px); background: #0B131A; }

.c-tape {
  position: absolute;
  top: 16px;
  left: 0;
  width: 100%;
  height: 22px;
  background: linear-gradient(90deg, var(--color-accent-cyan-dark) 0%, var(--color-accent-cyan) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-accent);
  font-size: 8px;
  font-weight: 700;
  color: var(--color-dark-bg);
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

/* Stationery layout */
.stationery-layout-editorial {
  display: flex;
  gap: 20px;
  align-items: center;
  justify-content: center;
  height: 280px;
}

.lh-mini-editorial {
  width: 170px;
  height: 240px;
  background: #FFF;
  border: 1px solid var(--color-edit-border);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(28, 39, 49, 0.06);
  padding: 16px;
  position: relative;
  overflow: hidden;
  transition: var(--transition-fast);
}

body.dark-mode .lh-mini-editorial {
  background: var(--color-dark-paper);
  border-color: var(--color-dark-border);
  box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

.lh-strip {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: linear-gradient(90deg, var(--color-accent-cyan) 0%, var(--color-accent-cyan-dark) 100%);
}

.lh-line {
  height: 4px;
  background: #F1F5F9;
  border-radius: 2px;
  margin-bottom: 8px;
}

.card-mini-editorial {
  width: 170px;
  height: 100px;
  background: #0F1B26;
  border-radius: 8px;
  border: 1px solid var(--color-dark-border);
  box-shadow: 0 10px 25px rgba(0,0,0,0.1);
  padding: 14px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

/* Premium Renders Section styles */
.render-img-box {
  width: 100%;
  height: 240px;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 10px 25px rgba(0,0,0,0.08);
  margin-bottom: 12px;
  border: 1px solid var(--color-edit-border);
}

.render-img-box.horizontal-half {
  height: 165px;
  margin-bottom: 15px;
}

body.dark-mode .render-img-box {
  border-color: var(--color-dark-border);
  box-shadow: 0 10px 30px rgba(0,0,0,0.4);
}

.render-img-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: var(--transition-smooth);
}

.render-img-box:hover img {
  transform: scale(1.03);
}

.render-caption {
  font-family: var(--font-accent);
  font-size: 11px;
  color: var(--color-edit-text-muted);
  line-height: 1.4;
  font-style: italic;
}

body.dark-mode .render-caption {
  color: var(--color-dark-text-muted);
}

/* B2B Decomposition Layout */
.decomposition-layout-editorial {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 4px;
}

.decomp-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  border-bottom: 1px dashed var(--color-edit-border);
  padding-bottom: 6px;
}

body.dark-mode .decomp-item {
  border-color: var(--color-dark-border);
}

.decomp-item:last-child {
  border-bottom: none;
}

.decomp-vector-box {
  width: 46px;
  height: 46px;
  min-width: 46px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.02);
  border: 1px solid var(--color-edit-border);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

body.dark-mode .decomp-vector-box {
  background: rgba(0, 0, 0, 0.15);
  border-color: var(--color-dark-border);
}

.decomp-vector-box img {
  width: 75%;
  height: 75%;
  object-fit: contain;
}

.decomp-info {
  flex: 1;
}

.decomp-item h5 {
  font-family: var(--font-titles);
  font-size: 12px;
  font-weight: 700;
  color: var(--color-accent-cyan-dark);
  margin-bottom: 2px;
}

body.dark-mode .decomp-item h5 {
  color: var(--color-accent-cyan);
}

.decomp-item p {
  font-size: 10.5px;
  line-height: 1.35;
  color: var(--color-edit-text-muted);
}

body.dark-mode .decomp-item p {
  color: var(--color-dark-text-muted);
}

/* Back Cover Page */
.back-cover-page {
  background: var(--color-petroleum-text);
  border: 1px solid rgba(0,0,0,0.15);
  border-radius: 20px 0 0 20px !important;
  color: #FFFFFF;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 60px 50px;
  position: relative;
  overflow: hidden;
  box-shadow: inset -2px 2px 1px rgba(255,255,255,0.08), inset -18px 0 24px -12px rgba(0,0,0,0.3), -10px 10px 40px rgba(0,0,0,0.15);
}

body.dark-mode .back-cover-page {
  background: #080D12;
  border-color: var(--color-dark-border);
}

.back-cover-accent {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 8px;
  background: linear-gradient(90deg, var(--color-accent-cyan) 0%, var(--color-accent-cyan-dark) 100%);
}

.back-cover-logo-area {
  display: flex;
  align-items: center;
}

.back-cover-logo-svg {
  height: 60px;
  object-fit: contain;
}

.back-cover-slogan {
  font-family: var(--font-titles);
  font-size: 26px;
  line-height: 1.3;
  font-weight: 600;
  color: var(--color-accent-cyan);
  font-style: italic;
  max-width: 320px;
  margin-top: -40px;
}

.back-cover-footer {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-family: var(--font-accent);
  font-size: 11px;
  color: rgba(255,255,255,0.4);
}

/* Book navigation arrows & controls */
.book-navigation {
  margin-top: 30px;
  display: flex;
  align-items: center;
  gap: 20px;
  z-index: 10;
}

.nav-btn {
  background: var(--color-edit-paper);
  border: 1px solid var(--color-edit-border);
  color: var(--color-edit-text);
  font-family: var(--font-titles);
  font-size: 14px;
  font-weight: 600;
  padding: 10px 20px;
  border-radius: 30px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.03);
  transition: var(--transition-fast);
}

body.dark-mode .nav-btn {
  background: var(--color-dark-paper);
  border-color: var(--color-dark-border);
  color: var(--color-dark-text);
  box-shadow: 0 4px 15px rgba(0,0,0,0.25);
}

.nav-btn:hover {
  background: rgba(88, 189, 185, 0.1);
  transform: translateY(-1px);
}

.page-counter-editorial {
  font-family: var(--font-accent);
  font-size: 13px;
  font-weight: 700;
  color: var(--color-accent-cyan-dark);
  letter-spacing: 1px;
}

body.dark-mode .page-counter-editorial {
  color: var(--color-accent-cyan);
}

/* Clipboard Toast */
.toast-notification {
  position: fixed;
  bottom: 40px;
  right: 40px;
  background: rgba(88, 189, 185, 0.15);
  border: 1px solid var(--color-accent-cyan);
  padding: 16px 24px;
  border-radius: 14px;
  backdrop-filter: blur(12px);
  box-shadow: 0 10px 30px rgba(88, 189, 185, 0.25);
  display: flex;
  align-items: center;
  gap: 12px;
  z-index: 1000;
  transform: translateY(100px);
  opacity: 0;
  pointer-events: none;
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.toast-notification.show {
  transform: translateY(0);
  opacity: 1;
}

.toast-notification i {
  color: var(--color-accent-cyan);
  font-size: 20px;
}

.toast-message {
  font-size: 14px;
  font-weight: 500;
  color: var(--color-edit-text);
}

body.dark-mode .toast-message {
  color: var(--color-dark-text);
}

/* Animations */
@keyframes bounceRight {
  0%, 100% { transform: translateX(0); }
  50% { transform: translateX(5px); }
}

@keyframes boxRotate {
  0% { transform: rotateX(-20deg) rotateY(0deg); }
  100% { transform: rotateX(-20deg) rotateY(360deg); }
}

/* Responsive adjustments */
@media (max-width: 1040px) {
  .flipbook-container {
    width: 740px;
    height: 520px;
  }
  .page-side {
    padding: 30px;
  }
  .editorial-heading {
    font-size: 26px;
    margin-bottom: 15px;
  }
  .editorial-paragraph {
    font-size: 13.5px;
    margin-bottom: 12px;
  }
  .lh-mini-editorial {
    width: 120px;
    height: 180px;
  }
  .card-mini-editorial {
    width: 120px;
    height: 80px;
  }
  .logo-viewport-editorial {
    height: 160px;
  }
  .render-img-box {
    height: 180px;
  }
}

/* Advanced responsive adjustments for single-page view on mobile */
@media (max-width: 768px) {
  .flipbook-container {
    width: 100%;
    max-width: 440px;
    height: 580px;
    perspective: none !important; /* Disable 3D context on mobile to prevent iOS memory crash */
  }
  .book {
    transform-style: flat !important;
    -webkit-transform-style: flat !important;
  }
  .page {
    width: 100%;
    left: 0;
    right: 0;
    transform-origin: center center !important;
    transform: translateX(100%) !important; /* Slide in from right */
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: transform 0.3s ease-in-out, opacity 0.3s ease-in-out, visibility 0.3s ease-in-out !important;
    transform-style: flat !important;
    -webkit-transform-style: flat !important;
  }
  .page.active-sheet {
    transform: translateX(0) !important;
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
  }
  .page.flipped {
    transform: translateX(-100%) !important; /* Slide out to left */
  }
  .page.active-sheet.flipped {
    transform: translateX(0) !important;
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
  }
  .page-side {
    padding: 30px 24px;
    border-radius: 16px !important;
    transform: none !important; /* Prevent mirror rendering by removing 3D rotates on mobile */
  }
  .page-side.front {
    opacity: 1;
    pointer-events: auto;
  }
  .page-side.back {
    opacity: 0;
    pointer-events: none;
  }
  .page.flipped .page-side.front {
    opacity: 0;
    pointer-events: none;
  }
  .page.flipped .page-side.back {
    opacity: 1;
    pointer-events: auto;
  }
  .book::before {
    display: none; /* Ocultar sombra central del lomo */
  }
  .brand-bar {
    height: 70px;
    padding: 0 20px;
    gap: 15px;
  }
  .bb-logo-img-svg {
    height: 36px;
  }
  .brand-bar-separator {
    display: none !important;
  }
  .flipbook-wrapper {
    margin-top: 70px;
  }
  .brand-bar-title {
    display: none; /* Ocultar título central en celulares */
  }
  .product-colors-meta {
    display: none !important;
  }
  .editorial-heading {
    font-size: 24px;
    margin-bottom: 12px;
  }
  .editorial-paragraph {
    font-size: 12.5px;
    line-height: 1.45;
  }
  .page-header {
    margin-bottom: 15px !important;
  }
  .editorial-tag {
    margin-bottom: 4px !important;
  }
  .decomposition-layout-editorial {
    gap: 4px !important;
    margin-top: 2px !important;
  }
  .decomp-item {
    gap: 8px !important;
    padding-bottom: 4px !important;
  }
  .decomp-vector-box {
    width: 36px !important;
    height: 36px !important;
    min-width: 36px !important;
    border-radius: 6px !important;
  }
  .decomp-item h5 {
    font-size: 11px !important;
    margin-bottom: 1px !important;
  }
  .decomp-item p {
    font-size: 9.5px !important;
    line-height: 1.3 !important;
  }
  .decomposition-layout-editorial + .editorial-blockquote {
    font-size: 9.5px !important;
    line-height: 1.3 !important;
    margin-top: 8px !important;
    padding-left: 10px !important;
  }
  /* Scale specific application mockups to fit inside single page */
  .mock-web-dashboard-editorial, .stationery-layout-editorial {
    height: 200px;
  }
  .lh-mini-editorial {
    width: 110px;
    height: 160px;
  }
  .card-mini-editorial {
    width: 110px;
    height: 70px;
  }
  .box-3d-wrapper-editorial {
    height: 170px;
  }
  .packaging-box-edit {
    width: 80px;
    height: 80px;
  }
  .cube-face-edit {
    width: 80px;
    height: 80px;
  }
  .c-front  { transform: rotateY(0deg) translateZ(40px); }
  .c-right  { transform: rotateY(90deg) translateZ(40px); }
  .c-left   { transform: rotateY(-90deg) translateZ(40px); }
  .c-back   { transform: rotateY(180deg) translateZ(40px); }
  .c-top    { transform: rotateX(90deg) translateZ(40px); background: #132433; }
  .c-bottom { transform: rotateX(-90deg) translateZ(40px); background: #0B131A; }
  .c-tape {
    top: 10px;
    height: 14px;
    font-size: 5px;
  }
  .book-navigation {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(252, 250, 246, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-top: 1px solid var(--color-edit-border);
    padding: 12px 20px;
    margin-top: 0 !important;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 1000;
    box-shadow: 0 -4px 15px rgba(0,0,0,0.03);
  }
  body.dark-mode .book-navigation {
    background: rgba(15, 27, 38, 0.95);
    border-top-color: var(--color-dark-border);
    box-shadow: 0 -4px 20px rgba(0,0,0,0.3);
  }
  .flipbook-wrapper {
    padding-bottom: 80px !important;
  }
}

@media (max-width: 576px) {
  .brand-bar {
    height: 60px;
    padding: 0 10px;
    gap: 10px;
  }
  .bb-logo-img-svg {
    height: 30px;
  }
  .category-jump-container label {
    display: none !important;
  }
  .flipbook-wrapper {
    padding: 10px;
    margin-top: 60px;
  }
  .book-navigation {
    gap: 10px;
  }
  .nav-btn {
    font-size: 11px;
    padding: 8px 14px;
  }

  /* Optimización de Ficha de Producto en Celular para Evitar Superposiciones */
  .product-page.page-side {
    padding: 16px 16px 12px 16px !important;
  }
  .product-page .page-header {
    margin-bottom: 8px !important;
  }
  .product-content-area {
    gap: 6px !important;
  }
  .catalog-product-row {
    gap: 8px !important;
  }
  .catalog-product-img-box {
    width: 90px !important;
    height: 90px !important;
    padding: 4px !important;
  }
  .catalog-product-title {
    font-size: 12px !important;
    margin-bottom: 1px !important;
  }
  .catalog-product-code {
    font-size: 9px !important;
  }
  .catalog-product-desc {
    font-size: 9.5px !important;
    line-height: 1.25 !important;
    margin-bottom: 2px !important;
  }
  .catalog-product-meta {
    font-size: 9px !important;
    margin-bottom: 2px !important;
  }
  .branding-badge {
    padding: 2px 4px !important;
    font-size: 8px !important;
    margin-top: 2px !important;
  }
  .catalog-product-stock-price {
    font-size: 10.5px !important;
    margin-bottom: 2px !important;
  }
  .catalog-price {
    font-size: 11px !important;
  }
  .catalog-product-actions {
    gap: 4px !important;
    margin-top: 2px !important;
  }
  .catalog-product-actions label {
    font-size: 8px !important;
  }
  .prod-color-select, .prod-qty-input {
    font-size: 10px !important;
    padding: 3px 6px !important;
    height: 24px !important;
  }
  .prod-add-btn {
    font-size: 10px !important;
    padding: 3px 8px !important;
    height: 24px !important;
  }
  .product-divider {
    margin: 4px 0 !important;
  }
}

/* Google Drive Download Button on Back Cover */
.drive-download-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(88, 189, 185, 0.15);
  border: 1px solid var(--color-accent-cyan);
  color: #FFFFFF;
  text-decoration: none;
  font-family: var(--font-accent);
  font-size: 11px;
  font-weight: 600;
  padding: 10px 18px;
  border-radius: 30px;
  transition: var(--transition-fast);
  margin-top: 10px;
  margin-bottom: 20px;
  width: fit-content;
  align-self: center;
}

.drive-download-btn:hover {
  background: var(--color-accent-cyan);
  color: var(--color-dark-bg);
  box-shadow: 0 0 15px rgba(88, 189, 185, 0.4);
  transform: translateY(-2px);
}

/* Page Lift Hover Simulation (3D curl effect - Soft paper style) */
.page:not(.flipped):hover {
  transform: rotateY(-2.5deg); /* Gentle rotation to look flexible */
}

.page.flipped:hover {
  transform: rotateY(-177.5deg); /* Gentle rotation */
}

/* Dynamic Shadow Depth adjustment on page hover */
.page:not(.flipped):hover .page-side.front {
  box-shadow: inset 18px 0 24px -12px rgba(0,0,0,0.06), 12px 12px 25px rgba(0,0,0,0.05);
}

.page.flipped:hover .page-side.back {
  box-shadow: inset -18px 0 24px -12px rgba(0,0,0,0.06), -12px 12px 25px rgba(0,0,0,0.05);
}

/* Dark Mode Shadow Depth adjustments */
body.dark-mode .page:not(.flipped):hover .page-side.front {
  box-shadow: inset 18px 0 24px -12px rgba(0,0,0,0.4), 14px 14px 30px rgba(0, 0, 0, 0.4);
}

body.dark-mode .page.flipped:hover .page-side.back {
  box-shadow: inset -18px 0 24px -12px rgba(0,0,0,0.4), -14px 14px 30px rgba(0, 0, 0, 0.4);
}

/* Rediseño Editorial de Misión y Alma de Marca */
.editorial-lead-in {
  font-family: var(--font-titles);
  font-size: 14.5px;
  font-weight: 500;
  color: var(--color-petroleum-text);
  line-height: 1.55;
  margin-bottom: 20px;
  border-left: 3px solid var(--color-accent-cyan);
  padding-left: 15px;
}

body.dark-mode .editorial-lead-in {
  color: #FFF;
}

.mision-features-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 15px;
  margin-bottom: 15px;
}

.mision-feature-item {
  background: rgba(88, 189, 185, 0.03);
  border: 1px solid rgba(88, 189, 185, 0.08);
  border-radius: 8px;
  padding: 10px 12px;
}

body.dark-mode .mision-feature-item {
  background: rgba(255, 255, 255, 0.01);
  border-color: var(--color-dark-border);
}

.mision-feature-item h5 {
  font-family: var(--font-titles);
  font-size: 10.5px;
  font-weight: 700;
  color: var(--color-accent-cyan-dark);
  margin: 0 0 4px 0;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

body.dark-mode .mision-feature-item h5 {
  color: var(--color-accent-cyan-light);
}

.mision-feature-item p {
  font-size: 9px;
  line-height: 1.35;
  color: var(--color-edit-text-muted);
  margin: 0;
}

.mision-bold-title {
  font-family: var(--font-titles);
  color: var(--color-accent-cyan-dark);
  font-weight: 700;
  letter-spacing: 0.2px;
}

body.dark-mode .mision-bold-title {
  color: var(--color-accent-cyan);
}

.purpose-card-editorial {
  background: rgba(52, 67, 82, 0.05);
  border: 1px solid rgba(88, 189, 185, 0.2);
  border-radius: 8px;
  padding: 12px 14px;
  margin-top: 15px;
  font-size: 10.5px;
  line-height: 1.45;
  color: var(--color-petroleum-text);
  position: relative;
  border-left: 4px solid var(--color-accent-cyan);
}

body.dark-mode .purpose-card-editorial {
  background: rgba(11, 19, 26, 0.4);
  border-color: var(--color-dark-border);
  color: #FFF;
}

.purpose-card-editorial strong {
  color: var(--color-accent-cyan-dark);
  display: block;
  font-family: var(--font-titles);
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 4px;
}

body.dark-mode .purpose-card-editorial strong {
  color: var(--color-accent-cyan);
}

/* Typography Manifesto Quote */
.manifesto-quote-editorial {
  font-family: var(--font-titles);
  font-size: 13.5px;
  line-height: 1.65;
  font-style: italic;
  color: var(--color-petroleum-text);
  text-align: center;
  padding: 24px 30px;
  background: rgba(88, 189, 185, 0.03);
  border-radius: 12px;
  border: 1px solid rgba(88, 189, 185, 0.08);
  margin-top: 25px;
  position: relative;
}

body.dark-mode .manifesto-quote-editorial {
  color: #FFFFFF;
  background: rgba(255, 255, 255, 0.01);
  border-color: var(--color-dark-border);
}

.manifesto-quote-editorial::before {
  content: "“";
  font-size: 60px;
  color: rgba(88, 189, 185, 0.15);
  position: absolute;
  top: -15px;
  left: 15px;
  font-family: serif;
}

.page-7-logo {
  height: 62px;
  object-fit: contain;
  filter: drop-shadow(0 4px 10px rgba(88, 189, 185, 0.2));
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), filter 0.3s ease;
}

.page-7-logo:hover {
  transform: scale(1.04) translateY(-1px);
  filter: drop-shadow(0 6px 12px rgba(88, 189, 185, 0.35));
}

/* Print Stylesheet disabled for custom B2B invoice style */

/* Product Page Layout & Catalog Content */
.product-page {
  padding: 25px 30px 20px 30px;
}

.product-page .page-header {
  margin-bottom: 15px;
  padding-bottom: 8px;
}

.product-content-area {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 10px;
  flex: 1;
  min-height: 0;
}

.catalog-product-row {
  display: flex;
  gap: 15px;
  align-items: stretch;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.product-content-area .catalog-product-row:only-child {
  flex: 0 0 48%;
}

.catalog-product-img-box {
  width: 125px;
  height: 125px;
  flex-shrink: 0;
  align-self: center;
  border-radius: 8px;
  background: #fff;
  border: 1px solid var(--color-edit-border);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px;
  position: relative;
  overflow: hidden;
}

body.dark-mode .catalog-product-img-box {
  background: #15222E;
  border-color: var(--color-dark-border);
}

.catalog-product-img-box img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  transition: transform 0.3s ease;
}

.catalog-product-img-box:hover img {
  transform: scale(1.08);
}

.catalog-product-details {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
  justify-content: space-between;
  height: 100%;
}

.catalog-product-title {
  font-family: var(--font-titles);
  font-size: 14px;
  font-weight: 700;
  color: var(--color-petroleum-text);
  margin-bottom: 2px;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

body.dark-mode .catalog-product-title {
  color: var(--color-dark-text);
}

.catalog-product-code {
  font-family: var(--font-accent);
  font-size: 10px;
  font-weight: 600;
  color: var(--color-accent-cyan-dark);
  letter-spacing: 0.5px;
  margin-bottom: 3px;
  display: inline-block;
}

body.dark-mode .catalog-product-code {
  color: var(--color-accent-cyan);
}

.catalog-product-desc {
  font-size: 10.5px;
  line-height: 1.4;
  color: var(--color-edit-text-muted);
  margin-bottom: 4px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

body.dark-mode .catalog-product-desc {
  color: var(--color-dark-text-muted);
}

.catalog-product-meta {
  font-size: 9.5px;
  line-height: 1.35;
  color: var(--color-edit-text-muted);
  margin-bottom: 4px;
  border-left: 2px solid var(--color-accent-cyan);
  padding-left: 8px;
}

body.dark-mode .catalog-product-meta {
  color: var(--color-dark-text-muted);
  border-left-color: var(--color-accent-cyan-dark);
}

.catalog-product-stock-price {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: auto;
  border-top: 1px dashed var(--color-edit-border);
  padding-top: 6px;
}

body.dark-mode .catalog-product-stock-price {
  border-top-color: var(--color-dark-border);
}

.catalog-stock {
  font-size: 9.5px;
  font-weight: 500;
  color: var(--color-edit-text-muted);
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.catalog-stock span {
  display: flex;
  align-items: center;
  gap: 4px;
}

body.dark-mode .catalog-stock {
  color: var(--color-dark-text-muted);
}

.catalog-price {
  font-family: var(--font-titles);
  font-size: 13px;
  font-weight: 700;
  color: var(--color-petroleum-logo);
}

body.dark-mode .catalog-price {
  color: var(--color-accent-cyan);
}

.product-divider {
  height: 1px;
  background: linear-gradient(to right, transparent, var(--color-edit-border), transparent);
  margin: 6px 0;
}

body.dark-mode .product-divider {
  background: linear-gradient(to right, transparent, var(--color-dark-border), transparent);
}

.empty-product-slot {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  font-family: var(--font-titles);
  font-size: 14px;
  color: var(--color-edit-text-muted);
  border: 1px dashed var(--color-edit-border);
  border-radius: 8px;
  padding: 20px;
}

body.dark-mode .empty-product-slot {
  color: var(--color-dark-text-muted);
  border-color: var(--color-dark-border);
}

/* Category Jump Select styling for dark-mode */
body.dark-mode #category-jump-select {
  background-color: var(--color-dark-paper) !important;
  border-color: var(--color-dark-border) !important;
  color: var(--color-dark-text) !important;
}

#category-jump-select:hover {
  border-color: var(--color-accent-cyan-dark);
}

body.dark-mode #category-jump-select:hover {
  border-color: var(--color-accent-cyan);
}

/* subtle logo margin and visual polish on headers */
.page-header-logo {
  opacity: 0.85;
  transition: opacity 0.2s ease;
}
.page-header-logo:hover {
  opacity: 1;
}

/* Category Cover Pages */
.category-cover-page {
  background: var(--color-edit-paper);
  color: var(--color-edit-text);
  transition: all 0.5s ease;
}
body.dark-mode .category-cover-page {
  background: var(--color-dark-paper) !important;
  color: var(--color-dark-text) !important;
}
.category-cover-page h2 {
  color: var(--color-accent-cyan-dark);
}
body.dark-mode .category-cover-page h2 {
  color: var(--color-accent-cyan);
}
.category-cover-page .page-num, 
.category-cover-page .category-cover-sub, 
.category-cover-page .category-cover-footer {
  color: var(--color-edit-text-muted);
}
body.dark-mode .category-cover-page .page-num, 
body.dark-mode .category-cover-page .category-cover-sub, 
body.dark-mode .category-cover-page .category-cover-footer {
  color: var(--color-dark-text-muted) !important;
}
.category-cover-page .category-cover-border {
  border-bottom: 1px solid var(--color-edit-border);
}
body.dark-mode .category-cover-page .category-cover-border {
  border-bottom: 1px solid var(--color-dark-border) !important;
}
.category-cover-page .category-cover-divider {
  background: var(--color-accent-cyan);
}

/* ==========================================================================
   CART SYSTEM STYLES (Interactive Drawer, Badges, Print Layouts)
   ========================================================================== */

/* Branding Badges on Product Cards */
.branding-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top: 6px;
}
.branding-free {
  background: rgba(88, 189, 185, 0.12);
  color: var(--color-accent-cyan-dark);
  border: 1px solid rgba(88, 189, 185, 0.3);
}
body.dark-mode .branding-free {
  background: rgba(88, 189, 185, 0.08);
  color: var(--color-accent-cyan) !important;
}
.branding-tampo {
  background: rgba(217, 83, 79, 0.1);
  color: #c9302c;
  border: 1px solid rgba(217, 83, 79, 0.25);
}
body.dark-mode .branding-tampo {
  background: rgba(217, 83, 79, 0.05);
  color: #ff6b6b !important;
  border-color: rgba(217, 83, 79, 0.15);
}

/* Product Card Control Actions */
.catalog-product-actions {
  display: flex;
  gap: 10px;
  align-items: flex-end;
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px dashed var(--color-edit-border);
}
body.dark-mode .catalog-product-actions {
  border-top-color: var(--color-dark-border);
}
.action-field {
  display: flex;
  flex-direction: column;
  gap: 3px;
  flex: 1;
}
.action-field label {
  font-family: var(--font-titles);
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--color-edit-text-muted);
  letter-spacing: 0.5px;
}
body.dark-mode .action-field label {
  color: var(--color-dark-text-muted);
}
.prod-color-select,
.prod-qty-input {
  width: 100%;
  padding: 6px;
  border-radius: 6px;
  border: 1px solid var(--color-edit-border);
  background: var(--color-edit-paper);
  font-size: 11px;
  font-weight: 500;
  color: var(--color-edit-text);
  outline: none;
  transition: var(--transition-fast);
}
.prod-color-select {
  padding: 6px 28px 6px 8px;
}
body.dark-mode .prod-color-select,
body.dark-mode .prod-qty-input {
  border-color: var(--color-dark-border);
  background: var(--color-dark-paper);
  color: var(--color-dark-text);
}
.prod-color-select:focus,
.prod-qty-input:focus {
  border-color: var(--color-accent-cyan-dark);
}
body.dark-mode .prod-color-select:focus,
body.dark-mode .prod-qty-input:focus {
  border-color: var(--color-accent-cyan);
}
.prod-add-btn {
  height: 29px;
  padding: 0 14px;
  background: var(--color-accent-cyan-dark);
  color: #FFFFFF;
  border: none;
  border-radius: 6px;
  font-family: var(--font-titles);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: var(--transition-fast);
}
.prod-add-btn:hover {
  background: var(--color-petroleum-logo);
  transform: translateY(-1px);
}
.prod-add-btn:active {
  transform: translateY(0);
}
body.dark-mode .prod-add-btn {
  background: var(--color-accent-cyan-dark);
}
body.dark-mode .prod-add-btn:hover {
  background: var(--color-accent-cyan);
}

/* Floating Cart Button Trigger */
.floating-cart-btn {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: var(--color-accent-cyan-dark);
  color: white;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 20px;
  cursor: pointer;
  box-shadow: 0 8px 30px rgba(59, 140, 151, 0.4);
  z-index: 1000;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.floating-cart-btn:hover {
  transform: scale(1.08) translateY(-3px);
  background: var(--color-petroleum-logo);
  box-shadow: 0 12px 35px rgba(59, 140, 151, 0.5);
}
.floating-cart-btn:active {
  transform: scale(0.95) translateY(0);
}
.cart-badge {
  position: absolute;
  top: -2px;
  right: -2px;
  background: #d9534f;
  color: white;
  font-family: var(--font-titles);
  font-size: 11px;
  font-weight: 800;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  border: 2px solid white;
}
body.dark-mode .cart-badge {
  border-color: var(--color-dark-bg);
}

/* Cart Drawer Panel */
.cart-drawer {
  position: fixed;
  top: 0;
  right: -420px;
  width: 400px;
  height: 100vh;
  background: rgba(252, 250, 246, 0.95);
  box-shadow: -10px 0 40px rgba(0, 0, 0, 0.15);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  z-index: 1050;
  display: flex;
  flex-direction: column;
  transition: right 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
  border-left: 1px solid var(--color-edit-border);
}
body.dark-mode .cart-drawer {
  background: rgba(15, 27, 38, 0.96);
  border-left-color: var(--color-dark-border);
  box-shadow: -10px 0 45px rgba(0, 0, 0, 0.4);
}
.cart-drawer.open {
  right: 0;
}
.cart-drawer-header {
  padding: 20px 25px;
  border-bottom: 1px solid var(--color-edit-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
body.dark-mode .cart-drawer-header {
  border-bottom-color: var(--color-dark-border);
}
.cart-drawer-header h3 {
  font-family: var(--font-titles);
  font-size: 16px;
  font-weight: 700;
  color: var(--color-accent-cyan-dark);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}
body.dark-mode .cart-drawer-header h3 {
  color: var(--color-accent-cyan);
}
.close-cart-btn {
  background: none;
  border: none;
  font-size: 20px;
  color: var(--color-edit-text-muted);
  cursor: pointer;
  transition: var(--transition-fast);
  padding: 5px;
  display: flex;
  justify-content: center;
  align-items: center;
}
.close-cart-btn:hover {
  color: var(--color-edit-text);
  transform: rotate(90deg);
}
body.dark-mode .close-cart-btn:hover {
  color: var(--color-dark-text);
}

/* Cart Items List Content */
.cart-drawer-content {
  flex: 1;
  overflow-y: auto;
  padding: 15px 25px;
}
.cart-drawer-content::-webkit-scrollbar {
  width: 6px;
}
.cart-drawer-content::-webkit-scrollbar-track {
  background: transparent;
}
.cart-drawer-content::-webkit-scrollbar-thumb {
  background: var(--color-edit-border);
  border-radius: 3px;
}
body.dark-mode .cart-drawer-content::-webkit-scrollbar-thumb {
  background: var(--color-dark-border);
}
.empty-cart-msg {
  text-align: center;
  padding: 40px 10px;
  color: var(--color-edit-text-muted);
  font-size: 13px;
  line-height: 1.5;
}
body.dark-mode .empty-cart-msg {
  color: var(--color-dark-text-muted);
}

/* Cart Product Item Row inside Drawer */
.cart-item {
  display: flex;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--color-edit-border);
  align-items: center;
  position: relative;
}
body.dark-mode .cart-item {
  border-bottom-color: var(--color-dark-border);
}
.cart-item-img {
  width: 50px;
  height: 50px;
  border-radius: 6px;
  object-fit: cover;
  background: white;
  border: 1px solid var(--color-edit-border);
}
body.dark-mode .cart-item-img {
  border-color: var(--color-dark-border);
}
.cart-item-details {
  flex: 1;
}
.cart-item-name {
  font-family: var(--font-titles);
  font-size: 12px;
  font-weight: 600;
  color: var(--color-edit-text);
  margin: 0 0 2px 0;
  line-height: 1.3;
}
body.dark-mode .cart-item-name {
  color: var(--color-dark-text);
}
.cart-item-meta {
  font-size: 10px;
  color: var(--color-edit-text-muted);
  margin-bottom: 4px;
}
body.dark-mode .cart-item-meta {
  color: var(--color-dark-text-muted);
}
.cart-item-meta-price {
  font-size: 11px;
  font-weight: 700;
  color: var(--color-accent-cyan-dark);
}
body.dark-mode .cart-item-meta-price {
  color: var(--color-accent-cyan);
}
.remove-item-btn {
  background: none;
  border: none;
  color: #d9534f;
  cursor: pointer;
  padding: 6px;
  border-radius: 4px;
  transition: var(--transition-fast);
  display: flex;
  justify-content: center;
  align-items: center;
}
.remove-item-btn:hover {
  background: rgba(217, 83, 79, 0.1);
}

/* Shipping Destination Selection Panel */
.cart-shipping-select-box {
  padding: 12px 25px;
  border-top: 1px solid var(--color-edit-border);
  background: rgba(88, 189, 185, 0.05);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
body.dark-mode .cart-shipping-select-box {
  border-top-color: var(--color-dark-border);
  background: rgba(88, 189, 185, 0.02);
}
.cart-shipping-select-box label {
  font-family: var(--font-titles);
  font-size: 11px;
  font-weight: 700;
  color: var(--color-edit-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
  gap: 5px;
}
body.dark-mode .cart-shipping-select-box label {
  color: var(--color-dark-text-muted);
}
.cart-shipping-select-box select {
  padding: 5px 28px 5px 10px;
  border-radius: 15px;
  border: 1px solid var(--color-edit-border);
  background: var(--color-edit-paper);
  font-family: var(--font-titles);
  font-size: 11px;
  font-weight: 600;
  color: var(--color-edit-text);
  outline: none;
  cursor: pointer;
}
body.dark-mode .cart-shipping-select-box select {
  border-color: var(--color-dark-border);
  background: var(--color-dark-paper);
  color: var(--color-dark-text);
}

/* Progress Bars towards B2B thresholds */
.cart-progress-section {
  padding: 15px 25px;
  border-top: 1px solid var(--color-edit-border);
  display: flex;
  flex-direction: column;
  gap: 12px;
}
body.dark-mode .cart-progress-section {
  border-top-color: var(--color-dark-border);
}
.progress-bar-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.progress-bar-labels {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--color-edit-text-muted);
}
body.dark-mode .progress-bar-labels {
  color: var(--color-dark-text-muted);
}
.progress-track {
  width: 100%;
  height: 6px;
  background: var(--color-edit-border);
  border-radius: 3px;
  overflow: hidden;
}
body.dark-mode .progress-track {
  background: rgba(255, 255, 255, 0.08);
}
.progress-fill {
  height: 100%;
  background: #d9534f;
  border-radius: 3px;
  transition: width 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.progress-fill.complete {
  background: var(--color-accent-cyan-dark);
}
.progress-alert {
  font-size: 9.5px;
  font-weight: 500;
  color: #d9534f;
}
.progress-alert.complete {
  color: var(--color-accent-cyan-dark);
}
body.dark-mode .progress-alert.complete {
  color: var(--color-accent-cyan) !important;
}

/* Totals costs overview */
.cart-totals-box {
  padding: 15px 25px;
  background: rgba(28, 39, 49, 0.02);
  border-top: 1px solid var(--color-edit-border);
  display: flex;
  flex-direction: column;
  gap: 5px;
}
body.dark-mode .cart-totals-box {
  background: rgba(0, 0, 0, 0.1);
  border-top-color: var(--color-dark-border);
  color: var(--color-dark-text-muted);
}
.totals-row {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--color-edit-text-muted);
}
body.dark-mode .totals-row {
  color: var(--color-dark-text-muted);
}
.totals-row.total-grand {
  border-top: 1px solid var(--color-edit-border);
  margin-top: 4px;
  padding-top: 6px;
  font-family: var(--font-titles);
  font-size: 13px;
  font-weight: 700;
  color: var(--color-edit-text);
}
body.dark-mode .totals-row.total-grand {
  border-top-color: var(--color-dark-border);
  color: var(--color-dark-text);
}
.totals-row.total-grand span:last-child {
  color: var(--color-accent-cyan-dark);
  font-size: 15px;
}
body.dark-mode .totals-row.total-grand span:last-child {
  color: var(--color-accent-cyan);
}

/* Branding notices in Drawer footer */
.cart-branding-notice {
  padding: 10px 25px;
  font-size: 9px;
  color: var(--color-edit-text-muted);
  line-height: 1.35;
  background: rgba(28, 39, 49, 0.04);
  border-top: 1px solid var(--color-edit-border);
}
body.dark-mode .cart-branding-notice {
  background: rgba(0, 0, 0, 0.15);
  border-top-color: var(--color-dark-border);
  color: var(--color-dark-text-muted);
}
.cart-branding-notice p {
  margin: 0 0 5px 0;
}
.cart-branding-notice p:last-child {
  margin: 0;
}
.antiestres-warning {
  color: #c9302c;
}
body.dark-mode .antiestres-warning {
  color: #ff6b6b;
}

/* Drawer actions footer */
.cart-drawer-footer {
  padding: 15px 25px 20px 25px;
  border-top: 1px solid var(--color-edit-border);
  display: flex;
  gap: 8px;
}
body.dark-mode .cart-drawer-footer {
  border-top-color: var(--color-dark-border);
}
.cart-btn {
  flex: 1;
  padding: 10px;
  border-radius: 6px;
  font-family: var(--font-titles);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  cursor: pointer;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  transition: var(--transition-fast);
}
.clear-cart-btn {
  background: none;
  border: 1px solid var(--color-edit-border);
  color: var(--color-edit-text-muted);
}
.clear-cart-btn:hover {
  background: rgba(217, 83, 79, 0.08);
  border-color: #d9534f;
  color: #d9534f;
}
body.dark-mode .clear-cart-btn {
  border-color: var(--color-dark-border);
  color: var(--color-dark-text-muted);
}
body.dark-mode .clear-cart-btn:hover {
  background: rgba(217, 83, 79, 0.05);
}
.pdf-cart-btn {
  background: none;
  border: 1px solid var(--color-accent-cyan-dark);
  color: var(--color-accent-cyan-dark);
}
.pdf-cart-btn:hover {
  background: rgba(59, 140, 151, 0.08);
}
body.dark-mode .pdf-cart-btn {
  border-color: var(--color-accent-cyan);
  color: var(--color-accent-cyan);
}
body.dark-mode .pdf-cart-btn:hover {
  background: rgba(88, 189, 185, 0.05);
}
.whatsapp-cart-btn {
  background: #25d366;
  border: none;
  color: white;
  flex: 1.5;
}
.whatsapp-cart-btn:hover:not(:disabled) {
  background: #128c7e;
  transform: translateY(-1px);
}
.whatsapp-cart-btn:disabled {
  background: #cccccc;
  color: #888888;
  cursor: not-allowed;
  opacity: 0.6;
}
body.dark-mode .whatsapp-cart-btn:disabled {
  background: #444444;
  color: #777777;
}

/* ==========================================================================
   B2B PRINT & PDF INVOICE EXPORT SHEET
   ========================================================================== */
.print-only {
  display: none !important;
}

@media print {
  /* Hide all digital screen containers */
  .app-container, .floating-cart-btn, .cart-drawer, .toast-notification, .book-navigation {
    display: none !important;
  }
  
  /* Reset document for clean white page layout */
  body {
    background-color: white !important;
    color: #1c2731 !important;
    font-size: 11px !important;
    line-height: 1.4 !important;
    padding: 0 !important;
    margin: 0 !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }
  
  /* Show printable B2B invoice wrapper */
  .print-only {
    display: block !important;
    width: 100% !important;
    max-width: 800px !important;
    margin: 0 auto !important;
    padding: 30px !important;
    font-family: 'Inter', sans-serif !important;
    box-sizing: border-box !important;
  }
  
  /* Header member structure */
  .print-header {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    border-bottom: 3px solid #2a6177 !important;
    padding-bottom: 20px !important;
    margin-bottom: 30px !important;
  }
  .print-logo-box img {
    height: 50px !important;
    filter: brightness(0) saturate(100%) invert(32%) sepia(33%) saturate(996%) index(200deg) !important;
  }
  
  /* B2B Products Table layout */
  .print-table {
    width: 100% !important;
    border-collapse: collapse !important;
    margin-top: 20px !important;
  }
  .print-table th {
    background-color: #f5efeb !important;
    color: #1c2731 !important;
    font-family: 'Outfit', sans-serif !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    font-size: 9.5px !important;
    letter-spacing: 0.5px !important;
    padding: 8px 6px !important;
    border-bottom: 2px solid #2a6177 !important;
  }
  .print-table td {
    padding: 8px 6px !important;
    border-bottom: 1px solid #e8e0d7 !important;
    vertical-align: middle !important;
  }
  .print-table tr:nth-child(even) td {
    background-color: #fcfaf6 !important;
  }
  
  /* Print totals box alignment */
  .print-summary-section {
    display: flex !important;
    justify-content: space-between !important;
    gap: 40px !important;
    margin-top: 40px !important;
    page-break-inside: avoid !important;
  }
  .print-notes {
    flex: 1 !important;
    font-size: 9px !important;
    color: #627281 !important;
    line-height: 1.5 !important;
  }
  .print-totals {
    width: 230px !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 4px !important;
  }
  .print-total-row {
    display: flex !important;
    justify-content: space-between !important;
    padding-bottom: 4px !important;
    border-bottom: 1px solid #e8e0d7 !important;
  }
  .print-total-grand {
    font-family: 'Outfit', sans-serif !important;
    font-size: 13px !important;
    color: #2a6177 !important;
    border-bottom: none !important;
    padding-top: 5px !important;
  }
  
  .print-footer {
    text-align: center !important;
    font-size: 9px !important;
    color: #627281 !important;
    border-top: 1px solid #e8e0d7 !important;
    padding-top: 15px !important;
    margin-top: 60px !important;
    page-break-inside: avoid !important;
  }
}

/* ==========================================================================
   NUEVAS DEPOSITAS DE BÚSQUEDA Y CANTIDAD EDITABLE EN EL CARRITO
   ========================================================================== */

.brand-bar-search-toggle {
  background: var(--color-accent-cyan-dark);
  border: none;
  color: #FFFFFF;
  font-family: var(--font-titles);
  font-size: 13px;
  font-weight: 700;
  padding: 6px 16px;
  border-radius: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: var(--transition-fast);
  outline: none;
}
.brand-bar-search-toggle:hover {
  background: var(--color-accent-cyan);
  transform: translateY(-1px);
}
body.dark-mode .brand-bar-search-toggle {
  background: var(--color-dark-border);
}
body.dark-mode .brand-bar-search-toggle:hover {
  background: var(--color-accent-cyan);
}

.search-header-panel {
  position: absolute;
  top: -100px;
  left: 0;
  width: 100%;
  background: var(--color-edit-paper);
  border-bottom: 2px solid var(--color-accent-cyan);
  box-shadow: 0 10px 30px rgba(0,0,0,0.15);
  z-index: 1000;
  transition: transform 0.3s cubic-bezier(0.1, 0.9, 0.2, 1), opacity 0.3s ease;
  transform: translateY(-100%);
  opacity: 0;
  pointer-events: none;
  display: flex;
  flex-direction: column;
}
.search-header-panel.open {
  transform: translateY(0);
  top: 80px;
  opacity: 1;
  pointer-events: auto;
}
@media (max-width: 768px) {
  .search-header-panel.open {
    top: 70px;
  }
}
body.dark-mode .search-header-panel {
  background: var(--color-dark-paper);
  border-bottom-color: var(--color-accent-cyan);
}
.search-panel-inner {
  display: flex;
  align-items: center;
  padding: 15px 40px;
  gap: 15px;
  border-bottom: 1px solid var(--color-edit-border);
}
body.dark-mode .search-panel-inner {
  border-bottom-color: var(--color-dark-border);
}
.search-panel-icon {
  font-size: 18px;
  color: var(--color-edit-text-muted);
}
#panel-search-input {
  flex: 1;
  border: none;
  background: transparent;
  font-family: var(--font-titles);
  font-size: 16px;
  font-weight: 600;
  color: var(--color-edit-text);
  outline: none;
}
body.dark-mode #panel-search-input {
  color: #FFF;
}
.close-search-panel-btn {
  background: transparent;
  border: none;
  color: var(--color-edit-text-muted);
  font-size: 18px;
  cursor: pointer;
  padding: 5px;
  transition: color 0.2s;
}
.close-search-panel-btn:hover {
  color: #c9302c;
}
.search-panel-results {
  max-height: 350px;
  overflow-y: auto;
  padding: 10px 40px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.search-result-item {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 8px 12px;
  border-radius: 8px;
  background: rgba(88, 189, 185, 0.04);
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
}
.search-result-item:hover {
  background: rgba(88, 189, 185, 0.12);
  transform: translateX(4px);
}
body.dark-mode .search-result-item {
  background: rgba(255,255,255,0.02);
}
body.dark-mode .search-result-item:hover {
  background: rgba(88, 189, 185, 0.15);
}
.search-result-img {
  width: 45px;
  height: 45px;
  border-radius: 4px;
  background: #FFF;
  object-fit: contain;
  border: 1px solid var(--color-edit-border);
}
.search-result-info {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
}
.search-result-name {
  font-family: var(--font-titles);
  font-size: 13px;
  font-weight: 700;
  color: var(--color-edit-text);
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
body.dark-mode .search-result-name {
  color: #FFF;
}
.search-result-meta {
  font-size: 11px;
  color: var(--color-edit-text-muted);
}
.search-result-price {
  font-family: var(--font-titles);
  font-size: 12px;
  font-weight: 700;
  color: var(--color-accent-cyan-dark);
}
.search-no-results {
  padding: 20px;
  text-align: center;
  font-family: var(--font-titles);
  font-size: 14px;
  color: var(--color-edit-text-muted);
}

/* Animación para el Producto Buscado */
@keyframes flashProduct {
  0% { background-color: transparent; }
  25% { background-color: rgba(88, 189, 185, 0.4); transform: scale(1.02); }
  50% { background-color: transparent; }
  75% { background-color: rgba(88, 189, 185, 0.4); transform: scale(1.02); }
  100% { background-color: transparent; }
}
.highlight-product {
  animation: flashProduct 2s ease-in-out;
  border-radius: 8px;
  position: relative;
  z-index: 10;
}

/* Controles de Cantidad en Carrito */
.cart-item-qty-selector {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
  font-size: 11px;
}
.cart-qty-controls {
  display: flex;
  align-items: center;
  border: 1px solid var(--color-edit-border);
  border-radius: 12px;
  background: var(--color-edit-paper);
  overflow: hidden;
}
body.dark-mode .cart-qty-controls {
  border-color: var(--color-dark-border);
  background: var(--color-dark-bg);
}
.cart-qty-controls button {
  background: transparent;
  border: none;
  width: 22px;
  height: 22px;
  font-size: 13px;
  font-weight: 700;
  color: var(--color-edit-text);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
  outline: none;
}
.cart-qty-controls button:hover {
  background: rgba(88, 189, 185, 0.15);
}
.cart-qty-controls input {
  width: 32px;
  height: 22px;
  border: none;
  border-left: 1px solid var(--color-edit-border);
  border-right: 1px solid var(--color-edit-border);
  background: transparent;
  text-align: center;
  font-family: var(--font-titles);
  font-size: 11px;
  font-weight: 700;
  color: var(--color-edit-text);
  outline: none;
  -moz-appearance: textfield;
}
body.dark-mode .cart-qty-controls input {
  border-left-color: var(--color-dark-border);
  border-right-color: var(--color-dark-border);
  color: #FFF;
}
.cart-qty-controls input::-webkit-outer-spin-button,
.cart-qty-controls input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

