/* ========================================
   RESET
======================================== */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  background: #edf3f8;
}

body {
  width: 100%;
  min-height: 100vh;
  overflow-x: hidden;

  font-family:
    -apple-system,
    BlinkMacSystemFont,
    "Hiragino Kaku Gothic ProN",
    "Yu Gothic",
    Meiryo,
    Arial,
    sans-serif;

  background:
    linear-gradient(
      180deg,
      #eef5fb 0%,
      #f6f9fc 100%
    );

  color: #173454;
  line-height: 1.7;
}

button,
input,
textarea {
  font-family: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

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


/* ========================================
   ADMIN APP
======================================== */

.admin-app {
  width: 100%;
  min-height: 100vh;
}


/* ========================================
   ADMIN TOOLBAR
======================================== */

.admin-toolbar {
  position: sticky;
  top: 0;
  z-index: 1000;

  width: 100%;

  padding:
    11px 14px;

  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;

  background:
    linear-gradient(
      90deg,
      #0b2a54,
      #123f75
    );

  color: #ffffff;

  box-shadow:
    0 5px 20px
    rgba(13, 45, 90, 0.18);
}

.admin-brand {
  min-width: 0;

  display: flex;
  flex-direction: column;
}

.admin-brand strong {
  color: #ffffff;

  font-size: 17px;
  font-weight: 900;
  line-height: 1.2;
}

.admin-brand span {
  margin-top: 2px;

  color: #bfd7ee;

  font-size: 10px;
  font-weight: 700;
}

.admin-toolbar-actions {
  flex-shrink: 0;

  display: flex;
  align-items: center;
  gap: 7px;
}


/* ========================================
   SAVE STATUS
======================================== */

.save-status {
  padding: 5px 8px;

  border-radius: 30px;

  font-size: 10px;
  font-weight: 900;
  white-space: nowrap;
}

.save-status.saved {
  background: #e7f8ef;
  color: #157957;
}

.save-status.unsaved {
  background: #fff1cf;
  color: #9b6800;
}


/* ========================================
   MODE BUTTON
======================================== */

.mode-button {
  padding: 8px 11px;

  border:
    1px solid
    rgba(255, 255, 255, 0.42);

  border-radius: 24px;

  background:
    rgba(255, 255, 255, 0.1);

  color: #ffffff;

  font-size: 11px;
  font-weight: 900;

  transition:
    background 0.2s ease,
    transform 0.15s ease;
}

.mode-button:active {
  transform: scale(0.97);
}

.mode-button:hover {
  background:
    rgba(255, 255, 255, 0.18);
}


/* ========================================
   EDIT GUIDE
======================================== */

.edit-guide {
  width: 100%;

  padding:
    8px 14px;

  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px 8px;

  background: #fff9e7;

  border-bottom:
    1px solid #f1dfaa;

  color: #745f22;

  font-size: 11px;
}

.edit-guide strong {
  font-weight: 900;
}


/* ========================================
   SITE CANVAS
======================================== */

.site-canvas {
  width:
    calc(100% - 18px);

  max-width: 1100px;

  margin:
    12px auto 110px;

  overflow: hidden;

  background: #ffffff;

  border:
    1px solid #e1eaf2;

  border-radius: 18px;

  box-shadow:
    0 12px 38px
    rgba(28, 67, 107, 0.11);
}


/* ========================================
   WEBSITE HEADER
======================================== */

.site-header {
  width: 100%;
  min-height: 66px;

  padding:
    15px 18px;

  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;

  background:
    rgba(255, 255, 255, 0.98);

  border-bottom:
    1px solid #e8eef4;
}

.site-brand-display {
  min-width: 0;

  color: #102f57;

  font-size: 17px;
  font-weight: 900;

  line-height: 1.3;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 15px;

  color: #61758a;

  font-size: 10px;
  font-weight: 800;
  white-space: nowrap;
}


/* ========================================
   HERO
======================================== */

.hero-section {
  width: 100%;
}

.hero-image-area {
  position: relative;

  width: 100%;
}

.hero-image-preview {
  width: 100%;
  aspect-ratio: 16 / 8;

  display: flex;
  align-items: center;
  justify-content: center;

  overflow: hidden;

  background:
    linear-gradient(
      135deg,
      #eaf3fb,
      #d7e8f7
    );
}

.hero-image-preview img {
  width: 100%;
  height: 100%;

  object-fit: cover;
}

.image-placeholder {
  padding: 25px;

  color: #7d91a6;

  text-align: center;
}

.image-placeholder span {
  display: block;

  margin-bottom: 5px;

  font-size: 34px;
}

.image-placeholder p {
  color: #75899e;

  font-size: 12px;
  font-weight: 800;
}

.image-placeholder.small span {
  font-size: 27px;
}


/* ========================================
   HERO PHOTO BUTTON
======================================== */

.floating-edit-button {
  position: absolute;
  right: 12px;
  bottom: 12px;

  padding:
    8px 12px;

  border:
    1px solid
    rgba(255, 255, 255, 0.25);

  border-radius: 24px;

  background:
    rgba(10, 42, 82, 0.91);

  color: #ffffff;

  font-size: 11px;
  font-weight: 900;

  box-shadow:
    0 4px 13px
    rgba(0, 0, 0, 0.18);

  cursor: pointer;
}


/* ========================================
   HERO CONTENT
======================================== */

.hero-content {
  padding:
    31px 19px 38px;

  background:
    linear-gradient(
      180deg,
      #ffffff,
      #fbfdff
    );

  text-align: center;
}


/* ========================================
   EDIT LABEL
======================================== */

.field-label {
  max-width: 680px;

  margin:
    10px auto 5px;

  color: #6e879e;

  font-size: 10px;
  font-weight: 900;

  text-align: left;
}


/* ========================================
   VISUAL EDIT INPUT
======================================== */

.visual-input,
.visual-textarea {
  display: block;

  width: 100%;

  border:
    1px dashed #95c4e9;

  border-radius: 10px;

  background: #f8fcff;

  color: #173454;

  outline: none;

  transition:
    border-color 0.2s ease,
    background 0.2s ease,
    box-shadow 0.2s ease;
}

.visual-input {
  padding:
    10px 11px;
}

.visual-textarea {
  padding:
    11px;

  resize: vertical;
}

.visual-input:focus,
.visual-textarea:focus {
  border-color: #1689e4;

  background: #ffffff;

  box-shadow:
    0 0 0 3px
    rgba(22, 137, 228, 0.1);
}


/* ========================================
   HERO TITLE
======================================== */

.hero-title-input {
  max-width: 760px;

  margin: 0 auto;

  border-color: #9cc8e9;

  color: #102f57;

  font-size: 27px;
  font-weight: 900;
  line-height: 1.35;

  text-align: center;
}


/* ========================================
   HERO TEXT
======================================== */

.hero-text-input {
  max-width: 680px;
  min-height: 88px;

  margin: 0 auto;

  color: #526a81;

  font-size: 14px;

  text-align: center;
}


/* ========================================
   CHARACTER COUNT
======================================== */

.edit-counter {
  max-width: 680px;

  margin:
    4px auto 0;

  color: #8b9cac;

  font-size: 9px;

  text-align: right;
}


/* ========================================
   CONTENT / PRODUCTS SECTION
======================================== */

.content-section {
  padding:
    38px 19px 42px;

  background: #ffffff;

  border-top:
    1px solid #edf2f6;
}

.section-heading-row {
  width: 100%;

  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;

  margin-bottom: 5px;
}

.section-heading-row > div:first-child {
  flex: 1;
}


/* ========================================
   SECTION TITLE
======================================== */

.section-title-input {
  max-width: 500px;

  padding:
    7px 9px;

  color: #12365f;

  font-size: 22px;
  font-weight: 900;
}


/* ========================================
   ITEM LIMIT
======================================== */

.content-limit {
  flex-shrink: 0;

  padding:
    7px 10px;

  border:
    1px solid #ded3f3;

  border-radius: 22px;

  background: #f7f3ff;
  color: #7353ae;

  text-align: center;
}

.content-limit span {
  margin-right: 3px;

  font-size: 9px;
  font-weight: 700;
}

.content-limit strong {
  font-size: 13px;
  font-weight: 900;
}

.section-description {
  margin:
    8px 0 20px;

  color: #8193a5;

  font-size: 11px;
}


/* ========================================
   PRODUCT GRID
======================================== */

.product-grid {
  width: 100%;

  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
}


/* ========================================
   PRODUCT CARD
======================================== */

.product-card {
  width: 100%;

  overflow: hidden;

  background: #ffffff;

  border:
    1px solid #dce6ef;

  border-radius: 17px;

  box-shadow:
    0 6px 22px
    rgba(27, 66, 105, 0.07);

  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease,
    opacity 0.2s ease;
}

.product-card.is-private {
  opacity: 0.55;
}

.product-image-area {
  position: relative;

  width: 100%;
}

.product-image-preview {
  width: 100%;
  aspect-ratio: 1 / 1;

  display: flex;
  align-items: center;
  justify-content: center;

  overflow: hidden;

  background:
    linear-gradient(
      135deg,
      #edf4fa,
      #e2edf6
    );
}

.product-image-preview img {
  width: 100%;
  height: 100%;

  object-fit: cover;
}


/* ========================================
   PRODUCT PHOTO BUTTON
======================================== */

.product-photo-button {
  position: absolute;
  right: 10px;
  bottom: 10px;

  padding:
    7px 10px;

  border-radius: 22px;

  background:
    rgba(13, 45, 90, 0.9);

  color: #ffffff;

  font-size: 10px;
  font-weight: 900;

  box-shadow:
    0 3px 10px
    rgba(0, 0, 0, 0.17);

  cursor: pointer;
}


/* ========================================
   VISIBILITY BADGE
======================================== */

.visibility-badge {
  position: absolute;
  left: 10px;
  top: 10px;

  padding:
    5px 9px;

  border-radius: 20px;

  background: #e7f8ef;
  color: #1b7958;

  font-size: 9px;
  font-weight: 900;
}


/* ========================================
   PRODUCT CONTENT
======================================== */

.product-content {
  padding: 16px;
}

.product-content .field-label {
  margin-left: 0;
  margin-right: 0;
}

.product-title {
  color: #173454;

  font-size: 18px;
  font-weight: 900;
}

.product-price {
  color: #0878d1;

  font-size: 17px;
  font-weight: 900;
}

.product-description {
  min-height: 100px;

  color: #51697f;

  font-size: 13px;
}


/* ========================================
   PRODUCT ADMIN CONTROLS
======================================== */

.product-admin-controls {
  margin-top: 15px;

  display: grid;
  grid-template-columns:
    1fr 1fr;

  gap: 7px;
}

.product-admin-controls button {
  min-height: 40px;

  padding:
    8px 6px;

  border-radius: 9px;

  font-size: 10px;
  font-weight: 900;

  transition:
    transform 0.15s ease,
    background 0.2s ease;
}

.product-admin-controls button:active {
  transform: scale(0.97);
}

.order-button {
  border:
    1px solid #cedbe7;

  background: #ffffff;
  color: #496078;
}

.visibility-button {
  border:
    1px solid #d5c9ee;

  background: #f8f5ff;
  color: #694da8;
}

.delete-button {
  border:
    1px solid #efd0d0;

  background: #fff8f8;
  color: #bc5151;
}


/* ========================================
   ADD CONTENT BUTTON
======================================== */

.add-content-button {
  display: block;

  width: 100%;

  margin-top: 22px;

  padding:
    14px 15px;

  border:
    2px dashed #1689e4;

  border-radius: 13px;

  background: #f7fbff;
  color: #0874d1;

  font-size: 13px;
  font-weight: 900;

  transition:
    background 0.2s ease,
    transform 0.15s ease;
}

.add-content-button:active {
  transform: scale(0.98);
}

.add-content-button:disabled {
  border-color: #c8d0d8;

  background: #f2f4f6;
  color: #98a3ad;
}

.limit-message {
  margin-top: 7px;

  color: #8191a1;

  font-size: 10px;

  text-align: center;
}


/* ========================================
   SHOP / CONTACT SECTION
======================================== */

.shop-section,
.contact-section {
  padding:
    40px 19px;

  border-top:
    1px solid #edf2f6;
}

.shop-section {
  background: #f9fbfd;
}

.contact-section {
  background: #ffffff;
}

.section-title-static {
  margin-bottom: 20px;

  color: #12365f;

  font-size: 22px;
  font-weight: 900;
  letter-spacing: 0.3px;
}


/* ========================================
   SHOP CARD
======================================== */

.shop-info-card,
.contact-card {
  width: 100%;

  padding:
    18px;

  border:
    1px solid #e0e9f1;

  border-radius: 16px;

  background: #ffffff;

  box-shadow:
    0 5px 18px
    rgba(32, 73, 112, 0.05);
}

.info-row {
  padding:
    13px 0;

  border-bottom:
    1px solid #e5edf4;
}

.info-row:first-child {
  padding-top: 0;
}

.info-row:last-child {
  padding-bottom: 0;
  border-bottom: none;
}

.info-row label,
.contact-fields label {
  display: block;

  margin-bottom: 5px;

  color: #62788d;

  font-size: 10px;
  font-weight: 900;
}

.info-input {
  background: #f9fcff;
}


/* ========================================
   CONTACT
======================================== */

.contact-message {
  min-height: 88px;

  background: #f9fcff;
}

.contact-fields {
  margin-top: 16px;

  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

.contact-fields .visual-input {
  background: #f9fcff;
}


/* ========================================
   SITE FOOTER
======================================== */

.site-footer {
  padding:
    30px 20px;

  background:
    linear-gradient(
      90deg,
      #0c2b54,
      #123c70
    );

  color: #ffffff;

  text-align: center;
}

.site-footer strong {
  font-size: 15px;
  font-weight: 900;
}

.site-footer p {
  margin-top: 4px;

  color: #b9cee1;

  font-size: 9px;
}


/* ========================================
   BOTTOM SAVE BAR
======================================== */

.bottom-admin-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;

  z-index: 900;

  padding:
    9px 12px
    calc(
      9px +
      env(safe-area-inset-bottom)
    );

  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;

  background:
    rgba(255, 255, 255, 0.97);

  border-top:
    1px solid #dae5ee;

  box-shadow:
    0 -5px 22px
    rgba(24, 57, 90, 0.1);

  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.last-update {
  max-width: 145px;

  color: #71869a;

  font-size: 9px;
  line-height: 1.4;
}


/* ========================================
   SAVE BUTTON
======================================== */

.save-button {
  flex-shrink: 0;

  padding:
    12px 18px;

  border: none;

  border-radius: 28px;

  background:
    linear-gradient(
      90deg,
      #1689e4,
      #0874d1
    );

  color: #ffffff;

  font-size: 12px;
  font-weight: 900;

  box-shadow:
    0 5px 16px
    rgba(22, 137, 228, 0.28);

  transition:
    transform 0.15s ease,
    box-shadow 0.2s ease;
}

.save-button:active {
  transform: scale(0.97);
}


/* ========================================
   TOAST
======================================== */

.toast {
  position: fixed;
  left: 50%;
  bottom: 88px;

  z-index: 1200;

  max-width:
    calc(100% - 35px);

  padding:
    10px 16px;

  transform:
    translate(-50%, 20px);

  border-radius: 28px;

  background: #153b66;
  color: #ffffff;

  box-shadow:
    0 5px 20px
    rgba(0, 0, 0, 0.15);

  font-size: 11px;
  font-weight: 900;

  text-align: center;

  opacity: 0;
  pointer-events: none;

  transition:
    opacity 0.25s ease,
    transform 0.25s ease;
}

.toast.show {
  opacity: 1;

  transform:
    translate(-50%, 0);
}


/* ========================================
   PREVIEW MODE
======================================== */

.admin-app.preview-mode {
  background: #eaf0f5;
}

.admin-app.preview-mode
.edit-ui {
  display: none !important;
}

.admin-app.preview-mode
.site-canvas {
  margin-bottom: 30px;
}

.admin-app.preview-mode
.visual-input,
.admin-app.preview-mode
.visual-textarea {
  border-color: transparent;

  background: transparent;

  box-shadow: none;

  pointer-events: none;

  resize: none;
}

.admin-app.preview-mode
.hero-title-input {
  padding-left: 0;
  padding-right: 0;
}

.admin-app.preview-mode
.product-card.is-private {
  display: none;
}

.admin-app.preview-mode
.product-card {
  box-shadow:
    0 6px 20px
    rgba(27, 66, 105, 0.06);
}


/* ========================================
   SMALL PHONE
======================================== */

@media screen and (max-width: 430px) {

  .admin-toolbar {
    padding:
      10px 11px;
  }

  .admin-brand strong {
    font-size: 15px;
  }

  .save-status {
    font-size: 9px;
  }

  .mode-button {
    padding:
      7px 9px;

    font-size: 10px;
  }

  .site-canvas {
    width: 100%;

    margin-top: 0;

    border-left: none;
    border-right: none;

    border-radius: 0;
  }

  .site-header {
    min-height: 58px;

    padding:
      12px 14px;
  }

  .site-brand-display {
    font-size: 14px;
  }

  .site-nav {
    gap: 8px;

    font-size: 8px;
  }

  .hero-image-preview {
    aspect-ratio: 16 / 9;
  }

  .hero-content {
    padding:
      26px 15px 32px;
  }

  .hero-title-input {
    font-size: 23px;
  }

  .hero-text-input {
    font-size: 13px;
  }

  .content-section,
  .shop-section,
  .contact-section {
    padding-left: 15px;
    padding-right: 15px;
  }

  .section-title-input,
  .section-title-static {
    font-size: 20px;
  }

  .content-limit {
    padding:
      6px 8px;
  }

  .product-content {
    padding: 14px;
  }

  .shop-info-card,
  .contact-card {
    padding: 15px;
  }

  .bottom-admin-bar {
    justify-content: space-between;
  }

  .save-button {
    padding:
      11px 15px;

    font-size: 11px;
  }

}


/* ========================================
   TABLET
======================================== */

@media screen and (min-width: 650px) {

  .admin-toolbar {
    padding-left: 5%;
    padding-right: 5%;
  }

  .site-canvas {
    width:
      calc(100% - 36px);

    margin-top: 22px;
  }

  .product-grid {
    grid-template-columns:
      repeat(2, 1fr);
  }

  .contact-fields {
    grid-template-columns:
      repeat(2, 1fr);
  }

  .hero-content,
  .content-section,
  .shop-section,
  .contact-section {
    padding-left: 40px;
    padding-right: 40px;
  }

}


/* ========================================
   DESKTOP
======================================== */

@media screen and (min-width: 900px) {

  .site-canvas {
    margin-top: 28px;

    border-radius: 20px;
  }

  .site-header {
    padding:
      18px 34px;
  }

  .site-brand-display {
    font-size: 19px;
  }

  .hero-image-preview {
    aspect-ratio: 16 / 6.7;
  }

  .hero-content {
    padding-top: 43px;
    padding-bottom: 48px;
  }

  .hero-title-input {
    font-size: 38px;
  }

  .product-grid {
    grid-template-columns:
      repeat(3, 1fr);
  }

  .hero-content,
  .content-section,
  .shop-section,
  .contact-section {
    padding-left: 55px;
    padding-right: 55px;
  }

  .content-section,
  .shop-section,
  .contact-section {
    padding-top: 50px;
    padding-bottom: 55px;
  }

  .bottom-admin-bar {
    padding-left: 6%;
    padding-right: 6%;
  }

}


/* ========================================
   LARGE DESKTOP
======================================== */

@media screen and (min-width: 1200px) {

  .site-canvas {
    max-width: 1120px;
  }

}
