/*
 Theme Name:   Storefront Child for BugDorm
 Theme URI:    https://shop.bugdorm.com/
 Description:  Custom theme for BugDorm Store based on Storefront
 Author:       Gemini, 紀凱傑
 Author URI:   https://shop.bugdorm.com/
 Template:     storefront
 Version:      1.0.2
 Text Domain:  bugdorm-theme
*/

/* 在這裡可以寫你專屬的 Bootstrap 或客製化 CSS */

/* ==========================================================
   1. 修正導覽列排版 (讓 My account, Cart, Checkout 靠最右)
   ========================================================== */
@media (min-width: 768px) {
    /* 解除原本的 float 限制，強制靠右 */
    .site-header .site-secondary-navigation {
        float: right !important;
        width: auto !important;
        margin-right: 0 !important;
        clear: right !important;
    }
    
    /* 讓選單項目向右對齊，並保持適當間距 */
    .site-header .site-secondary-navigation ul.menu {
        display: flex !important;
        justify-content: flex-end !important;
        gap: 20px; 
    }
}

/* ==========================================================
   2. 綠色大搜尋框視覺樣式 (全站通用版)
   ========================================================== */
/* .bugdorm-hero-search-container {
    background-color: #f8f9fa; 
    padding: 35px 20px; 
    text-align: center;
    border-radius: 8px;
    margin-bottom: 40px;
    width: 100%;
} */

.bugdorm-hero-search-container .hero-search-title {
    font-size: 1.8rem;
    color: #212529;
    margin-bottom: 20px;
    font-weight: 700;
}

/* 限制搜尋框的最大寬度並置中 */
.hero-search-box-wrapper {
    max-width: 100%;
    margin: 0 auto;
}

/* 覆寫 WooCommerce 預設搜尋表單為綠色風格 */
.hero-search-box-wrapper .woocommerce-product-search {
    display: flex;
    width: 100%;
    border: 1px solid #2e7d32;
    border-radius: 6px;
    overflow: hidden;
    background: #ffffff;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
    margin-top: 5px;
    margin-bottom: 5px;
}

/* 輸入框設計 */
.hero-search-box-wrapper .woocommerce-product-search input[type="search"] {
    flex: 1;
    padding: 10px 15px !important;
    font-size: 1rem !important;
    border: none !important;
    outline: none !important;
    background: transparent !important;
    color: #495057;
}

/* 綠色搜尋按鈕設計 */
.hero-search-box-wrapper .woocommerce-product-search button[type="submit"] {
    background-color: #2e7d32 !important;
    color: #ffffff !important;
    padding: 0 40px !important;
    font-size: 1.1rem !important;
    font-weight: bold;
    border: none !important;
    border-radius: 0 !important;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.hero-search-box-wrapper .woocommerce-product-search button[type="submit"]:hover {
    background-color: #1b5e20 !important;
}

.page-template-template-homepage .type-page {
    padding-top: 0.2em !important;
}

.page-template-template-homepage:not(.has-post-thumbnail) .site-main{
    padding-top: 0em !important;
}

.storefront-secondary-navigation.woocommerce-active .site-header .secondary-navigation{
    width: 70% !important;
    float: right !important;
    margin-right: 0% !important;
}

.woocommerce-breadcrumb{
    font-size: 1em !important;
}

.secondary-navigation ul.menu a {
    color: #404040;
    font-size: 1rem;
}

.home.blog .site-header, .home.page:not(.page-template-template-homepage) .site-header, .home.post-type-archive-product .site-header{
    margin-bottom: 0 !important;
}

h1.page-title {
    color:#7ba43d !important;
    font-weight: 600 !important;
}

.woocommerce-products-header {
    text-align: left !important;
}

.storefront-breadcrumb {
    margin: 0 0 0.3em !important;
}

.woocommerce-products-header {
    padding: 0 0 1em !important;
}

.stock.in-stock::before{
    content: none !important;
}

.stock.in-stock {
    padding: 2px 8px ;
    border-radius: 5px;
    border: 1px solid #7ba43d;
    display: inline-block;
}


.stock.out-of-stock::before{
    content: none !important;
}

.stock.out-of-stock {
    padding: 2px 8px ;
    border-radius: 5px;
    border: 1px solid #e2401c;
    display: inline-block;
}

.single-product div.product .product_meta {
    font-size: 1.2em !important;
}

span.sku {
    color:#ffffff;
    background-color: #7ba43d !important;
    padding: 2px 4px ;
    border-radius: 5px;
}

.woocommerce-breadcrumb,.woocommerce-breadcrumb a, a.woocommerce-review-link, .product_meta a {
    color: saddlebrown;
}

li.product-category > a {
    display: inline-block; /* 或 display: block; */
    transition: all 0.3s ease; /* 讓懸停動畫有平滑的過渡效果 */
}

li.product-category > a:hover {
    border: 1px solid #747474;
    transform: translateY(-10px) !important;
    box-shadow: 0 15px 20px rgba(0, 0, 0, 0.2) !important;
}

button, input[type="button"], input[type="reset"], input[type="submit"], .button, .widget a.button{
    background-color: #2e7d32;
    color: #ffffff;
    border-color: #2e7d32;
}

button:hover, input[type="button"]:hover, input[type="reset"]:hover, input[type="submit"]:hover, .button:hover, .widget a.button:hover{
    background-color: #156419;
    color: #ffffff;
    border-color: #156419;
}

/* 隱藏 Storefront / WooCommerce mini-cart 中的數量與價格計算 */
.site-header-cart .widget_shopping_cart .cart_list li .quantity {
    display: none !important;
}

/* 隱藏 WooCommerce mini-cart 原生的 Subtotal 小計區塊 */
.site-header-cart .widget_shopping_cart .woocommerce-mini-cart__total {
    display: none !important;
}

/* 調整按鈕與上方折扣區塊的間距，讓視覺更緊湊平衡 */
.site-header-cart .widget_shopping_cart .woocommerce-mini-cart__buttons {
    padding-top: 15px;
}


/**
 * 覆寫 Storefront 商品頁籤為橫向排列
 */
@media (min-width: 768px) {
    /* 1. 將原本左側 29% 寬度的頁籤清單改為 100% 通欄 */
    .single-product div.product .woocommerce-tabs ul.tabs {
        width: 100% !important;
        float: none !important;
        border-right: none !important;
        border-bottom: 1px solid #d3ced2; /* 加上下邊框線 */
        margin-bottom: 20px;
        padding: 0;
        display: flex; /* 使用原生 Flex 讓列表橫排 */
        flex-wrap: wrap;
    }

    /* 2. 讓每一個頁籤項目水平橫列 */
    .single-product div.product .woocommerce-tabs ul.tabs li {
        float: none !important;
        display: inline-block;
        margin-right: 10px;
        border: 1px solid #d3ced2;
        border-bottom: none; /* 隱藏下邊框以利與外層對接 */
        border-radius: 4px 4px 0 0;
        background-color: #f8f8f8;
    }

    .single-product div.product .woocommerce-tabs ul.tabs li a {
        padding: 10px 20px !important;
        display: block;
    }

    /* 當前選中的頁籤樣式優化 */
    .single-product div.product .woocommerce-tabs ul.tabs li.active {
        background-color: #ffffff;
        position: relative;
        z-index: 2;
        border-bottom: 1px solid #ffffff;
        margin-bottom: -1px;
    }

    /* 3. 將原本右側 68% 寬度的內容區塊改為 100% 通欄 */
    .single-product div.product .woocommerce-tabs .panel {
        width: 100% !important;
        float: none !important;
        clear: both;
        padding: 20px 0;
    }
    .woocommerce-tabs ul.tabs li::after {
        content: ""!important;
    }
}


/* ==========================================================
   全站右下角浮動 Contact Us 按鈕樣式
   ========================================================== */
.floating-contact-btn {
    position: fixed;
    right: 25px;
    bottom: 25px;
    z-index: 9999;
    background-color: #2e7d32;
    color: #ffffff !important;
    padding: 12px 24px;
    border-radius: 50px;
    font-weight: bold;
    text-decoration: none !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
}

.floating-contact-btn:hover,
.floating-contact-btn:focus {
    background-color: #1b5e20;
    color: #ffffff !important;
    transform: translateY(-3px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3);
}

/* 手機版避開 Storefront 底部導覽列 */
@media (max-width: 767px) {
    .floating-contact-btn {
        bottom: 80px;
        right: 15px;
        padding: 10px 18px;
        font-size: 0.9rem;
    }
}

/* ==========================================================
   4. WooCommerce My Account 橫向底線滑動頁籤 (Modern Underline Tabs)
   ========================================================== */
/* 解除 Storefront 原生側邊欄浮動與寬度限制，改為 100% 通欄排列 */
.woocommerce-account .woocommerce-MyAccount-navigation,
.woocommerce-account .woocommerce-MyAccount-content,
.woocommerce-account.left-sidebar:not(.page-template-template-fullwidth-php) .woocommerce-MyAccount-navigation,
.woocommerce-account.left-sidebar:not(.page-template-template-fullwidth-php) .woocommerce-MyAccount-content,
.woocommerce-account.page-template-template-fullwidth-php .woocommerce-MyAccount-navigation,
.woocommerce-account.page-template-template-fullwidth-php .woocommerce-MyAccount-content {
    width: 100% !important;
    float: none !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    clear: both !important;
}

/* 導覽列外層間距 */
.woocommerce-account .woocommerce-MyAccount-navigation {
    margin-bottom: 2.2em !important;
}

/* 頁籤列表 ul：橫向單行、支援滑動、淺灰滑軌底線 */
.woocommerce-account .hentry .entry-content .woocommerce-MyAccount-navigation ul,
.woocommerce-account .woocommerce-MyAccount-navigation ul {
    display: flex !important;
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
    margin: 0 !important;
    padding: 0 !important;
    list-style: none !important;
    border-top: none !important;
    border-bottom: 2px solid #e5e7eb !important;
    gap: 4px;
    -ms-overflow-style: none; /* IE / Edge 隱藏滾動條 */
    scrollbar-width: none; /* Firefox 隱藏滾動條 */
}

/* 隱藏 Chrome / Safari / Edge 滾動條以維持視覺乾淨 */
.woocommerce-account .woocommerce-MyAccount-navigation ul::-webkit-scrollbar {
    display: none;
}

/* 頁籤項目 li */
.woocommerce-account .hentry .entry-content .woocommerce-MyAccount-navigation ul li,
.woocommerce-account .woocommerce-MyAccount-navigation ul li {
    list-style: none !important;
    border: none !important;
    margin: 0 !important;
    padding: 0 !important;
    flex-shrink: 0 !important;
}

/* 頁籤連結 a：字體樣式與 3px 透明底線（預備滑動與懸停） */
.woocommerce-account .woocommerce-MyAccount-navigation ul li a,
.woocommerce-account .hentry .entry-content .woocommerce-MyAccount-navigation ul li.woocommerce-MyAccount-navigation-link a {
    display: block !important;
    padding: 12px 22px !important;
    font-size: 1rem !important;
    font-weight: 600 !important;
    color: #4b5563 !important;
    text-decoration: none !important;
    border-bottom: 3px solid transparent !important;
    margin-bottom: -2px !important; /* 精準對齊 ul 底部 2px 灰線 */
    transition: all 0.25s ease-in-out !important;
    white-space: nowrap !important;
    border-radius: 4px 4px 0 0;
}

/* 懸停效果 (Hover) */
.woocommerce-account .woocommerce-MyAccount-navigation ul li a:hover,
.woocommerce-account .hentry .entry-content .woocommerce-MyAccount-navigation ul li.woocommerce-MyAccount-navigation-link a:hover {
    color: #2e7d32 !important;
    border-bottom-color: rgba(46, 125, 50, 0.4) !important;
    background-color: rgba(46, 125, 50, 0.04) !important;
}

/* 當前選中頁籤 (Active Tab)：品牌綠底線與高亮 */
.woocommerce-account .woocommerce-MyAccount-navigation ul li.is-active a,
.woocommerce-account .hentry .entry-content .woocommerce-MyAccount-navigation ul li.woocommerce-MyAccount-navigation-link.is-active a {
    color: #2e7d32 !important;
    font-weight: 700 !important;
    border-bottom-color: #2e7d32 !important;
    background-color: transparent !important;
}

/* 登出項目特殊懸停效果 (Log out) */
.woocommerce-account .woocommerce-MyAccount-navigation ul li.woocommerce-MyAccount-navigation-link--customer-logout a:hover {
    color: #dc2626 !important;
    border-bottom-color: #dc2626 !important;
    background-color: rgba(220, 38, 38, 0.04) !important;
}

/* 會員中心表單與內容區排版優化 */
.woocommerce-account .woocommerce-MyAccount-content {
    padding-top: 5px;
}

@media (min-width: 768px) {
    .woocommerce-account .woocommerce-MyAccount-content .form-row-first {
        width: 48% !important;
        float: left !important;
        margin-right: 4% !important;
    }
    .woocommerce-account .woocommerce-MyAccount-content .form-row-last {
        width: 48% !important;
        float: right !important;
        margin-right: 0 !important;
    }
}
