/* ==========================================================================
   Cook Nan - Döküm Serisi Katalog Editörü Stilleri
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;500;600;700;800;900&display=swap');

:root {
  --brand-orange: #f26921;
  --brand-orange-hover: #d95612;
  --dark-header: #14110f;
  --bg-cream: #f6f2ea;
  --taupe-cat: #8d8478;
  --footer-gray: #6f665c;
  --border-light: #eae4da;
  --ui-dark: #1e1e24;
  --ui-card: #282830;
  --ui-text: #f4efe8;
  --ui-accent: #f26921;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-print-color-adjust: exact !important;
  print-color-adjust: exact !important;
}

body {
  background-color: #e5dfd5;
  font-family: 'Montserrat', sans-serif;
  color: #14110f;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* ==========================================================================
   TOP APPLICATION TOOLBAR (HIDDEN IN PRINT)
   ========================================================================== */
.app-toolbar {
  position: sticky;
  top: 0;
  z-index: 9999;
  width: 100%;
  background: rgba(20, 17, 15, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 2px solid var(--brand-orange);
  padding: 12px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 8px 32px rgba(0,0,0,0.35);
}

.toolbar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.toolbar-logo {
  height: 34px;
  width: auto;
  border-radius: 6px;
}

.toolbar-title {
  color: #ffffff;
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.toolbar-title span {
  color: var(--brand-orange);
}

.toolbar-center {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255,255,255,0.08);
  padding: 4px;
  border-radius: 10px;
}

.page-tab-btn {
  background: transparent;
  border: none;
  color: #ccc;
  font-family: 'Montserrat', sans-serif;
  font-size: 13px;
  font-weight: 600;
  padding: 8px 16px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.page-tab-btn:hover {
  color: #fff;
  background: rgba(255,255,255,0.1);
}

.page-tab-btn.active {
  background: var(--brand-orange);
  color: #fff;
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(242, 105, 33, 0.4);
}

.toolbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: 'Montserrat', sans-serif;
  font-size: 13px;
  font-weight: 700;
  padding: 10px 18px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
}

.btn-primary {
  background: var(--brand-orange);
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(242, 105, 33, 0.4);
}

.btn-primary:hover {
  background: var(--brand-orange-hover);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(242, 105, 33, 0.5);
}

.btn-outline {
  background: transparent;
  color: #ffffff;
  border: 1.5px solid rgba(255,255,255,0.25);
}

.btn-outline:hover {
  background: rgba(255,255,255,0.1);
  border-color: #ffffff;
}

.btn-secondary {
  background: rgba(255,255,255,0.12);
  color: #ffffff;
}

.btn-secondary:hover {
  background: rgba(255,255,255,0.2);
}

.mode-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  padding: 6px 12px;
  border-radius: 8px;
  background: rgba(255,255,255,0.06);
}

.mode-toggle input {
  cursor: pointer;
  accent-color: var(--brand-orange);
  width: 16px;
  height: 16px;
}

/* Status save indicator */
.save-badge {
  font-size: 12px;
  font-weight: 600;
  color: #4ade80;
  display: flex;
  align-items: center;
  gap: 6px;
  margin-right: 6px;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.save-badge.visible {
  opacity: 1;
}

/* ==========================================================================
   ZOOM & VIEWPORT CONTROLS
   ========================================================================== */
.view-info-banner {
  width: 100%;
  max-width: 1240px;
  background: #ffffff;
  border-radius: 12px;
  margin: 20px auto 10px;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 4px 16px rgba(0,0,0,0.06);
  font-size: 13.5px;
  color: #555;
}

.banner-hints {
  display: flex;
  align-items: center;
  gap: 16px;
}

.hint-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #f6f2ea;
  padding: 4px 10px;
  border-radius: 6px;
  font-weight: 600;
  color: #14110f;
}

.zoom-controls {
  display: flex;
  align-items: center;
  gap: 10px;
}

.zoom-btn {
  background: #f6f2ea;
  border: 1px solid #ddd;
  border-radius: 6px;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  cursor: pointer;
}

.zoom-btn:hover {
  background: #e8e2d5;
}

/* ==========================================================================
   CATALOG CONTAINER & A4 PAGES
   ========================================================================== */
.catalog-viewport {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 48px;
  padding: 20px 0 80px;
}

/* Exact A4 Ratio: 1240px x 1754px (150 DPI) */
.catalog-page {
  position: relative;
  width: 1240px;
  height: 1754px;
  background-color: var(--bg-cream);
  color: var(--dark-header);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.18);
  border-radius: 2px;
  overflow: hidden;
  flex-shrink: 0;
  transition: transform 0.2s ease;
}

/* Hide page if not selected in single view */
.catalog-page.hidden-page {
  display: none !important;
}

/* Page 3 Back cover background */
.catalog-page.back-cover-page {
  background-color: #f17022;
  color: #ffffff;
}

/* ==========================================================================
   PAGE 1 & PAGE 2 LAYOUT
   ========================================================================== */
/* HEADER */
.header {
  position: absolute;
  top: 0;
  left: 0;
  width: 1240px;
  height: 209px;
  background-color: var(--dark-header);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 81px;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 28px;
}

.logo-wrap {
  position: relative;
  height: 94px;
  display: flex;
  align-items: center;
}

.logo {
  height: 94px;
  width: auto;
  border-radius: 12px;
  display: block;
}

.header-titles {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.header-subtitle {
  font-size: 18.5px;
  font-weight: 700;
  color: var(--brand-orange);
  letter-spacing: 0.28em;
  text-transform: uppercase;
  margin-bottom: 4px;
}

.header-title {
  font-size: 54px;
  font-weight: 900;
  color: #f4efe8;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  line-height: 1.05;
}

.header-right {
  text-align: right;
  color: #f4efe8;
  font-size: 30.5px;
  font-weight: 500;
  line-height: 1.18;
  letter-spacing: 0.01em;
}

/* ROW BLOCKS */
.row-block {
  position: absolute;
  left: 81px;
  width: 1078px;
}

/* Page 1 (5 rows, tighter spacing) */
.page-1 .row-1 { top: 236px; }
.page-1 .row-2 { top: 512px; }
.page-1 .row-3 { top: 788px; }
.page-1 .row-4 { top: 1064px; }
.page-1 .row-5 { top: 1340px; }

/* Page 2 (3 rows, generous spacing) */
.page-2 .row-1 { top: 258px; }
.page-2 .row-2 { top: 722px; }
.page-2 .row-3 { top: 1186px; }

/* DIVIDERS */
.divider-container {
  width: 1078px;
  display: flex;
  justify-content: space-between;
  margin-bottom: 24px;
}

.page-2 .divider-container {
  margin-bottom: 38px;
}

.divider-col {
  width: 514px;
  height: 1.5px;
  background-color: var(--dark-header);
}

/* ROW ITEMS */
.items-container {
  width: 1078px;
  display: flex;
  justify-content: space-between;
}

.item-card {
  width: 514px;
  display: flex;
  align-items: center;
  gap: 24px;
  position: relative;
}

/* In Page 1, image is slightly more compact (160px) to fit 5 rows */
.page-1 .item-img-wrap {
  width: 168px;
  height: 168px;
}

/* In Page 2, standard image is 205px */
.page-2 .item-img-wrap {
  width: 205px;
  height: 205px;
}

.item-img-wrap {
  position: relative;
  flex-shrink: 0;
  border-radius: 12px;
  overflow: hidden;
  background-color: var(--border-light);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(0,0,0,0.07);
}

.item-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* DUO IMAGE CONTAINER FOR ITEM 12 (BALIK TAVASI) */
.item-img-wrap-duo {
  position: relative;
  width: 236px;
  height: 172px;
  flex-shrink: 0;
  border-radius: 12px;
  overflow: hidden;
  background-color: var(--border-light);
  display: flex;
  gap: 3px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.07);
}

.duo-half {
  position: relative;
  width: 50%;
  height: 100%;
}

.duo-half img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* ITEM INFO */
.item-info {
  display: flex;
  flex-direction: column;
  justify-content: center;
  flex: 1;
  min-width: 0;
}

.item-category-line {
  display: flex;
  align-items: baseline;
  margin-bottom: 8px;
  white-space: nowrap;
  overflow: visible;
}

.page-2 .item-category-line {
  margin-bottom: 12px;
}

.item-num {
  font-size: 17.5px;
  font-weight: 700;
  color: var(--brand-orange);
  letter-spacing: 0.12em;
  margin-right: 14px !important;
  flex-shrink: 0;
}

.item-cat {
  font-size: 14.5px;
  font-weight: 600;
  color: var(--taupe-cat);
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.item-title {
  font-weight: 800;
  color: var(--dark-header);
  text-transform: uppercase;
  letter-spacing: 0.01em;
}

.page-1 .item-title {
  font-size: 18px;
  line-height: 1.22;
  margin-bottom: 10px;
}

.page-2 .item-title {
  font-size: 26px;
  line-height: 1.25;
  margin-bottom: 22px;
}

.item-price-wrap {
  display: flex;
  align-items: baseline;
  gap: 12px;
}

.psf-label {
  font-size: 16px;
  font-weight: 700;
  color: var(--taupe-cat);
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.price-val {
  font-size: 38px;
  font-weight: 800;
  color: var(--dark-header);
  letter-spacing: -0.01em;
}

.page-2 .price-val {
  font-size: 42px;
}

/* ACCENT ORANGE FOR FEATURED SETS (Item 10 and Item 11) */
.accent-orange .item-cat {
  color: var(--brand-orange) !important;
}

.accent-orange .price-val {
  color: var(--brand-orange) !important;
}

/* FOOTER */
.footer-line {
  position: absolute;
  top: 1652px;
  left: 0;
  width: 1240px;
  height: 2px;
  background-color: var(--dark-header);
}

.footer-text {
  position: absolute;
  top: 1686px;
  left: 81px;
  width: 1078px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 17.5px;
  font-weight: 500;
  color: var(--footer-gray);
}

/* ==========================================================================
   PAGE 3 (ARKA KAPAK / BACK COVER)
   ========================================================================== */
.back-cover-page .logo-container {
  position: absolute;
  top: 342px;
  left: 0;
  width: 1240px;
  display: flex;
  justify-content: center;
}

.back-cover-page .logo-wrap {
  position: relative;
  width: 470px;
  height: auto;
}

.back-cover-page .logo-img {
  width: 470px;
  height: auto;
  display: block;
}

.back-cover-page .company-title {
  position: absolute;
  top: 1492px;
  left: 0;
  width: 1240px;
  text-align: center;
  font-size: 24px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: #ffffff;
}

.back-cover-page .contact-bar {
  position: absolute;
  top: 1566px;
  left: 178px;
  width: 884px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.back-cover-page .address-col {
  display: flex;
  align-items: flex-start;
  gap: 16px;
}

.back-cover-page .pin-icon {
  width: 28px;
  height: 38px;
  flex-shrink: 0;
  margin-top: 2px;
}

.back-cover-page .address-text {
  font-size: 15.5px;
  font-weight: 500;
  line-height: 1.48;
  color: #ffffff;
  letter-spacing: 0.01em;
}

.back-cover-page .phone-col {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 12px;
}

.back-cover-page .phone-icon {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
}

.back-cover-page .phone-text {
  font-size: 18px;
  font-weight: 600;
  color: #ffffff;
  white-space: nowrap;
  letter-spacing: 0.02em;
}

/* ==========================================================================
   INTERACTIVE EDITING HIGHLIGHTS & OVERLAYS
   ========================================================================== */
/* Editable text indicator */
body.edit-mode [contenteditable="true"] {
  outline: 1.5px dashed transparent;
  transition: all 0.2s ease;
  cursor: text;
  border-radius: 4px;
  padding: 1px 3px;
  margin: -1px -3px;
}

body.edit-mode [contenteditable="true"]:hover {
  outline: 1.5px dashed rgba(242, 105, 33, 0.6);
  background: rgba(242, 105, 33, 0.06);
}

body.edit-mode [contenteditable="true"]:focus {
  outline: 2px solid var(--brand-orange);
  background: rgba(242, 105, 33, 0.12);
}

/* Image upload overlay */
.img-upload-overlay {
  position: absolute;
  inset: 0;
  background: rgba(20, 17, 15, 0.7);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  color: #ffffff;
  font-size: 12px;
  font-weight: 700;
  opacity: 0;
  transition: opacity 0.25s ease;
  cursor: pointer;
  backdrop-filter: blur(2px);
  z-index: 10;
  text-align: center;
  padding: 8px;
}

body.edit-mode .item-img-wrap:hover .img-upload-overlay,
body.edit-mode .duo-half:hover .img-upload-overlay,
body.edit-mode .logo-wrap:hover .img-upload-overlay {
  opacity: 1;
}

.img-upload-overlay svg {
  width: 24px;
  height: 24px;
  fill: #ffffff;
}

/* Drag & Drop over style */
.drag-over {
  outline: 3px solid var(--brand-orange) !important;
  transform: scale(1.02);
}

/* Hidden file inputs */
.hidden-file-input {
  display: none !important;
}

/* Toast notification */
.toast-notice {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: #14110f;
  color: #ffffff;
  border-left: 4px solid var(--brand-orange);
  padding: 14px 22px;
  border-radius: 8px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.3);
  font-size: 14px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 12px;
  z-index: 10000;
  transform: translateY(100px);
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

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

/* Modal overlay */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(4px);
  z-index: 10001;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-card {
  background: #ffffff;
  width: 440px;
  border-radius: 14px;
  padding: 28px;
  box-shadow: 0 20px 50px rgba(0,0,0,0.25);
  text-align: center;
}

.modal-title {
  font-size: 20px;
  font-weight: 800;
  margin-bottom: 12px;
  color: #14110f;
}

.modal-text {
  font-size: 14.5px;
  color: #666;
  line-height: 1.5;
  margin-bottom: 24px;
}

.modal-btns {
  display: flex;
  gap: 12px;
  justify-content: center;
}

/* ==========================================================================
   PRINT / PDF EXPORT RULES (EXACT A4 PERFECTION)
   ========================================================================== */
@media print {
  @page {
    size: 1240px 1754px;
    margin: 0;
  }

  *, *::before, *::after {
    box-shadow: none !important;
    text-shadow: none !important;
  }

  html, body {
    background: transparent !important;
    margin: 0 !important;
    padding: 0 !important;
    width: 1240px !important;
    min-height: auto !important;
  }

  .app-toolbar,
  .view-info-banner,
  .toast-notice,
  .modal-overlay,
  .img-upload-overlay,
  .no-print {
    display: none !important;
  }

  .catalog-viewport {
    padding: 0 !important;
    margin: 0 !important;
    gap: 0 !important;
    width: 1240px !important;
    display: block !important;
    transform: none !important;
  }

  .catalog-page {
    position: relative !important;
    width: 1240px !important;
    height: 1754px !important;
    margin: 0 !important;
    padding: 0 !important;
    box-shadow: none !important;
    border-radius: 0 !important;
    page-break-after: always !important;
    break-after: page !important;
    display: block !important;
    transform: none !important;
  }

  .catalog-page:last-child {
    page-break-after: avoid !important;
    break-after: avoid !important;
  }
}
