/* ============================================
   レスポンシブ対応スタイル
   PC表示は現在のままで、スマートフォン用の表示を実装
   ============================================ */

/* ============================================
   共通スタイル（モバイル）
   ============================================ */
@media (max-width: 768px) {
    /* ページトップボタン（スマホ - 768px以下） */
    .ec-blockTopBtn {
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
    }
    
    /* Font Awesomeアイコンを中央に配置 */
    .ec-blockTopBtn i {
        display: block !important;
        color: #FFFFFF !important;
        font-size: 20px !important;
        line-height: 1 !important;
        margin: 0 !important;
        padding: 0 !important;
        align-self: center !important;
    }
    
    /* コンテナのパディング調整 */
    .max-width-1200 {
        padding: 0 15px;
    }

    .max-800 {
        padding: 0 15px;
    }

    /* ファーストビュー */
    .main_first_view {
        width: 100%;
        margin: 0 auto;
        padding: 0;
        box-sizing: border-box;
        margin-top: 0;
        overflow: hidden;
    }

    .main_first_view_image {
        width: 110%;
        max-width: none;
        height: auto;
        display: block;
        margin: 0;
        margin-left: -5%;
    }

    /* メインタイトル */
    .main_title {
        font-size: 24px;
        margin: 30px 0;
        margin-top: 60px;
        font-weight: bold;
        line-height: 1.4;
    }

    /* 商品グリッド - モバイルでは1列表示 */
    .ec-shelfGrid {
        flex-direction: column;
        margin-left: 0 !important;
        margin-right: 0 !important;
    }

    .ec-shelfGrid .ec-shelfGrid__item {
        width: 100% !important;
        margin-bottom: 40px;
        padding-left: 0 !important;
        padding-right: 0 !important;
        display: flex;
        flex-direction: column;
    }

    .ec-shelfGrid .ec-shelfGrid__item:nth-child(odd),
    .ec-shelfGrid .ec-shelfGrid__item:nth-child(even) {
        padding-left: 0 !important;
        padding-right: 0 !important;
    }

    .ec-shelfGrid__item-image {
        width: 100%;
        text-align: center;
    }

    .ec-shelfGrid__item-image img {
        width: 85%;
        max-width: 300px;
        height: auto;
        object-fit: contain;
        margin: 0 auto;
        display: block;
    }

    .product_item_title {
        font-size: 18px;
        height: auto;
        min-height: 40px;
        margin-top: 10px;
        padding: 0 10px;
        font-weight: 700;
        line-height: 1.4;
    }

    .product_item_price {
        font-size: 18px;
        margin-top: 8px;
        padding: 0 10px;
        font-weight: 700;
        line-height: 1.4;
    }

    /* もっと見るボタン - 画面の中央に配置 */
    .main_button {
        width: 100%;
        max-width: 300px;
        padding: 12px 20px;
        font-size: 14px;
        margin: 15px auto 0;
        display: block;
        text-align: center;
    }
    
    /* もっと見るボタンのコンテナを中央寄せ */
    .text-center {
        text-align: center !important;
        display: flex;
        justify-content: center;
        align-items: center;
        width: 100%;
    }

    /* ご利用の流れ */
    .main_flow {
        padding: 30px 15px;
        margin: 30px 0;
    }

    .main_flow_wrapper {
        flex-direction: column;
        gap: 20px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .main_flow_item_image {
        width: 85% !important;
        max-width: 450px;
        margin: 0 auto;
        display: block;
    }

    /* FAQセクション */
    .accordion-button {
        font-size: 14px !important;
        padding: 12px 15px;
        line-height: 1.5;
        font-weight: 500;
    }

    .accordion-body {
        font-size: 14px;
        padding: 15px;
        line-height: 1.6;
    }

    /* レイアウト調整 */
    .ec-layoutRole__main {
        padding: 0 15px;
    }

    /* フロントページのメインエリア - ファーストビューをヘッダーに近づける */
    .front_page .ec-layoutRole__main {
        padding-top: 0 !important;
    }
}

/* ============================================
   トップページ専用（モバイル）
   ============================================ */
@media (max-width: 768px) {
    /* product_list_1とproduct_list_2の両方にproduct_list_2のCSSを適用 */
    .product_list_1,
    .product_list_2 {
        margin-bottom: 40px;
    }
    
    /* 両方のセクションに統一されたスタイルを適用 */
    .product_list_1 .ec-shelfGrid,
    .product_list_2 .ec-shelfGrid {
        flex-direction: column;
        margin-left: 0 !important;
        margin-right: 0 !important;
    }
    
    .product_list_1 .ec-shelfGrid .ec-shelfGrid__item,
    .product_list_2 .ec-shelfGrid .ec-shelfGrid__item {
        width: 100% !important;
        margin-bottom: 40px;
        padding-left: 0 !important;
        padding-right: 0 !important;
        display: flex;
        flex-direction: column;
    }
    
    .product_list_1 .ec-shelfGrid__item-image,
    .product_list_2 .ec-shelfGrid__item-image {
        width: 100%;
        text-align: center;
    }
    
    .product_list_1 .ec-shelfGrid__item-image img,
    .product_list_2 .ec-shelfGrid__item-image img {
        width: 85%;
        max-width: 300px;
        height: auto;
        object-fit: contain;
        margin: 0 auto;
        display: block;
    }
    
    .product_list_1 .product_item_title,
    .product_list_2 .product_item_title {
        font-size: 18px;
        height: auto;
        min-height: 40px;
        margin-top: 10px;
        padding: 0 10px;
        font-weight: 700;
        line-height: 1.4;
    }
    
    .product_list_1 .product_item_price,
    .product_list_2 .product_item_price {
        font-size: 18px;
        margin-top: 8px;
        padding: 0 10px;
        font-weight: 700;
        line-height: 1.4;
    }
}

/* ============================================
   商品一覧ページ（モバイル）
   ============================================ */
@media (max-width: 768px) {
    .ec-searchnavRole {
        padding: 0 15px;
    }

    /* 検索ボックス */
    .search_box {
        flex-direction: column;
        gap: 15px;
        padding-bottom: 20px;
    }

    .search_box_left,
    .search_box_right {
        width: 100%;
        flex-direction: column;
    }

    .search_input {
        width: 100% !important;
        margin-right: 0 !important;
        margin-bottom: 10px;
    }

    .search_button,
    .search_clear_button {
        width: 100% !important;
        margin-right: 0 !important;
        margin-bottom: 10px;
    }

    /* 商品グリッド - モバイルでは1列 */
    .ec-searchnavRole .ec-shelfGrid {
        margin-left: 0;
        margin-right: 0;
    }

    .ec-searchnavRole .ec-shelfGrid .ec-shelfGrid__item {
        width: 100% !important;
        padding: 0 !important;
        margin-bottom: 30px;
    }

    .ec-searchnavRole .ec-shelfGrid .ec-shelfGrid__item:nth-child(odd),
    .ec-searchnavRole .ec-shelfGrid .ec-shelfGrid__item:nth-child(even) {
        padding: 0 !important;
    }

    /* ページネーション */
    .ec-pagerRole {
        padding: 0 15px;
    }

    .ec-pager {
        flex-wrap: wrap;
        justify-content: center;
    }

    .ec-pager__item {
        margin: 5px;
    }
}

/* ============================================
   商品詳細ページ（モバイル）
   ============================================ */
@media (max-width: 768px) {
    .ec-productRole {
        margin-top: 80px !important;
    }

    .ec-grid2 {
        flex-direction: column;
        gap: 20px;
    }

    .ec-grid2__cell {
        width: 100% !important;
    }

    /* 商品画像スライダー */
    .ec-sliderItemRole {
        margin-bottom: 20px;
    }

    .slide-item img {
        max-height: 300px;
        height: auto;
    }

    .ec-sliderItemRole .slideThumb {
        width: calc(25% - 7.5px);
    }

    /* 商品情報 */
    .product-name {
        font-size: 20px;
        margin-bottom: 15px;
        font-weight: bold;
        line-height: 1.4;
    }

    .product-price-value {
        font-size: 28px;
        font-weight: bold;
        line-height: 1.4;
    }

    .product-code,
    .product-free-area,
    .product-description {
        font-size: 14px;
        margin-bottom: 20px;
        line-height: 1.6;
    }

    /* 数量選択 */
    .quantity-controls {
        flex-direction: row;
        align-items: center;
        gap: 15px;
        flex-wrap: wrap;
    }

    .quantity-label {
        font-size: 18px;
        margin-right: 10px;
        white-space: nowrap;
    }

    .quantity-accordion {
        width: auto;
        max-width: 200px;
        min-width: 120px;
    }

    .quantity-accordion-header {
        padding: 10px 12px;
    }

    .quantity-display {
        font-size: 14px;
    }

    .product-stock-status {
        font-size: 18px;
        margin-top: 10px;
    }

    /* カートに入れるボタン */
    .add-cart {
        font-size: 18px;
        height: 50px;
    }
}

/* ============================================
   カートページ（モバイル）
   ============================================ */
@media (max-width: 768px) {
    .ec-cartRole {
        padding: 0 15px;
    }

    .ec-cartRole__progress {
        margin-bottom: 20px;
    }

    .ec-cartRole__totalText {
        font-size: 16px;
        padding: 15px 0;
        line-height: 1.5;
    }

    .ec-cartRole__actions {
        width: 100% !important;
        margin-right: 0 !important;
        text-align: center;
    }

    .ec-cartRole__total {
        font-size: 18px;
        padding: 15px 0 20px;
        text-align: center;
    }

    .ec-cartRole__totalAmount {
        font-size: 20px;
        margin-left: 10px;
    }

    /* カートテーブル */
    .ec-cartRole__cart {
        margin: 0;
        width: 100%;
    }

    .ec-cartTable {
        display: block;
        border-top: none;
    }

    .ec-cartHeader {
        display: none;
    }

    .ec-cartRow {
        display: block;
        border-bottom: 1px solid #ddd;
        padding: 15px 0;
        margin-bottom: 15px;
        width: 100%;
    }

    .ec-cartRow__delColumn {
        display: block;
        text-align: right;
        margin-bottom: 10px;
        width: 100%;
        border-bottom: none;
    }

    .ec-cartRow__contentColumn {
        display: block;
        padding: 0;
        width: 100%;
        border-bottom: none;
    }

    .ec-cartRow__img {
        width: 100%;
        text-align: center;
        margin-bottom: 10px;
        display: block;
    }

    .ec-cartRow__img img {
        max-width: 150px;
        height: auto;
    }

    .ec-cartRow__summary {
        width: 100%;
        padding: 0;
        margin-left: 0;
        display: block;
    }

    .ec-cartRow__name {
        font-size: 14px;
        margin-bottom: 8px;
        line-height: 1.5;
        font-weight: 500;
    }

    .ec-cartRow__name a {
        font-size: 14px;
        line-height: 1.5;
    }

    .ec-cartRow__unitPrice {
        font-size: 14px;
        margin-bottom: 8px;
        line-height: 1.5;
    }

    .ec-cartRow__sutbtotalSP {
        display: block;
        font-size: 16px;
        font-weight: bold;
        margin-top: 8px;
    }

    .ec-cartRow__amountColumn {
        display: block;
        text-align: center;
        margin: 10px 0;
        width: 100%;
        border-bottom: none;
    }

    .ec-cartRow__amount {
        display: block;
        font-size: 16px;
        margin-bottom: 5px;
    }

    .ec-cartRow__amountSP {
        display: none;
    }

    .ec-cartRow__subtotalColumn {
        display: block;
        text-align: center;
        margin-top: 10px;
        width: 100%;
        border-bottom: none;
    }

    .ec-cartRow__sutbtotal {
        font-size: 18px;
        font-weight: bold;
    }

    /* ボタン */
    .ec-blockBtn--action,
    .ec-blockBtn--cancel {
        width: 100% !important;
        margin-bottom: 15px;
        font-size: 16px !important;
        padding: 15px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        line-height: normal !important;
        vertical-align: middle !important;
        text-align: center !important;
        min-height: 50px !important;
        height: auto !important;
        box-sizing: border-box !important;
    }

    .ec-blockBtn--action *,
    .ec-blockBtn--cancel * {
        vertical-align: middle;
    }

    /* Amazon Payボタン */
    .amazon-pay-button-wrapper {
        width: 100%;
        margin-top: 15px;
    }

    #AmazonPayButton {
        width: 100%;
        max-width: 100%;
    }
}

/* ============================================
   ヘッダー（モバイル強化）
   ============================================ */
@media (max-width: 768px) {
    .header__ {
        flex-wrap: nowrap;
        padding: 5px 10px;
        align-items: center;
        min-height: 60px;
    }

    .header__logo {
        flex: 0 0 auto;
        margin-right: 10px;
    }

    .header__logo-link {
        width: 120px !important;
        height: 28px !important;
        margin: 0 !important;
        background-size: contain;
    }

    .header__menu {
        flex: 1 1 auto;
        display: flex;
        justify-content: flex-end;
        gap: 5px;
    }

    .header__menu-item {
        width: 45px !important;
        height: 45px !important;
        min-width: 45px;
        padding: 0;
        margin: 0;
        border-left: none !important;
    }

    .header__menu-item-mypage {
        border: 1px solid #D9D9D9 !important;
        border-radius: 4px;
    }

    .header__menu-item-icon,
    .icon_header_svg {
        width: 20px !important;
        height: 20px !important;
        font-size: 20px;
    }

    .header__menu-item-text {
        display: none !important;
    }

    .header__cart-badge {
        top: 2px !important;
        right: 2px !important;
        width: 14px !important;
        height: 14px !important;
        font-size: 9px !important;
        min-width: 14px !important;
        line-height: 14px;
    }
}

/* ============================================
   フッター（モバイル強化）
   ============================================ */
@media (max-width: 768px) {
    .ec-footerRole {
        padding: 30px 15px 20px;
    }

    .ec-footerRole__inner {
        max-width: 100%;
    }

    .ec-footerNavi {
        flex-direction: column;
        gap: 12px;
        padding: 0;
        margin: 0;
        list-style: none;
    }

    .ec-footerNavi__link {
        text-align: center;
        padding: 0;
        margin: 0;
    }

    .ec-footerNavi__link a {
        font-size: 14px;
        color: #ffffff;
        text-decoration: none;
        display: block;
        padding: 8px 0;
    }

    .ec-footerNavi__link a:hover {
        opacity: 0.8;
    }

    .ec-footerTitle {
        padding: 20px 0 10px;
        text-align: center;
        margin-top: 10px;
    }

    .ec-footerTitle__copyright {
        font-size: 12px;
        color: #ffffff;
    }
}

/* ============================================
   その他のページ（モバイル）
   ============================================ */
@media (max-width: 768px) {
    /* About Us, Legal, Terms of Service, Privacy Policy */
    .ec-aboutUs {
        padding: 40px 15px 60px;
    }

    .page-title {
        font-size: 20px;
        margin-bottom: 40px;
        font-weight: bold;
        line-height: 1.4;
    }

    /* ページコンテンツのテキスト */
    .ec-pageHeader h1 {
        font-size: 20px;
        font-weight: bold;
        line-height: 1.4;
    }

    .ec-pageHeader {
        margin-bottom: 30px;
    }
}

/* ============================================
   小さいスマートフォン（480px以下）
   ============================================ */
@media (max-width: 480px) {
    .main_title {
        font-size: 22px;
        margin: 20px 0;
        margin-top: 40px;
        font-weight: bold;
        line-height: 1.4;
    }

    .product_item_title {
        font-size: 16px;
        line-height: 1.4;
    }

    /* 商品画像 - 小さいスマホ */
    .ec-shelfGrid__item-image img {
        width: 80%;
        max-width: 280px;
    }

    /* ご利用の流れ - 小さいスマホ */
    .main_flow_item_image {
        width: 80% !important;
        max-width: 400px;
    }

    .product_item_price {
        font-size: 16px;
        line-height: 1.4;
    }

    .main_button {
        font-size: 13px;
        padding: 10px 15px;
        height: 45px;
        line-height: 1.5;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .search_input,
    .search_button,
    .search_clear_button {
        font-size: 14px;
        height: 40px;
        line-height: 1.5;
    }

    .ec-cartRole__total {
        font-size: 16px;
        line-height: 1.5;
    }

    .ec-cartRole__totalAmount {
        font-size: 18px;
        line-height: 1.5;
    }

    /* ヘッダー - さらに小さな画面 */
    .header__ {
        padding: 5px;
    }

    .header__logo-link {
        width: 100px !important;
        height: 24px !important;
    }

    .header__menu-item {
        width: 40px !important;
        height: 40px !important;
        min-width: 40px;
    }

    .header__menu-item-icon,
    .icon_header_svg {
        width: 18px !important;
        height: 18px !important;
        font-size: 18px;
    }

    /* フッター - さらに小さな画面 */
    .ec-footerNavi__link a {
        font-size: 13px;
    }

    .ec-footerTitle__copyright {
        font-size: 11px;
    }

    /* カートページのボタン */
    .ec-blockBtn--action,
    .ec-blockBtn--cancel {
        font-size: 15px;
        padding: 12px;
        min-height: 45px;
    }
    
    /* ページトップボタン（スマホ） */
    .ec-blockTopBtn {
        width: 50px;
        height: 50px;
        right: 15px;
        bottom: 15px;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
    }
    
    /* Font Awesomeアイコンを中央に配置 */
    .ec-blockTopBtn i {
        display: block !important;
        color: #FFFFFF !important;
        font-size: 20px !important;
        line-height: 1 !important;
        margin: 0 !important;
        padding: 0 !important;
        align-self: center !important;
    }
    
    .ec-blockTopBtn::before {
        border-left: 10px solid transparent;
        border-right: 10px solid transparent;
        border-bottom: 14px solid #FFFFFF;
    }
}

