/*
Theme Name: GeneratePress Child
Theme URI: https://kunstas.no
Description: Child theme for GeneratePress (Kunst AS)
Author: Kunst AS
Template: generatepress
Version: 1.0
Text Domain: generatepress-child
*/

/* ======================================================
   GENERELLE JUSTERINGER
====================================================== */

.ka-section {
  margin: 48px 0;
}

/* ======================================================
   HEADER
====================================================== */

.ka-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.ka-head h2 {
  margin: 0;
  font-size: 32px;
  letter-spacing: -0.02em;
  line-height: 1.05;
}

/* ======================================================
   TABS / NAVIGASJON
====================================================== */

.ka-tabsbar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 10px 0 18px;
}

.ka-tabsbar .ka-tab {
  background: #ffffff;
  color: #111111;
  border: 1px solid #d9dce3;
  padding: 10px 18px;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  transition: all .25s ease;
}

.ka-tabsbar .ka-tab:hover {
  background: #1e3a8a;
  color: #ffffff;
  border-color: #1e3a8a;
}

.ka-tabsbar .ka-tab.is-active {
  background: #1e3a8a;
  color: #ffffff;
  border-color: #1e3a8a;
}

/* ======================================================
   SE ALLE KUNSTVERK KNAPP
====================================================== */

a.se-alle-kunstverk,
.wp-block-button a.se-alle-kunstverk {
  background: #1e3a8a;
  color: #ffffff;
  border: 1px solid #1e3a8a;
  padding: 12px 24px;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  display: inline-block;
  transition: all .25s ease;
}

a.se-alle-kunstverk:hover,
.wp-block-button a.se-alle-kunstverk:hover {
  background: #0f2b6b;
  color: #ffffff;
  border-color: #0f2b6b;
}

/* ======================================================
   KARUSELL WRAPPER
====================================================== */

.ka-carousel {
  position: relative;
  overflow: hidden;
  border-radius: 18px;
}

/* ======================================================
   KARUSELL TRACK
====================================================== */

.ka-track {
  display: flex;
  gap: 20px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  padding: 10px 10px 24px;
  -webkit-overflow-scrolling: touch;
}

.ka-track > * {
  scroll-snap-align: start;
}

.ka-track::-webkit-scrollbar {
  height: 10px;
}

.ka-track::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(0,0,0,0.15);
}

/* ======================================================
   PRODUKTKORT I KARUSELL
====================================================== */

.ka-card {
  flex: 0 0 calc((100% - 40px) / 3);
  background: #ffffff;
  border-radius: 18px;
  box-shadow: 0 10px 26px rgba(17,24,39,.08);
  transition: transform .22s ease, box-shadow .22s ease;
  overflow: hidden;
}

.ka-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 18px 42px rgba(17,24,39,.12);
}

.ka-cardlink {
  display: block;
  color: inherit;
  text-decoration: none;
}

.ka-media {
  aspect-ratio: 4 / 5;
  overflow: hidden;
  background: #f3f4f6;
}

.ka-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.ka-meta {
  padding: 16px 16px 18px;
}

.ka-title {
  font-size: 16px;
  line-height: 1.35;
  margin: 0 0 10px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  color: #111827;
}

.ka-price {
  font-size: 14px;
  color: #4b5563;
  margin-bottom: 14px;
}

.ka-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 16px;
  border-radius: 999px;
  background: #1e3a8a;
  color: #ffffff;
  font-size: 14px;
  font-weight: 600;
  line-height: 1;
  transition: background .2s ease, transform .2s ease;
}

.ka-card:hover .ka-cta {
  background: #0f2b6b;
}

/* ======================================================
   KARUSELL PILER
====================================================== */

.ka-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 999px;
  background: rgba(17,24,39,.68);
  color: #ffffff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 5;
  transition: background .2s ease;
}

.ka-nav:hover {
  background: rgba(17,24,39,.9);
}

.ka-prev {
  left: 10px;
}

.ka-next {
  right: 10px;
}

/* ======================================================
   NETTGALLERI – SØK
====================================================== */

.ka-shop-search {
  margin: 0 0 16px;
}

.ka-shop-search form {
  display: flex;
  gap: 0;
  max-width: 640px;
}

.ka-shop-search input[type="search"] {
  flex: 1;
  min-width: 0;
  height: 56px;
  padding: 0 18px;
  border: 1px solid #d8dce5;
  border-right: 0;
  border-radius: 14px 0 0 14px;
  background: #fafafa;
  font-size: 18px;
  color: #111111;
  box-sizing: border-box;
}

.ka-shop-search button {
  height: 56px;
  padding: 0 22px;
  border: 1px solid #1e3a8a;
  border-radius: 0 14px 14px 0;
  background: #1e3a8a;
  color: #ffffff;
  font-size: 17px;
  font-weight: 600;
  cursor: pointer;
  box-sizing: border-box;
  transition: all .2s ease;
}

.ka-shop-search button:hover {
  background: #0f2b6b;
  border-color: #0f2b6b;
}

/* ======================================================
   NETTGALLERI – FILTERMENY
====================================================== */

.ka-filter-menu-wrap {
  margin: 0 0 28px;
}

.ka-filter-menu {
  position: relative;
  max-width: 460px;
}

.ka-filter-menu summary {
  list-style: none;
  cursor: pointer;
  user-select: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 56px;
  padding: 0 18px;
  border: 1px solid #d9dce3;
  border-radius: 14px;
  background: #ffffff;
  font-size: 15px;
  font-weight: 600;
  color: #111111;
  box-sizing: border-box;
}

.ka-filter-menu summary span {
  font-weight: 500;
  color: #6b7280;
}

.ka-filter-menu summary::-webkit-details-marker {
  display: none;
}

.ka-filter-menu summary::after {
  content: "▾";
  font-size: 16px;
  color: #555555;
  flex: 0 0 auto;
}

.ka-filter-menu[open] summary::after {
  content: "▴";
}

.ka-filter-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  z-index: 30;
  width: 100%;
  padding: 18px;
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  background: #ffffff;
  box-shadow: 0 18px 40px rgba(17,24,39,.10);
  box-sizing: border-box;
}

.ka-filter-form {
  display: block;
}

.ka-filter-top-actions {
  display: flex;
  gap: 10px;
  margin: 0 0 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid #eeeeee;
}

.ka-filter-link {
  appearance: none;
  background: #f3f4f6;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 13px;
  font-weight: 600;
  color: #374151;
  cursor: pointer;
  text-decoration: none;
  transition: all .2s ease;
}

.ka-filter-link:hover {
  background: #1e3a8a;
  color: #ffffff;
  border-color: #1e3a8a;
}

.ka-filter-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 18px;
  margin: 12px 0 16px;
}

.ka-filter-option {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid #ececec;
  border-radius: 12px;
  background: #ffffff;
  cursor: pointer;
  transition: background .2s ease, border-color .2s ease, box-shadow .2s ease;
}

.ka-filter-option:hover {
  background: #f8fafc;
  border-color: #d8dce5;
}

.ka-filter-option input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.ka-filter-box {
  width: 18px;
  height: 18px;
  border: 1px solid #bfc5d2;
  border-radius: 4px;
  background: #ffffff;
  flex: 0 0 18px;
  box-sizing: border-box;
  position: relative;
}

.ka-filter-option input[type="checkbox"]:checked + .ka-filter-box {
  border-color: #1e3a8a;
  background: #1e3a8a;
}

.ka-filter-option input[type="checkbox"]:checked + .ka-filter-box::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 5px;
  width: 5px;
  height: 9px;
  border: solid #ffffff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.ka-filter-label {
  font-size: 14px;
  line-height: 1.35;
  color: #111111;
}

.ka-filter-submit {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 14px 0 0;
}

.ka-filter-apply,
.ka-filter-reset {
  min-height: 42px;
  padding: 0 16px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
}

.ka-filter-apply {
  border: 1px solid #1e3a8a;
  background: #1e3a8a;
  color: #ffffff;
  cursor: pointer;
  transition: all .2s ease;
}

.ka-filter-apply:hover {
  background: #0f2b6b;
  border-color: #0f2b6b;
}

.ka-filter-reset {
  border: 1px solid #d6dbe5;
  background: #ffffff;
  color: #1f2937;
}

.ka-filter-reset:hover {
  border-color: #1e3a8a;
  color: #1e3a8a;
}

/* ======================================================
   WOOCOMMERCE JUSTERINGER PÅ NETTGALLERI
====================================================== */

.woocommerce .woocommerce-ordering {
  margin-bottom: 30px;
}

.woocommerce .products {
  margin-top: 10px;
}

/* ======================================================
   GALLERI GRID – STØRRE KUNSTVERK
====================================================== */

.woocommerce ul.products {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 40px;
}

.woocommerce ul.products li.product {
  width: 100%;
  margin: 0;
  float: none;
}

/* ======================================================
   PRODUKTSIDE – PREMIUM CTA / RYDD OPP KNAPPER
====================================================== */

.single-product div.product .summary {
  max-width: 560px;
}

.single-product div.product .summary .price {
  color: #111827;
  font-weight: 700;
}

.single-product form.cart {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-top: 18px;
}

.single-product form.cart .quantity {
  margin: 0;
}

.single-product form.cart .qty {
  min-height: 48px;
  border: 1px solid #d9dce3;
  border-radius: 12px;
  padding: 0 12px;
}

.single-product form.cart button.single_add_to_cart_button,
.single-product form.cart .single_add_to_cart_button.button,
.single-product form.cart .single_add_to_cart_button.button.alt {
  min-height: 48px;
  padding: 0 20px;
  border-radius: 12px;
  border: 1px solid #1e3a8a;
  background: #1e3a8a;
  color: #ffffff;
  font-size: 15px;
  font-weight: 600;
  line-height: 1;
  box-shadow: none;
  transition: all .2s ease;
}

.single-product form.cart button.single_add_to_cart_button:hover,
.single-product form.cart .single_add_to_cart_button.button:hover,
.single-product form.cart .single_add_to_cart_button.button.alt:hover {
  background: #0f2b6b;
  border-color: #0f2b6b;
  color: #ffffff;
}

/* skjul vanlige hurtigkjøp / ekstra checkout-knapper hvis plugin bruker disse klassene */
.single-product .summary .vipps-express-checkout,
.single-product .summary .vipps-express-button,
.single-product .summary .vipps-buy-now-button,
.single-product .summary .woo-vipps-express-button,
.single-product .summary .wcpay-payment-request-wrapper,
.single-product .summary .wc-stripe-product-checkout-container,
.single-product .summary .cartflows-buy-now-button,
.single-product .summary .xoo-wsc-buy-now,
.single-product .summary .xoo-wsc-bki-btn {
  display: none !important;
}

/* litt roligere metadata / levering */
.single-product .product_meta,
.single-product .woocommerce-product-details__short-description,
.single-product .summary p {
  color: #374151;
}

/* ======================================================
   RESPONSIVE
====================================================== */

@media (max-width: 1024px) {
  .ka-card {
    flex: 0 0 calc((100% - 20px) / 2);
  }

  .woocommerce ul.products {
    grid-template-columns: repeat(2, 1fr);
    gap: 28px;
  }
}

@media (max-width: 768px) {
  .ka-shop-search form {
    max-width: 100%;
  }

  .ka-shop-search input[type="search"] {
    font-size: 16px;
  }

  .ka-shop-search button {
    font-size: 16px;
    padding: 0 18px;
  }

  .ka-filter-menu {
    max-width: 100%;
  }

  .ka-filter-dropdown {
    width: 100%;
  }

  .ka-filter-options {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .ka-head h2 {
    font-size: 26px;
  }

  .ka-card {
    flex: 0 0 78vw;
  }

  .ka-nav {
    display: none;
  }

  .ka-filter-top-actions {
    flex-wrap: wrap;
    gap: 12px;
  }

  .ka-filter-submit {
    flex-direction: column;
    align-items: stretch;
  }

  .ka-filter-apply,
  .ka-filter-reset {
    width: 100%;
  }

  .woocommerce ul.products {
    grid-template-columns: 1fr;
    gap: 22px;
  }

  .single-product form.cart {
    align-items: stretch;
  }

  .single-product form.cart .quantity,
  .single-product form.cart button.single_add_to_cart_button,
  .single-product form.cart .single_add_to_cart_button.button,
  .single-product form.cart .single_add_to_cart_button.button.alt {
    width: 100%;
  }
}