/**
 * DP CSS Fixes - Global Styles
 *
 * 全站通用樣式，載入於所有前台頁面。
 * 包含：Icon 對齊、分頁導航、觸控滾動修復。
 *
 * @package DP_CSS_Fixes
 * @since 2.0.0
 */

/* ============================================
 * 分頁導航樣式
 * 設定當前頁面的樣式
 * ============================================ */
.dp-page-link.dp-page-active {
    background: #6a6b6e;
    border-color: #6a6b6e;
    color: #fff;
}

/* ============================================
 * WooCommerce 標題樣式
 * 統一所有 WooCommerce 區域的 h2 標題大小
 * ============================================ */
.woocommerce h2,
.woocommerce-page h2,
.woocommerce-cart h2,
.woocommerce-checkout h2 {
    font-size: 20px;
}

/* ============================================
 * 電腦版購物車圖標對齊修復
 * ============================================ */
.logged-in .ast-header-woo-cart .ast-site-header-cart .ast-addon-cart-wrap {
    margin-top: -2px !important;
}

/* Safari 電腦版 - 購物袋圖標大小 */
html.is-safari .ast-icon-shopping-bag .ast-icon svg {
    height: 14px !important;
    width: 14px !important;
    display: inline-block !important;
    margin-bottom: 0px !important;
}

@media (max-width: 768px) {
    /* Chrome 手機版登入後 */
    .logged-in .ast-header-woo-cart .ast-site-header-cart .ast-addon-cart-wrap {
        margin-top: 2px !important;
    }

    /* Safari iOS 手機版登入後 */
    html.is-safari .logged-in .ast-header-woo-cart .ast-site-header-cart .ast-addon-cart-wrap {
        margin-top: 0px !important;
    }

    /* Chrome 手機版 - 帳戶與購物袋圖標大小 */
    html.is-chrome .ast-header-account-wrap .ast-header-account-type-icon .ahfb-svg-iconset svg,
    html.is-chrome .ast-icon-shopping-bag .ast-icon svg {
        height: 18px !important;
        width: 18px !important;
        display: inline-block !important;
    }
}

/* ============================================
 * 手機版購物車圖標大小與對齊修復
 * ============================================ */
@media (max-width: 768px) {
    .ast-header-woo-cart .astra-icon {
        display: inline-flex !important;
        align-items: center !important;
    }

    body:not(.logged-in) .ast-header-woo-cart .astra-icon {
        font-size: 18px !important;
    }

    body:not(.logged-in) .ast-header-woo-cart .ast-icon svg {
        width: 18px !important;
        height: 18px !important;
    }

    html.is-safari body:not(.logged-in) .ast-header-woo-cart .astra-icon {
        font-size: 14px !important;
    }

    html.is-safari body:not(.logged-in) .ast-header-woo-cart .ast-icon svg {
        width: 14px !important;
        height: 14px !important;
    }

    html.is-safari body.logged-in .ast-header-woo-cart .astra-icon {
        font-size: 14px !important;
    }

    html.is-safari body.logged-in .ast-header-woo-cart .ast-icon svg {
        width: 14px !important;
        height: 14px !important;
    }

    .woocommerce .ast-header-woo-cart .ast-site-header-cart .ast-addon-cart-wrap,
    .ast-header-woo-cart .ast-site-header-cart .ast-addon-cart-wrap {
        margin-top: 1px !important;
    }

    .ast-header-woo-cart .ast-site-header-cart-data:empty {
        display: none !important;
    }
}

/* ============================================
 * 手機版觸控滾動修復
 * 確保 sticky header 和相關元素不會阻擋垂直滾動
 * ============================================ */
#ast-fixed-header,
#ast-fixed-header *,
.ast-sticky-active,
.ast-sticky-shrunk,
#masthead,
.site-header {
    touch-action: pan-y pinch-zoom !important;
}

/* ============================================
 * Revolution Slider 7 (SR7) 觸控滾動修復
 * 允許在 SR7 區域垂直滾動頁面
 * ============================================ */
.wp-block-themepunch-revslider,
.rs-fullwidth-wrap,
.rev_slider,
.rev_slider *,
sr7-module,
sr7-module *,
sr7-mask,
sr7-slide,
sr7-sbg,
sr7-layer,
sr7-row,
sr7-col,
sr7-grp,
sr7-txt,
sr7-loop {
    touch-action: pan-y pinch-zoom !important;
}
