/*
Theme Name: Sapa Child
Theme URI: https://el4.thembaydev.com/sapa/
Author: Thembay
Description: This is a child theme for Sapa
Version: 1.0
Author URI: https://thembay.com/
Template: sapa
Text Domain: sapa-child
*/

/*  [ Add your custom css below ]
- - - - - - - - - - - - - - - - - - - - */

/* WPML Minimalist Dropdown Language Switcher (Option B) */

.wpml-ls {
  position: relative;
  padding: 5px 0; /* Increase hover area */
}

.wpml-ls ul {
  position: relative;
  margin: 0 !important;
  padding: 0 !important;
  list-style: none !important;
  display: flex;
  align-items: center;
}

.wpml-ls li {
  margin: 0 !important;
  padding: 0 !important;
}

/* Hide flags and original full names */
.wpml-ls-flag, .wpml-ls-display {
  display: none !important;
}

.wpml-ls-native {
  font-size: 0 !important;
}

/* Custom text for EN and PL */
.wpml-ls-item-en .wpml-ls-native::after {
  content: "EN";
  font-size: 16px !important;
  font-weight: 500;
}

.wpml-ls-item-pl .wpml-ls-native::after {
  content: "PL";
  font-size: 16px !important;
  font-weight: 500;
}

/* Base link styling */
.wpml-ls a {
  color: #163f45;
  background: transparent !important;
  border: none !important;
  padding: 0 !important;
  font-family: inherit !important;
  font-size: 16px;
  font-weight: 500;
  line-height: 1;
  text-decoration: none !important;
  cursor: pointer;
  display: inline-block;
  transition: color 0.2s ease, transform 0.2s ease;
}

.wpml-ls a:hover {
  color: #b9b34a;
}

/* Dropdown styling */

/* 1. Hide non-active language by default and style as a dropdown box */
.wpml-ls-item:not(.wpml-ls-current-language) {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  right: -8px; /* align with the right edge */
  background: #ffffff;
  padding: 8px 12px !important;
  border-radius: 6px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.08);
  z-index: 9999;
  text-align: center;
  min-width: 45px;
}

/* 2. Show the dropdown box on hover */
.wpml-ls:hover .wpml-ls-item:not(.wpml-ls-current-language) {
  display: block;
  animation: sapaDropdownFade 0.2s ease forwards;
}

/* 3. Add chevron (▾) to the current language */
.wpml-ls-current-language > a::after {
  content: " \25BE"; /* Unicode chevron */
  font-size: 15px;
  margin-left: 3px;
  display: inline-block;
  transition: transform 0.2s ease;
}

/* 4. Flip chevron on hover */
.wpml-ls:hover .wpml-ls-current-language > a::after {
  transform: rotate(180deg);
  color: #b9b34a;
}

/* Smooth fade in for dropdown */
@keyframes sapaDropdownFade {
  from {
    opacity: 0;
    transform: translateY(-5px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Header V2 Styling */
.header-v2-container .header-v2-search .tbay-search-form {
    max-width: 600px;
    margin: 0 auto;
}
.header-v2-container .header-v2-search .tbay-search-form .input-group {
    background-color: #f5f5f5 !important;
    border-radius: 50px !important;
    border: 1px solid #e0e0e0 !important;
    overflow: visible;
    display: flex;
    align-items: center;
}
.header-v2-container .header-v2-search .tbay-search-form .input-group .tbay-select-category {
    border-right: 1px solid #e0e0e0;
    background: transparent !important;
    border: none;
    border-radius: 0;
}
.header-v2-container .header-v2-search .tbay-search-form input.form-control {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    padding-left: 20px;
    height: 45px;
    width: 100% !important;
    flex: 1;
}
.header-v2-container .header-v2-search .tbay-search-form .button-group {
    background: transparent !important;
    border: none !important;
}
.header-v2-container .header-v2-search .tbay-search-form button {
    background: transparent !important;
    color: #666 !important;
    border: none !important;
    padding: 0 20px !important;
    box-shadow: none !important;
    font-size: 20px;
    min-width: auto !important;
}
.header-v2-container .header-v2-search .tbay-search-form button:hover {
    color: #163f45 !important;
}
.header-v2-container .header-v2-search .tbay-search-form button .text {
    display: none !important;
}

.header-v2-container .header-v2-nav .header-mainmenu {
    display: flex;
    justify-content: center;
    width: 100%;
}
.header-v2-container .header-v2-nav .navbar-nav {
    display: flex;
    justify-content: center;
    float: none !important;
}

/* Header V2 Floating Search Dropdown */
.header-v2-container .header-v2-search .tbay-search-form {
    position: relative;
}
.header-v2-container .header-v2-search .tbay-search-form .search-results-wrapper {
    position: absolute;
    top: calc(100% + 15px) !important; /* 15px gap below the pill */
    left: 0;
    width: 100%;
    z-index: 9999;
}
/* Ensure the wrapper doesn't leave a white box when empty */
.header-v2-container .header-v2-search .tbay-search-form .sapa-search-results {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    margin: 0 !important;
}
/* Target the actual javascript-generated dropdown */
.header-v2-container .header-v2-search .tbay-search-form .autocomplete-suggestions {
    background: #ffffff !important;
    border-radius: 20px !important;
    border: none !important;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.12) !important;
    padding: 15px !important;
    margin: 0 !important;
    overflow: hidden; /* Clip inner items to match radius */
}
/* Style the view all link at the bottom */
.header-v2-container .header-v2-search .tbay-search-form .autocomplete-suggestions .view-all-products {
    border-top: 1px solid #f0f0f0 !important;
    padding-top: 15px !important;
    margin-top: 10px !important;
    font-weight: 500;
}
.header-v2-container .header-v2-search .tbay-search-form .autocomplete-suggestions .view-all-products a {
    color: #163f45;
}

/* Reduce Menu Height */
.header-v2-container .header-v2-nav .navbar-nav > li > a {
    padding-top: 15px !important;
    padding-bottom: 15px !important;
}

/* Increase Header Icon Sizes */
.header-v2-container .header-v2-account > a > i,
.header-v2-container .header-v2-cart > div > a > i,
.header-v2-container .header-v2-cart .cart-popup i,
.header-v2-container .header-v2-search .button-search i {
    font-size: 26px !important;
}

/* Style Search Icon to match Cart/Account (transparent background + hover) */
.header-v2-container .header-v2-search .button-search {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 10px !important;
    color: #121216 !important;
    transition: color 0.3s ease;
}
.header-v2-container .header-v2-search .button-search:hover,
.header-v2-container .header-v2-search .button-search:focus {
    background: transparent !important;
    color: var(--tbay-theme-primary-color, #163f45) !important;
    outline: none !important;
}

/* Increase Search Input Font Size */
.header-v2-container .header-v2-search .tbay-search-form .input-group input.tbay-search {
    font-size: 16px !important;
}
.header-v2-container .header-v2-search .tbay-search-form .input-group input.tbay-search::placeholder {
    font-size: 16px !important;
}

/* Uniform Product Image Heights */
/* 1. Force figure to be a perfect square */
.product-block figure.image {
    aspect-ratio: 1 / 1 !important;
}

/* 2. Make the link fill the square and center the image */
.product-block figure.image > a.product-image {
    height: 100% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

/* 3. Constrain the main image to fit inside the square without cropping */
.product-block figure.image > a.product-image > img.image-effect,
.product-block figure.image > a.product-image > img.image-no-effect {
    max-width: 100% !important;
    max-height: 100% !important;
    width: auto !important;
    height: auto !important;
    object-fit: contain !important;
}

/* 4. Hover image: just constrain height, let the theme handle positioning */
.product-block figure.image > a.product-image > img.image-hover {
    max-height: 100% !important;
}

