/*
 Theme Name:   Astra Child
 Theme URI:    https://wpastra.com/
 Description:  قالب فرزند برای Astra
 Author:       Mojtaba
 Author URI:   https://mrwallpost.com
 Template:     astra
 Version:      1.0.0
*/

/* می‌تونی استایل‌های اختصاصی هم اینجا بنویسی */

@font-face {
  font-family: 'IRANSansWeb';
  src: url('/wp-content/themes/astra-child/IRANSansWeb.woff2') format('woff');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

body, button, input, select, textarea {
  font-family: 'IRANSansWeb', Tahoma, sans-serif !important;
}

/* استثنا برای آیکون‌ها */
[class^="fa-"], [class*=" fa-"], 
[class^="fas"], [class*=" fas"], 
[class^="fab"], [class*=" fab"],
[class^="eicon"], [class*=" eicon"],
i, .icon {
  font-family: 'Font Awesome 5 Free' !important;
  font-weight: 900 !important;
}

/* کانتینر محصولات ووکامرس */
ul.products {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 20px;
  padding: 0;
  margin: 0;
  list-style: none;
}

/* کارت هر محصول */
ul.products li.product {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: stretch;
  padding: 15px;
  border-radius: 12px;
  background: #ffffff;
  border: 1px solid #ddd;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  transition: all 0.3s ease;
  box-sizing: border-box;
  height: auto;           /* ✅ حذف ارتفاع ثابت */
  min-height: unset;      /* ✅ غیرفعال کردن حداقل ارتفاع */
  position: relative;
  overflow: hidden;
}


/* هاور کارت */
ul.products li.product:hover {
  transform: translateY(-5px);
  box-shadow: 0 12px 25px rgba(0, 0, 0, 0.12);
}

/* تصویر محصول */
ul.products li.product img {
  max-height: 180px;       /* ⬆️ افزایش سایز تصویر */
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
  margin: 0 auto 12px auto;
  transition: transform 0.3s ease;
}


ul.products li.product:hover img {
  transform: scale(1.05);
}

/* عنوان محصول */
ul.products li.product h2.woocommerce-loop-product__title {
  font-size: 14px;
  font-weight: 600;
  text-align: center;
  color: #333;
  min-height: 40px;
  max-height: 40px;
  overflow: hidden;
  margin: 8px 0;
  line-height: 1.4;
}

/* دسته‌بندی */
ul.products li.product .woocommerce-loop-category__title {
  font-size: 13px;
  text-align: center;
  color: #999;
  margin-bottom: 6px;
}

/* قیمت */
ul.products li.product .price {
  font-size: 16px;
  font-weight: bold;
  color: #e67e22;
  text-align: center;
  margin-top: auto;
  margin-bottom: 12px;
}

/* دکمه افزودن به سبد خرید */
ul.products li.product .button {
  display: block;
  width: 100%;
  text-align: center;
  background-color: #3498db;
  color: #fff !important;
  padding: 10px 15px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  border: none;
  cursor: pointer;
  transition: background-color 0.3s ease;
  text-decoration: none;
}

ul.products li.product .button:hover {
  background-color: #2980b9;
}

/* حذف خطوط زیر لینک‌ها */
ul.products li.product a {
  text-decoration: none !important;
}

/* ریسپانسیو برای تبلت */
@media (max-width: 768px) {
  ul.products li.product {
    width: 45%;
    min-height: 360px;
  }
}

/* ریسپانسیو برای موبایل */
@media (max-width: 480px) {
  ul.products li.product {
    width: 100%;
    min-height: 360px;
  }
}



/* === استایل کلی باکس محصول === */
.single-product .product {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    align-items: flex-start;
}

.woocommerce div.product .summary {
    background: #fff;
    padding: 20px;
    border-radius: 16px;
    box-shadow: 0 3px 12px rgba(0,0,0,0.08);
}

/* === انتخابگرها (select dropdown) === */
.woocommerce div.product form.cart select {
        background: linear-gradient(90deg, #43a047, #66bb6a); /* سبز گرادینت */
    width: 100%;
    padding: 12px 15px;
    border-radius: 10px;
    border: 1px solid #ddd;
    font-size: 15px;
    background: #fff;
    margin-bottom: 12px;
    transition: all 0.3s ease;
    white-space: normal; /* متن طولانی کامل دیده بشه */
    line-height: 1.5;
}

.woocommerce div.product form.cart select:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

/* === دکمه افزودن به سبد خرید === */
.woocommerce div.product form.cart .button {
    background: #ff4000;
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    padding: 12px 25px !important;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 8px;
}

.woocommerce div.product form.cart .button:hover {
    background: #ff4000;
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

/* === باکس تعداد === */
.woocommerce .quantity input.qty {
    width: 55px;
    height: 42px;
    border-radius: 10px;
    border: 1px solid #ddd;
    text-align: center;
    font-size: 15px;
    margin-left: 8px;
}

/* === گالری محصول === */
.woocommerce div.product div.images {
    background: #fff;
    padding: 15px;
    border-radius: 16px;
    box-shadow: 0 3px 12px rgba(0,0,0,0.08);
}

.woocommerce div.product div.images img {
    border-radius: 12px;
}

/* === محصولات مرتبط (کارتی) === */
.woocommerce .related ul.products li.product,
.woocommerce .upsells ul.products li.product {
    background: #fff;
    padding: 12px;
    border-radius: 14px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    transition: all 0.3s ease;
}

.woocommerce .related ul.products li.product:hover,
.woocommerce .upsells ul.products li.product:hover {
    transform: translateY(-4px);
    box-shadow: 0 6px 16px rgba(0,0,0,0.1);
}




/* مخفی کردن دراپ داون اصلی */
.variations_form .variations select {
    display: none !important;
}

/* چیدن دکمه‌ها کنار هم */
.variation-options {
    display: flex;
    flex-wrap: wrap;
    gap: 0px;
    margin: 0px;
}

.variation-options button {
    padding: 10px 18px;
    border: 1px solid #ddd;
    border-radius: 8px;
    background: #fdb143 !important;
    cursor: pointer;
    transition: all 0.25s ease;
    font-size: 14px;
}

.variation-options button:hover {
    border-color: #0073e6;
    background: #eef6ff;
}

.variation-options button.active {
    background: #ed9414 !important;
    color: #fff;
    border: 1px solid black;
}


.woocommerce-variation-price {
    display: block !important;
        font-size: 28px;
    font-weight: 900;
    color: #fdb143;
    margin: 0;
    flex: 0 0 auto;
    display: inline-block;
    background: #fdb1431c;
    padding: 8px 16px;
    border-radius: 8px;
}
.always-show {
    display: block !important;
    margin-top: 10px;
    font-size: 1.2em;
    font-weight: bold;
}

/* === دیزاین کامل و مدرن برای صفحه محصول Astra + WooCommerce === */

/* 1. چیدمان کلی صفحه محصول */
.single-product .product {
    display: flex;
    flex-wrap: wrap;
    gap: 40px;
    align-items: flex-start;
    margin-top: 40px;
}

/* 2. تصویر محصول با محدودیت سایز */
.woocommerce-product-gallery {
    flex: 1 1 35%;
    max-width: 400px;
}
.woocommerce-product-gallery img {
    width: 100%;
    border-radius: 12px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
    object-fit: contain;
}

/* 3. بخش اطلاعات محصول */
.summary {
    flex: 1 1 60%;
}

/* 4. عنوان محصول */
.product_title {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 20px;
    color: #222;
}

/* 5. گزینه‌های متغیر (بلوک‌ها) */
.variations_form .variations {
    margin-bottom: 20px;
}
.variations td.label {
    font-weight: 600;
    padding-right: 10px;
}
.variations .value .block-option {
    display: inline-block;
    padding: 8px 16px;
    margin: 6px 6px 0 0;
    background-color: #ffc107;
    border-radius: 6px;
    color: #222;
    font-weight: bold;
    cursor: pointer;
    transition: 0.2s ease;
}
.variations .value .block-option:hover {
    background-color: #ffb300;
}

/* 6. باکس قیمت + دکمه خرید + تعداد */
.product-box {
    border: 1px solid #eee;
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 25px;
    background: #fafafa;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 20px;
}


/* 8. دکمه خرید */
.single_add_to_cart_button {
    background: #ff4000;
    color: white;
    padding: 10px 24px;
    border: none;
    border-radius: 12px;
    font-weight: bold;
    font-size: 15px;
    transition: 0.3s ease;
    cursor: pointer;
}
.single_add_to_cart_button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}


/* 9. فیلد تعداد محصول */
.quantity {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #fff;
    padding: 6px 10px;
    border-radius: 12px;
}
.quantity input.qty {
    width: 60px;
    height: 38px;
    border: none;
    text-align: center;
    font-size: 15px;
    border-radius: 8px;
    box-shadow: none;
    outline: none;
}

/* 10. لیبل "تعداد" قبل از فیلد */
.quantity::before {
    content: "تعداد:";
    font-size: 15px;
    color: #333;
    font-weight: 500;
}

/* 11. متا دیتا محصول (دسته‌بندی، برچسب‌ها) */
.product_meta {
    margin-top: 25px;
}
.product_meta span,
.product_meta a {
    background-color: #f0f0f0;
    color: #444;
    padding: 4px 10px;
    margin-right: 5px;
    border-radius: 4px;
    font-size: 13px;
    display: inline-block;
}

/* 12. ریسپانسیو موبایل */
@media (max-width: 768px) {
    .single-product .product {
        flex-direction: column;
    }

    .woocommerce-product-gallery,
    .summary {
        flex: 1 1 100%;
        max-width: 100%;
    }

    .product-box {
        flex-direction: column;
        align-items: stretch; /* تغییر مهم برای چیدمان */
        gap: 15px;
    }

    .single_add_to_cart_button {
        width: 100% !important;
        text-align: center;
        display: block;
    }

    .quantity {
        width: 100%;
        justify-content: space-between;
    }

    .quantity input.qty {
        width: 50px;
    }
}

/* عکس بزرگ اصلی گالری محصول */
.woocommerce div.product div.images img {
    border: 2px solid #fbb444; /* آبی – قابل تغییر */
    border-radius: 8px;
    padding: 5px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
}

/* برای همه تامنیل‌ها یک حالت مرزی پیش‌فرض */
.woocommerce div.product div.images .flex-control-thumbs li img {
    border: 2px solid #ddd;
    border-radius: 5px;
    padding: 2px;
    transition: all 0.3s ease;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    margin: 5px;
}

/* وقتی تامنیل فعال (انتخاب‌شده) هست */
.woocommerce div.product div.images .flex-control-thumbs li img.flex-active {
    border: 2px solid #fbb444; /* رنگ آبی - قابل تغییر */
    box-shadow: 0 0 8px rgb(255 194 2 / 16%);
    transform: scale(1.05);
    margin: 5px;
}

/* موقع هاور هم زیباتر بشه */
.woocommerce div.product div.images .flex-control-thumbs li img:hover {
    border-color: #fbb444;
    box-shadow: 0 0 6px rgb(255 194 2 / 16%);
    cursor: pointer;
    margin: 5px;
}

/* آیکون زوم یا پاپ‌آپ بالای تصویر */
.woocommerce div.product div.images .woocommerce-product-gallery__trigger {
    border: 1px solid #fbb444;
    border-radius: 50%;
    padding: 0;
    background-color: #fff;
    box-shadow: 0 2px 8px rgb(255 194 2 / 16%);
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin: 5px;
}

/* افکت هاور روی آیکون */
.woocommerce div.product div.images .woocommerce-product-gallery__trigger:hover {
    border-color: #fbb444;
    box-shadow: 0 0 10px rgb(255 194 2 / 16%);
    transform: scale(1.05);
    cursor: pointer;
}

