/* =====================================================
   CK STEEL GALLERY
   DESKTOP + MOBILE
===================================================== */

.ck-gallery-container,
.ck-gallery-container * {
  box-sizing: border-box;
}


/* =====================================================
   DESKTOP
===================================================== */

.ck-gallery-container {
  width: 100%;
  max-width: none;
}

.ck-photo-gallery {
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr);
  grid-template-rows: 1fr auto;
  gap: 20px 28px;

  width: 100%;
  min-height: 650px;
}


/* Desktop thumbnails */

.ck-thumb-area {
  grid-column: 1;
  grid-row: 1;

  display: block;
}

.ck-thumbnails {
  display: flex;
  flex-direction: column;
  gap: 12px;

  width: 190px;
  height: 650px;

  padding: 4px 10px 4px 4px;

  overflow-y: auto;
  overflow-x: hidden;

  scrollbar-width: thin;
}

.ck-thumb {
  flex: 0 0 auto;

  width: 170px;
  height: 125px;

  padding: 3px;

  border: 2px solid #d9e1e8;
  border-radius: 10px;

  background: #ffffff;

  overflow: hidden;
  cursor: pointer;
}

.ck-thumb img {
  display: block;

  width: 100%;
  height: 100%;

  object-fit: cover;

  border-radius: 7px;
}

.ck-thumb.active {
  border-color: #0878d1;
}

.ck-thumb:hover {
  border-color: #ef7622;
}


/* Desktop big photo */

.ck-main-viewer {
  grid-column: 2;
  grid-row: 1;

  display: flex;
  align-items: center;
  justify-content: center;

  width: 100%;
  height: 650px;

  padding: 12px;

  background: #f7f9fb;

  border-radius: 14px;

  overflow: hidden;
}

.ck-main-image {
  display: block;

  width: 100%;
  height: 100%;

  object-fit: contain;
  object-position: center;

  border-radius: 8px;

  user-select: none;
  -webkit-user-drag: none;
}


/* Desktop arrows hidden */

.ck-gallery-arrow {
  display: none;
}


/* WhatsApp share */

.ck-gallery-share-area {
  grid-column: 2;
  grid-row: 2;

  display: flex;
  justify-content: center;
}

.ck-gallery-whatsapp-share {
  border: 0;

  padding: 12px 24px;

  border-radius: 8px;

  background: #16a34a;
  color: #ffffff;

  font: inherit;
  font-weight: 700;

  cursor: pointer;
}

.ck-wa-icon {
  margin-right: 7px;
}


/* Gallery headings */

.category[data-gallery] .section-head {
  display: none;
}

.category[data-gallery] .section-inner {
  display: block;
  width: 100%;
  max-width: 100%;
}

.category[data-gallery] [data-gallery-grid] {
  width: 100%;
  max-width: 100%;
}


/* =====================================================
   MOBILE
===================================================== */

@media (max-width: 640px) {

  /*
    IMPORTANT:
    Home and Menu are NOT changed here.
    Only gallery category elements are targeted.
  */


  /* -----------------------------------------
     CATEGORY = ONE MOBILE SCREEN
  ----------------------------------------- */

  .category[data-gallery] {
    position: relative;

    width: 100% !important;

    /* Measured viewport minus the unchanged sticky header. */
    height: calc(100vh - 84px) !important;
    height: var(--ck-gallery-height, calc(100dvh - 84px)) !important;
    min-height: 260px !important;
    scroll-snap-align: none !important;
    scroll-snap-stop: normal !important;

    margin: 0 !important;
    padding: 0 !important;

    background: #f4f1eb !important;

    overflow: hidden !important;
  }


  .category[data-gallery] .section-inner {
    width: 100% !important;
    height: 100% !important;

    max-width: none !important;

    margin: 0 !important;
    padding: 0 !important;
  }


  .category[data-gallery] .section-head {
    display: none !important;
  }


  .collection-heading {
    display: none !important;
  }


  /* -----------------------------------------
     GALLERY WRAPPER

     The section already starts below the sticky header.
     Use only a small inset above the image.
  ----------------------------------------- */

  .ck-gallery-container {
    width: 100% !important;
    height: 100% !important;

    margin: 0 !important;

    padding:
      6px
      8px
      max(10px, env(safe-area-inset-bottom)) !important;

    background: #f4f1eb;

    overflow: hidden;
  }


  /* -----------------------------------------
     MOBILE GRID

     Main photo gets remaining space.
     Thumbnail = 78px
     WhatsApp = 46px
  ----------------------------------------- */

  .ck-photo-gallery {
    display: grid !important;

    grid-template-columns: 1fr !important;

    grid-template-rows:
      minmax(0, 1fr)
      78px
      46px !important;

    gap: 8px !important;

    width: 100% !important;
    height: 100% !important;

    min-height: 0 !important;

    margin: 0 !important;
  }


  /* =================================================
     BIG PHOTO
  ================================================= */

  .ck-main-viewer {
    grid-column: 1 !important;
    grid-row: 1 !important;

    display: flex !important;

    align-items: center !important;
    justify-content: center !important;

    width: 100% !important;
    height: 100% !important;

    min-width: 0 !important;
    min-height: 0 !important;

    margin: 0 !important;
    padding: 0 !important;

    background: transparent !important;

    border: 0 !important;
    border-radius: 0 !important;

    overflow: hidden !important;

    /*
      UP/DOWN remains page scroll.
      LEFT/RIGHT is handled by gallery.js.
    */
    touch-action: pan-y;
  }


  .ck-main-image {
    display: block !important;

    width: 100% !important;
    height: 100% !important;

    max-width: 100% !important;
    max-height: 100% !important;

    margin: 0 !important;

    object-fit: contain !important;
    object-position: center !important;

    border-radius: 0 !important;

    user-select: none;
    -webkit-user-select: none;
    -webkit-user-drag: none;

    touch-action: pan-y;
  }


  /* =================================================
     THUMBNAILS
  ================================================= */

  .ck-thumb-area {
    grid-column: 1 !important;
    grid-row: 2 !important;

    display: grid !important;

    grid-template-columns:
      36px
      minmax(0, 1fr)
      36px !important;

    align-items: center !important;

    gap: 4px !important;

    width: 100% !important;
    height: 78px !important;

    margin: 0 !important;
    padding: 5px 3px !important;

    background: rgba(35, 35, 35, 0.34) !important;

    border-radius: 12px !important;

    overflow: hidden !important;

    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);

    transform: none !important;
  }


  .ck-thumbnails {
    display: flex !important;

    flex-direction: row !important;

    align-items: center !important;

    gap: 5px !important;

    width: 100% !important;
    height: 68px !important;

    margin: 0 !important;
    padding: 2px !important;

    overflow-x: auto !important;
    overflow-y: hidden !important;

    scroll-behavior: smooth;

    scrollbar-width: none;

    -webkit-overflow-scrolling: touch;

    touch-action: pan-x;
  }


  .ck-thumbnails::-webkit-scrollbar {
    display: none;
  }


  /*
    Five thumbnails visible
  */

  .ck-thumb {
    flex:
      0 0
      calc((100% - 20px) / 5) !important;

    width: auto !important;
    height: 62px !important;

    margin: 0 !important;
    padding: 2px !important;

    background: rgba(255, 255, 255, 0.92) !important;

    border:
      2px solid
      rgba(255, 255, 255, 0.90) !important;

    border-radius: 7px !important;

    overflow: hidden !important;
  }


  .ck-thumb img {
    display: block !important;

    width: 100% !important;
    height: 100% !important;

    object-fit: cover !important;

    border-radius: 4px !important;
  }


  .ck-thumb.active {
    border-color: #0788dc !important;

    box-shadow:
      0 0 0 1px #ffffff !important;
  }


  /* =================================================
     LEFT / RIGHT ARROWS
  ================================================= */

  .ck-gallery-arrow {
    display: flex !important;

    align-items: center !important;
    justify-content: center !important;

    width: 36px !important;
    height: 54px !important;

    margin: 0 !important;
    padding: 0 !important;

    border: 0 !important;

    border-radius: 50% !important;

    background:
      rgba(30, 30, 30, 0.62) !important;

    color: #ffffff !important;

    font-size: 24px !important;
    font-weight: 700 !important;

    line-height: 1 !important;

    cursor: pointer;
  }


  /* =================================================
     SHARE TO WHATSAPP
  ================================================= */

  .ck-gallery-share-area {
    grid-column: 1 !important;
    grid-row: 3 !important;

    display: flex !important;

    align-items: center !important;
    justify-content: center !important;

    width: 100% !important;
    height: 46px !important;

    margin: 0 !important;
    padding: 1px 0 0 !important;

    transform: none !important;
  }


  .ck-gallery-whatsapp-share {
    display: flex !important;

    align-items: center !important;
    justify-content: center !important;

    width: 100% !important;
    height: 43px !important;

    margin: 0 !important;
    padding: 0 12px !important;

    border: 0 !important;

    border-radius: 9px !important;

    background: #16a34a !important;

    color: #ffffff !important;

    font: inherit !important;

    font-size: 14px !important;
    font-weight: 700 !important;

    line-height: 1 !important;

    cursor: pointer;
  }


  .ck-wa-icon {
    margin-right: 7px !important;
  }

}
