/*
 Theme Name: Astra Child
 Template: astra
 Theme URI: https://wpastra.com/
 Description: Child Theme for Astra theme
 Author: jawdev
 Author URI: https://jawdev.eu
 Version: 1.0.0
 Text Domain: astra-child
*/


/* preloader styles */
#preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #fff;
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
}

.loader {
    width: 40px;
    height: 40px;
    border: 5px solid #ddd;
    border-top-color: #000;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

body:not(.loaded) #page {
    display: none;
}

/* focus styles */
a:focus,
wp-block-search,
.wp-block-search.wp-block-search__button-inside
  .wp-block-search__inside-wrapper,
.woocommerce-message {
  &:focus,
  &:focus-visible,
  &:focus-within {
    border: none;
    outline: none;
  }
}

#ast-scroll-top:focus {
  border: none;
}

.wp-block-search.wp-block-search__button-inside
  .wp-block-search__inside-wrapper,
input[type="search"]:focus {
  outline: none;
}

/* WPForms styles */
div.wpforms-container-full {
  .wpforms-field-label-inline,
  &.wp-core-ui .wpforms-field-label-inline {
    color: #454545;
  }

  input[type="checkbox"] + label,
  input[type="radio"] + label {
    font-size: 12px;
  }
}

.ast-site-header-cart i.astra-icon:after {
  padding-right: 0;
}

/* recent posts grid */
.custom-recent-posts-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 30px;
  margin: 0 0;
}

.post-card {
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.post-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.06);
}

.post-card__image {
  overflow: hidden;
  aspect-ratio: 16/9;
  position: relative;
}

.post-card__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.5s ease;
}

.post-card__content {
  padding: 20px;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

.post-card__title {
  margin: 0 0 15px 0;
  font-size: 18px;
  line-height: 1.4;
  font-weight: 600;
}

.post-card__title a {
  color: #000;
  text-decoration: none;
}

.post-card__read-more {
  display: inline-block;
  margin-top: auto;
  padding: 6px 12px;
  background-color: #ffffff;
  color: #333;
  text-decoration: none;
  border-radius: 24px;
  border: 1px solid black;
  font-size: 1rem;
  transition: all 0.3s ease;
  align-self: flex-start;
}

.post-card__read-more:hover {
  background-color: #181818;
  color: #fff;
  border-color: #181818;
}

@media (max-width: 992px) {
  .custom-recent-posts-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .post-card:nth-child(3) {
    display: none;
  }
}

@media (max-width: 576px) {
  .custom-recent-posts-grid {
    grid-template-columns: 1fr;
  }

  .post-card:nth-child(n + 3) {
    display: none;
  }
}

/* bestsellers grid */
.woocommerce ul.products.columns-4 {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  list-style: none;
  padding: 0;
  width: 100%;

  @media (max-width: 1024px) {
    grid-template-columns: repeat(3, minmax(0, 1fr));

    li.product:nth-child(4) {
      display: none;
    }
  }

  @media (max-width: 767px) {
    grid-template-columns: 1fr;
  }
}

.ast-menu-toggle:focus {
  outline: none;
}

.ast-mobile-popup-drawer.active .menu-toggle-close:focus,
.ast-menu-toggle {
  border: none;
}

.ast-mobile-popup-drawer.active .menu-toggle-close:focus {
  border: none;
}

/* cart number */
@media (min-width: 480px) {
	.ast-site-header-cart .astra-icon.ast-icon-shopping-cart:after {
		color: red !important;
		background-color: white !important;
		display: flex;
		justify-content: center;
		align-items: center;
		line-height: 12px;
		font-size: 12px;
		min-width: 18px;
	}
}

/* mobile menu */
.main-header-menu-toggle.ast-mobile-menu-trigger-fill {
  display: flex !important;
}

.ast-mobile-menu-trigger-fill {
  display: flex !important;
}

ul.sub-menu {
  padding-left: 16px;
}

.ast-mobile-popup-drawer .ast-mobile-popup-header .menu-toggle-close {
  padding: 18px 18px;
}

.main-navigation .menu-item > .menu-link,
.main-navigation .menu-item > .ast-menu-toggle {
  border: none !important;
}

/* product tabs */
@media (max-width: 544px) {
    .woocommerce #content div.product .woocommerce-tabs ul.tabs li a, .woocommerce-page #content div.product .woocommerce-tabs ul.tabs li a {
        text-align: center;
	}
	
a:active, a:focus {
	outline: 0;
	border: none;
	-moz-outline-style: none;
}