:root {
  --sodrinta-content: 1584px;
  --sodrinta-side-gap: 20px;
  --sodrinta-green: #168247;
  --sodrinta-green-dark: #0f6637;
  --sodrinta-text: #233329;
  --sodrinta-line: #e2e9e4;
}

/* Kategorijos visada atskirai, produktai prasideda naujoje eilutėje. */
@media (min-width: 850px) {
  .woocommerce .products.row:has(> .product-category)::before {
    content: '';
    display: block;
    flex: 0 0 100%;
    width: 100%;
    max-width: 100%;
    height: 0;
    margin: 0;
    padding: 0;
    order: 1;
  }
  .woocommerce .products.row > .product-category { order: 0; }
  .woocommerce .products.row > .product-small:not(.product-category) { order: 2; }
}

.woocommerce .products .product-small:not(.product-category) .box-image img {
  width: 100% !important;
  height: 100% !important;
  max-width: 100% !important;
  max-height: 100% !important;
  padding: 8px !important;
  object-fit: contain !important;
  object-position: center !important;
}

@media (min-width: 850px) {
  #header {
    position: sticky !important;
    top: 0 !important;
    z-index: 9999 !important;
    background: #fff !important;
    box-shadow: 0 8px 28px rgba(22, 56, 36, .09) !important;
  }

  body.admin-bar #header {
    top: 32px !important;
  }

  #header,
  #header .header-wrapper,
  #header .header-bg-container,
  #header .stuck {
    transform: none !important;
  }

  #header .header-top {
    display: none !important;
  }

  #header .header-main {
    height: 68px !important;
    min-height: 68px !important;
    padding: 0 !important;
    background: #fff !important;
    border: 0 !important;
    box-shadow: none !important;
  }

  #header .header-main .header-inner,
  #header .header-bottom > .flex-row,
  #header .header-bottom .header-inner {
    width: calc(100% - (var(--sodrinta-side-gap) * 2)) !important;
    max-width: var(--sodrinta-content) !important;
    margin-left: auto !important;
    margin-right: auto !important;
  }

  #header .header-main .header-inner {
    min-height: 68px !important;
    display: flex !important;
    align-items: center !important;
    gap: 12px !important;
    padding: 0 !important;
  }

  #header #logo,
  #header .header-main .logo {
    flex: 0 0 176px !important;
    width: 176px !important;
    height: 48px !important;
    margin: 0 !important;
    padding: 0 !important;
    display: flex !important;
    align-items: center !important;
  }

  #header #logo a {
    width: 100% !important;
    height: 48px !important;
    display: flex !important;
    align-items: center !important;
  }

  #header #logo img.header_logo {
    display: block !important;
    width: auto !important;
    max-width: 172px !important;
    max-height: 45px !important;
    margin: 0 !important;
    object-fit: contain !important;
    object-position: left center !important;
  }

  #header #logo img.header-logo-dark {
    display: none !important;
  }

  #header .sodrinta-search-slot {
    flex: 1 1 auto !important;
    width: auto !important;
    min-width: 220px !important;
    max-width: none !important;
    display: flex !important;
    margin: 0 !important;
  }

  #header .sodrinta-search-slot > *,
  #header .sodrinta-search-slot form,
  #header .sodrinta-search-slot .searchform,
  #header .sodrinta-search-slot .flex-row {
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
  }

  #header .sodrinta-search-slot .searchform {
    height: 44px !important;
    display: flex !important;
    overflow: hidden !important;
    background: #f5f8f6 !important;
    border: 1px solid #d8e2dc !important;
    border-radius: 12px !important;
    box-shadow: none !important;
    transition: border-color .18s ease, box-shadow .18s ease, background .18s ease !important;
  }

  #header .sodrinta-search-slot .searchform:focus-within {
    background: #fff !important;
    border-color: var(--sodrinta-green) !important;
    box-shadow: 0 0 0 4px rgba(22, 130, 71, .1) !important;
  }

  #header .sodrinta-search-slot input[type="search"],
  #header .sodrinta-search-slot input[type="text"] {
    height: 42px !important;
    min-height: 42px !important;
    padding: 0 16px !important;
    border: 0 !important;
    box-shadow: none !important;
    background: transparent !important;
    color: var(--sodrinta-text) !important;
    font-size: 14px !important;
  }

  #header .sodrinta-search-slot button,
  #header .sodrinta-search-slot input[type="submit"] {
    width: 48px !important;
    min-width: 48px !important;
    height: 42px !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    color: var(--sodrinta-green) !important;
  }

  #header .header-main .flex-right {
    flex: 0 0 auto !important;
    min-width: 0 !important;
  }

  #header .header-main .header-nav-main {
    display: flex !important;
    align-items: center !important;
    gap: 6px !important;
    margin: 0 !important;
  }

  #header .header-main .header-divider {
    display: none !important;
  }

  #header .header-main .account-item .header-button > a,
  #header .header-main .cart-item .header-button > a {
    height: 44px !important;
    min-height: 44px !important;
    min-width: 44px !important;
    margin: 0 !important;
    padding: 0 12px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 7px !important;
    border-radius: 11px !important;
    font-size: 12px !important;
    font-weight: 700 !important;
    white-space: nowrap !important;
  }

  #header .header-main .account-item .header-button > a {
    background: #f1f6f3 !important;
    border: 1px solid #e0e9e3 !important;
    color: var(--sodrinta-text) !important;
  }

  #header .header-main .account-item .header-button > a::after {
    content: "Paskyra";
    font: inherit;
  }

  #header .header-main .cart-item .header-button > a {
    background: var(--sodrinta-green) !important;
    border: 1px solid var(--sodrinta-green) !important;
    color: #fff !important;
    box-shadow: 0 5px 14px rgba(22, 130, 71, .18) !important;
  }

  #header .header-main .cart-item .header-button > a:hover {
    background: var(--sodrinta-green-dark) !important;
  }

  #header .header-main .account-item i,
  #header .header-main .cart-item i {
    margin: 0 !important;
    font-size: 18px !important;
  }

  #header .sodrinta-contact-inline {
    flex: 0 0 160px !important;
    width: 160px !important;
    min-width: 160px !important;
    height: 44px !important;
    margin: 0 0 0 2px !important;
    padding: 2px 0 2px 10px !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-start !important;
    justify-content: center !important;
    gap: 2px !important;
    border-left: 1px solid var(--sodrinta-line) !important;
  }

  #header .sodrinta-contact-inline a {
    height: auto !important;
    min-height: 0 !important;
    padding: 0 !important;
    display: flex !important;
    align-items: center !important;
    gap: 5px !important;
    color: #314238 !important;
    font-size: 12px !important;
    font-weight: 700 !important;
    line-height: 1.3 !important;
    letter-spacing: 0 !important;
    text-transform: none !important;
    white-space: nowrap !important;
  }

  #header .sodrinta-contact-inline a:hover {
    color: var(--sodrinta-green) !important;
  }

  #header .sodrinta-contact-icon {
    width: 14px;
    color: var(--sodrinta-green);
    text-align: center;
    font-size: 12px;
  }

  #header .header-bottom {
    height: 43px !important;
    min-height: 43px !important;
    background: #fff !important;
    border-top: 1px solid #eef2ef !important;
    border-bottom: 1px solid var(--sodrinta-line) !important;
    box-shadow: none !important;
  }

  #header .header-bottom > .flex-row,
  #header .header-bottom .header-inner {
    min-height: 42px !important;
  }

  #header .header-bottom .nav {
    min-height: 42px !important;
    display: flex !important;
    align-items: center !important;
    gap: 4px !important;
  }

  #header .header-bottom .nav > li > a,
  #mega-menu-wrap-primary #mega-menu-primary > li.mega-menu-item > a.mega-menu-link {
    min-height: 34px !important;
    height: 34px !important;
    padding: 0 13px !important;
    display: flex !important;
    align-items: center !important;
    border-radius: 8px !important;
    color: #2c3b31 !important;
    font-size: 11px !important;
    font-weight: 700 !important;
    line-height: 34px !important;
  }

  #mega-menu-wrap-primary #mega-menu-primary > li.mega-menu-item:first-child > a.mega-menu-link {
    background: var(--sodrinta-green) !important;
    color: #fff !important;
    padding-left: 17px !important;
    padding-right: 17px !important;
  }

  body.home #content > .row.row-collapse.row-full-width.hide-for-medium {
    display: grid !important;
    grid-template-columns: clamp(330px, 23%, 360px) minmax(0, 1fr) !important;
    align-items: stretch !important;
    width: calc(100% - (var(--sodrinta-side-gap) * 2)) !important;
    max-width: var(--sodrinta-content) !important;
    margin: 18px auto 0 !important;
    overflow: hidden !important;
    border: 1px solid #e1e8e3 !important;
    border-bottom: 0 !important;
    border-radius: 18px 18px 0 0 !important;
    background: #fff !important;
    box-shadow: 0 14px 40px rgba(25, 60, 39, .10) !important;
    height: 500px !important;
    min-height: 500px !important;
    max-height: 500px !important;
  }

  body.home #content > .row.row-collapse.row-full-width.hide-for-medium > .col {
    width: 100% !important;
    max-width: none !important;
    min-width: 0 !important;
    flex: none !important;
    padding: 0 !important;
  }

  body.home #content > .row.row-collapse.row-full-width.hide-for-medium > .col:first-child {
    grid-column: 1 !important;
  }

  body.home #content > .row.row-collapse.row-full-width.hide-for-medium > .col:last-child {
    grid-column: 2 !important;
  }

  body.home #content > .row.row-collapse.row-full-width.hide-for-medium > .col,
  body.home #content > .row.row-collapse.row-full-width.hide-for-medium > .col > .col-inner,
  body.home #content > .row.row-collapse.row-full-width.hide-for-medium .slider-wrapper,
  body.home #content > .row.row-collapse.row-full-width.hide-for-medium .slider,
  body.home #content > .row.row-collapse.row-full-width.hide-for-medium .banner,
  body.home #content > .row.row-collapse.row-full-width.hide-for-medium .banner-inner {
    height: 500px !important;
    min-height: 500px !important;
    max-height: 500px !important;
  }

  body.home #content > .row.row-collapse.row-full-width.hide-for-medium .bg-fill {
    background-size: cover !important;
    background-position: center center !important;
    background-repeat: no-repeat !important;
  }

  body.home #content > .row.row-collapse.row-full-width.hide-for-medium .banner,
  body.home #content > .row.row-collapse.row-full-width.hide-for-medium .banner-inner {
    overflow: hidden !important;
    border-radius: 0 17px 0 0 !important;
  }

  /* Meniu + slideris ir dovanų blokas naudoja tą patį bendrą plotį. */
  body.home .sfgp {
    width: calc(100% - (var(--sodrinta-side-gap) * 2)) !important;
    max-width: var(--sodrinta-content) !important;
    margin-top: 0 !important;
    border: 0 !important;
    border-radius: 0 0 18px 18px !important;
    box-shadow: 0 14px 40px rgba(25, 60, 39, .10) !important;
  }

  body.home #content > .row.row-collapse.row-full-width.hide-for-medium .flickity-button,
  body.home #content > .row.row-collapse.row-full-width.hide-for-medium .flickity-prev-next-button {
    width: 40px !important;
    height: 40px !important;
    border-radius: 50% !important;
    background: rgba(255, 255, 255, .94) !important;
    color: var(--sodrinta-green) !important;
    box-shadow: 0 7px 20px rgba(18, 46, 29, .16) !important;
  }

  body.home #content > .row.row-collapse.row-full-width.hide-for-medium .flickity-page-dots {
    bottom: 14px !important;
  }

  body.home #content > .row.row-collapse.row-full-width.hide-for-medium .flickity-page-dots .dot {
    width: 7px !important;
    height: 7px !important;
    margin: 0 4px !important;
    border: 0 !important;
    background: rgba(255, 255, 255, .72) !important;
    opacity: 1 !important;
  }

  body.home #content > .row.row-collapse.row-full-width.hide-for-medium .flickity-page-dots .dot.is-selected {
    width: 22px !important;
    border-radius: 8px !important;
    background: var(--sodrinta-green) !important;
  }

  body.home #content > .wcbsl,
  body.home #content > .wcms,
  body.home #content > .wcsps,
  body.home #content > .section,
  body.home #content > .row:not(.row-full-width) {
    max-width: var(--sodrinta-content) !important;
    margin-left: auto !important;
    margin-right: auto !important;
  }

  body.home .wcbsl-wrap {
    border-radius: 16px !important;
  }

  body.home .wcbsl-card {
    border: 1px solid #e4eae6 !important;
    border-radius: 14px !important;
    background: #fff !important;
    box-shadow: 0 5px 18px rgba(25, 60, 39, .055) !important;
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease !important;
  }

  body.home .wcbsl-card:hover {
    transform: translateY(-3px);
    border-color: #cbdcd1 !important;
    box-shadow: 0 12px 28px rgba(25, 60, 39, .11) !important;
  }
}

@media (min-width: 850px) and (max-width: 1180px) {
  :root {
    --sodrinta-side-gap: 14px;
  }

  #header .header-main .header-inner {
    gap: 8px !important;
  }

  #header #logo,
  #header .header-main .logo {
    flex-basis: 145px !important;
    width: 145px !important;
  }

  #header #logo img.header_logo {
    max-width: 142px !important;
  }

  #header .header-main .account-item .header-button > a::after,
  #header .header-cart-title {
    display: none !important;
  }

  #header .header-main .account-item .header-button > a,
  #header .header-main .cart-item .header-button > a {
    width: 44px !important;
    padding: 0 !important;
  }

  #header .sodrinta-contact-inline {
    flex-basis: 148px !important;
    width: 148px !important;
    min-width: 148px !important;
    padding-left: 7px !important;
  }

  #header .sodrinta-contact-inline a {
    font-size: 11px !important;
  }
}

@media (min-width: 850px) and (max-width: 1024px) {
  body.home #content > .row.row-collapse.row-full-width.hide-for-medium,
  body.home #content > .row.row-collapse.row-full-width.hide-for-medium > .col,
  body.home #content > .row.row-collapse.row-full-width.hide-for-medium > .col > .col-inner,
  body.home #content > .row.row-collapse.row-full-width.hide-for-medium .slider-wrapper,
  body.home #content > .row.row-collapse.row-full-width.hide-for-medium .slider,
  body.home #content > .row.row-collapse.row-full-width.hide-for-medium .banner,
  body.home #content > .row.row-collapse.row-full-width.hide-for-medium .banner-inner {
    height: 440px !important;
    min-height: 440px !important;
    max-height: 440px !important;
  }
}

/* Produktų archyvai: 5 vienodo aukščio kortelės kompiuteryje */
@media (min-width: 850px) {
  body.woocommerce.archive .shop-container .products,
  body.woocommerce.search .shop-container .products {
    align-items: stretch !important;
  }

  body.woocommerce.archive .shop-container .products > .product.type-product,
  body.woocommerce.search .shop-container .products > .product.type-product {
    display: flex !important;
    flex: 0 0 20% !important;
    max-width: 20% !important;
    align-self: stretch !important;
  }

  body.woocommerce.archive .shop-container .products > .product.type-product > .col-inner,
  body.woocommerce.search .shop-container .products > .product.type-product > .col-inner,
  body.woocommerce.archive .shop-container .products > .product.type-product .product-small.box,
  body.woocommerce.search .shop-container .products > .product.type-product .product-small.box {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
    height: 100% !important;
  }

  body.woocommerce.archive .shop-container .products > .product.type-product .box-image,
  body.woocommerce.search .shop-container .products > .product.type-product .box-image {
    flex: 0 0 auto !important;
    width: 100% !important;
    aspect-ratio: 1 / 1 !important;
    overflow: hidden !important;
  }

  body.woocommerce.archive .shop-container .products > .product.type-product .box-image > div,
  body.woocommerce.archive .shop-container .products > .product.type-product .box-image a,
  body.woocommerce.search .shop-container .products > .product.type-product .box-image > div,
  body.woocommerce.search .shop-container .products > .product.type-product .box-image a {
    display: block !important;
    height: 100% !important;
  }

  body.woocommerce.archive .shop-container .products > .product.type-product .box-image img,
  body.woocommerce.search .shop-container .products > .product.type-product .box-image img {
    width: 100% !important;
    height: 100% !important;
    object-fit: contain !important;
  }

  body.woocommerce.archive .shop-container .products > .product.type-product .box-text-products,
  body.woocommerce.search .shop-container .products > .product.type-product .box-text-products {
    display: flex !important;
    flex: 1 1 auto !important;
    flex-direction: column !important;
    align-items: stretch !important;
    min-height: 145px !important;
  }

  body.woocommerce.archive .shop-container .products > .product.type-product .title-wrapper,
  body.woocommerce.search .shop-container .products > .product.type-product .title-wrapper {
    display: flex !important;
    flex: 1 1 auto !important;
    align-items: center !important;
    justify-content: center !important;
    min-height: 48px !important;
  }

  body.woocommerce.archive .shop-container .products > .product.type-product .price-wrapper,
  body.woocommerce.search .shop-container .products > .product.type-product .price-wrapper {
    min-height: 26px !important;
    margin-top: auto !important;
  }

  body.woocommerce.archive .shop-container .products > .product.type-product .add-to-cart-button,
  body.woocommerce.search .shop-container .products > .product.type-product .add-to-cart-button {
    min-height: 32px !important;
    margin-top: auto !important;
  }
}
