/* =============================================================================
   配送予約ページ専用スタイル (delivery.html)
   ============================================================================= */

body {
    background: linear-gradient(160deg, #f1f8e9 0%, #e8f5e8 100%);
}

/* --- ヒーロー --- */
.b2-hero {
    background: var(--color-primary-800, #2d5a3d);
    color: #fff;
    padding: 2.5rem 1.5rem 2rem;
    text-align: center;
    margin-top: var(--header-height, 80px);
}

@media (max-width: 1023px) {
    .b2-hero {
        margin-top: var(--header-height, 70px);
    }
}

.b2-hero h1 {
    font-size: clamp(1.4rem, 4vw, 2rem);
    font-weight: 700;
    margin-bottom: .5rem;
}

.b2-hero .hero-sub {
    font-size: .9rem;
    opacity: .85;
    margin-bottom: 1.25rem;
}

.hero-steps {
    display: flex;
    justify-content: center;
    gap: .5rem 1.5rem;
    flex-wrap: wrap;
    font-size: .82rem;
    opacity: .9;
}

.hero-steps span {
    display: flex;
    align-items: center;
    gap: .4rem;
}

.hero-steps span::before {
    content: attr(data-n);
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #a5d6a7;
    color: #1b5e20;
    font-weight: 700;
    font-size: .75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

/* --- フォーム（display:contents でグリッドに対して透過） --- */
#delivery-form {
    display: contents;
}

/* --- メインレイアウト --- */
.b2-layout {
    max-width: 1100px;
    margin: 0 auto;
    padding: 2rem 1rem 4rem;
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 1.75rem;
    align-items: start;
}

/* --- フォームカード --- */
.b2-form-card {
    background: #fff;
    border-radius: 20px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, .10);
    overflow: hidden;
}

/* --- ステップヘッダー --- */
.step-hd {
    background: linear-gradient(90deg, #2d5a3d 0%, #388e3c 100%);
    color: #fff;
    padding: .9rem 1.5rem;
    display: flex;
    align-items: center;
    gap: .75rem;
}

.step-hd__num {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .22);
    border: 2px solid rgba(255, 255, 255, .55);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .78rem;
    font-weight: 700;
    flex-shrink: 0;
}

.step-hd__title {
    font-size: .95rem;
    font-weight: 700;
    letter-spacing: .03em;
}

/* --- ステップ本体 --- */
.step-bd {
    padding: 1.4rem 1.5rem;
    border-bottom: 1px solid #f5f5f5;
}

/* --- フィールド --- */
.field {
    margin-bottom: 1rem;
}

.field:last-child {
    margin-bottom: 0;
}

.field label {
    display: block;
    font-size: .875rem;
    font-weight: 600;
    color: #616161;
    margin-bottom: .4rem;
}

.field label .req {
    background: #f44336;
    color: #fff;
    font-size: .68rem;
    padding: .05rem .35rem;
    border-radius: .25rem;
    margin-left: .3rem;
    vertical-align: middle;
}

.field input,
.field select,
.field textarea {
    width: 100%;
    padding: .7rem .9rem;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-family: inherit;
    font-size: .95rem;
    color: #212121;
    background: #fff;
    transition: border-color .2s, box-shadow .2s;
}

.field input:focus, .field select:focus, .field textarea:focus {
    outline: none;
    border-color: #4caf50;
    box-shadow: 0 0 0 3px rgba(76, 175, 80, .12);
}

.field input[readonly] {
    background: #fafafa;
    color: #9e9e9e;
}

.field .hint {
    font-size: .77rem;
    color: #9e9e9e;
    margin-top: .3rem;
}

.field-row2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

@media (max-width: 480px) {
    .field-row2 {
        grid-template-columns: 1fr;
    }
}

/* --- フォーム行レイアウト（booking.cssより移植） --- */
.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.25rem;
    margin-bottom: 1rem;
}

@media (max-width: 768px) {
    .form-row {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
}

/* --- 位置入力アイコン --- */
.loc-wrap {
    position: relative;
}

.loc-wrap input {
    padding-left: 2.4rem;
}

.loc-icon {
    position: absolute;
    left: .75rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: .95rem;
    pointer-events: none;
    z-index: 1;
    background: #fff;
    width: 1.5rem;
    height: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* --- PlaceAutocompleteElement 内部入力スタイル --- */
gmp-place-autocomplete {
    display: block;
    width: 100%;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    background: #fff;
    color-scheme: light;
}

gmp-place-autocomplete::part(input) {
    width: 100%;
    padding: .7rem .9rem .7rem 0;
    border: none;
    font-family: inherit;
    font-size: .95rem;
    color: #212121;
    background: #fff;
}

gmp-place-autocomplete::part(input):focus {
    outline: none;
}

gmp-place-autocomplete:focus-within {
    border-color: #4caf50;
    box-shadow: 0 0 0 3px rgba(76, 175, 80, .12);
}


/* Google Places Autocomplete ドロップダウン微調整 */
.pac-container {
    border-radius: 8px;
    box-shadow: 0 8px 16px rgba(0, 0, 0, .15);
    font-family: inherit;
    margin-top: 2px;
}

/* --- 荷物サイズ分類 --- */
.bag-size-group {
    display: flex;
    flex-direction: column;
    gap: .75rem;
}

.bag-size-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: .7rem .9rem;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    transition: border-color .2s;
}

.bag-size-row:hover {
    border-color: #4caf50;
}

.bag-size-info {
    display: flex;
    align-items: baseline;
    gap: .5rem;
    min-width: 0;
    flex: 1;
}

.bag-size-label {
    font-size: .95rem;
    font-weight: 700;
    color: #2d5a3d;
}

.bag-size-desc {
    font-size: .78rem;
    color: #9e9e9e;
}

/* --- 荷物カウンター --- */
.bag-ctr {
    display: flex;
    align-items: center;
    gap: .75rem;
}

.bag-ctr__btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid #e0e0e0;
    background: #fff;
    font-size: 1.2rem;
    font-weight: 700;
    color: #616161;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all .2s;
}

.bag-ctr__btn:hover {
    border-color: #4caf50;
    color: #4caf50;
    background: #f1f8e9;
}

.bag-ctr__val {
    font-size: 1.4rem;
    font-weight: 700;
    color: #2d5a3d;
    min-width: 2rem;
    text-align: center;
}

.bag-ctr__note {
    font-size: .78rem;
    color: #9e9e9e;
}

/* --- オプション --- */
.opt-section-label {
    font-size: .72rem;
    font-weight: 700;
    color: #9e9e9e;
    text-transform: uppercase;
    letter-spacing: .08em;
    margin: 1rem 0 .4rem;
}

.opt-list {
    display: flex;
    flex-direction: column;
    gap: .5rem;
}

.opt-item {
    display: flex;
    align-items: center;
    gap: .6rem;
    padding: .6rem .9rem;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    cursor: pointer;
    transition: border-color .2s, background .2s;
}

.opt-item:hover {
    border-color: #4caf50;
    background: #f1f8e9;
}

.opt-item input[type="checkbox"] {
    width: 17px;
    height: 17px;
    accent-color: #4caf50;
    flex-shrink: 0;
}

.opt-item .opt-lbl {
    font-size: .9rem;
    font-weight: 600;
    flex: 1;
}

.opt-item .opt-price {
    font-size: .8rem;
    color: #ff9800;
    font-weight: 700;
}

/* --- ラジオ --- */
.radio-list {
    display: flex;
    flex-direction: column;
    gap: .45rem;
    margin-top: .5rem;
}

.radio-item {
    display: flex;
    align-items: center;
    gap: .6rem;
    padding: .6rem .9rem;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    cursor: pointer;
    transition: border-color .2s;
}

.radio-item:hover {
    border-color: #4caf50;
}

.radio-item input[type="radio"] {
    width: 17px;
    height: 17px;
    accent-color: #4caf50;
    flex-shrink: 0;
}

.radio-item .r-lbl {
    font-size: .9rem;
    flex: 1;
}

.radio-item .r-price {
    font-size: .8rem;
    font-weight: 700;
    color: #ff9800;
}

.radio-item .r-inc {
    font-size: .8rem;
    font-weight: 700;
    color: #4caf50;
}

/* --- 別の日を追加 --- */
.add-day-wrap {
    padding: .9rem 1.5rem;
    border-bottom: 1px solid #f5f5f5;
}

.btn-add-day {
    width: 100%;
    padding: .6rem;
    border: 2px dashed #e0e0e0;
    border-radius: 10px;
    background: transparent;
    color: #9e9e9e;
    font-family: inherit;
    font-size: .875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all .2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .4rem;
}

.btn-add-day:hover {
    border-color: #4caf50;
    color: #4caf50;
    background: #f1f8e9;
}

/* --- フォームフッター --- */
.form-footer {
    padding: 1.5rem;
}

.disclaimer {
    font-size: .77rem;
    color: #9e9e9e;
    margin-bottom: 1.2rem;
    line-height: 1.7;
    list-style: none;
}

.disclaimer li {
    padding-left: .9rem;
    text-indent: -.9rem;
}

.disclaimer li::before {
    content: '※ ';
}

.btn-submit {
    width: 100%;
    padding: 1rem;
    background: #4caf50;
    color: #fff;
    border: none;
    border-radius: 9999px;
    font-family: inherit;
    font-size: 1.05rem;
    font-weight: 700;
    cursor: pointer;
    transition: all .2s;
    box-shadow: 0 4px 12px rgba(76, 175, 80, .35);
    letter-spacing: .03em;
}

.btn-submit:hover {
    background: #388e3c;
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(76, 175, 80, .4);
}

/* ============================================================
   右サイドパネル（PC: sticky）
============================================================ */
.price-panel {
    position: sticky;
    top: calc(var(--header-height, 80px) + 1rem);
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 8px 16px rgba(0, 0, 0, .15);
    overflow: hidden;
}

.price-panel__hd {
    background: linear-gradient(135deg, #2d5a3d, #388e3c);
    padding: 1.1rem 1.25rem;
    color: #fff;
}

.price-panel__hd h3 {
    font-size: .95rem;
    font-weight: 700;
    letter-spacing: .04em;
    margin-bottom: .25rem;
}

.price-panel__total {
    font-size: 2.1rem;
    font-weight: 700;
    line-height: 1;
    display: flex;
    align-items: baseline;
    gap: .3rem;
}

.price-panel__currency {
    font-size: .88rem;
    font-weight: 400;
    opacity: .8;
}

.price-panel__body {
    padding: .9rem 1.25rem;
}

.price-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: .4rem 0;
    border-bottom: 1px solid #f5f5f5;
    font-size: .84rem;
}

.price-row:last-child {
    border-bottom: none;
}

.price-row__lbl {
    color: #757575;
}

.price-row__val {
    font-weight: 600;
    color: #424242;
}

.price-row__val.ex {
    color: #ff9800;
}

.price-row.total-row {
    margin-top: .5rem;
    padding-top: .7rem;
    border-top: 2px solid #e0e0e0;
    border-bottom: none;
}

.price-row.total-row .price-row__lbl {
    font-weight: 700;
    color: #212121;
    font-size: .92rem;
}

.price-row.total-row .price-row__val {
    font-size: 1.1rem;
    color: #2d5a3d;
}

.price-panel__ft {
    padding: 0 1.25rem 1.25rem;
}

.btn-panel-submit {
    position: relative;
    width: 100%;
    padding: .8rem;
    background: #4caf50;
    color: #fff;
    border: none;
    border-radius: 9999px;
    font-family: inherit;
    font-size: .95rem;
    font-weight: 700;
    cursor: pointer;
    transition: all .2s;
    box-shadow: 0 3px 10px rgba(76, 175, 80, .3);
}

.btn-panel-submit:hover {
    background: #388e3c;
}

.price-note {
    font-size: .71rem;
    color: #9e9e9e;
    margin-top: .7rem;
    line-height: 1.5;
}

/* ============================================================
   スマホ：スティッキー底部バー
============================================================ */
.price-bottom-bar {
    display: none;
}

@media (max-width: 768px) {
    .b2-layout {
        grid-template-columns: 1fr;
        padding-bottom: 90px; /* 底部バー分の余白 */
    }

    /* PC サイドパネル非表示 */
    .price-panel {
        display: none;
    }

    /* 底部バー表示 */
    .price-bottom-bar {
        display: flex;
        flex-direction: column;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        z-index: 200;
        background: #fff;
        box-shadow: 0 -3px 16px rgba(0, 0, 0, .15);
    }

    /* 明細ドロワー */
    .price-drawer {
        max-height: 0;
        overflow: hidden;
        transition: max-height .35s ease;
    }

    .price-drawer.open {
        max-height: 400px;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    .price-drawer-inner {
        padding: .9rem 1.25rem .5rem;
        border-top: 1px solid #e0e0e0;
    }

    .price-drawer-inner .price-row {
        font-size: .84rem;
        padding: .45rem 0;
    }

    /* バー本体 */
    .price-bar-main {
        display: flex;
        align-items: center;
        gap: .75rem;
        padding: .7rem 1rem;
    }

    .price-bar-left {
        flex: 1;
        min-width: 0;
    }

    .price-bar-label {
        font-size: .7rem;
        color: #757575;
        font-weight: 600;
    }

    .price-bar-total {
        font-size: 1.45rem;
        font-weight: 700;
        color: #2d5a3d;
        line-height: 1.2;
        display: flex;
        align-items: baseline;
        gap: .2rem;
    }

    .price-bar-currency {
        font-size: .78rem;
        color: #757575;
        font-weight: 400;
    }

    .price-bar-toggle {
        background: none;
        border: 1px solid #e0e0e0;
        color: #4caf50;
        font-size: .75rem;
        font-weight: 700;
        cursor: pointer;
        display: flex;
        align-items: center;
        gap: .2rem;
        padding: .3rem .6rem;
        border-radius: 9999px;
        font-family: inherit;
        flex-shrink: 0;
        transition: background .2s;
    }

    .price-bar-toggle:hover {
        background: #f1f8e9;
    }

    .price-bar-toggle .arrow {
        transition: transform .3s;
        display: inline-block;
    }

    .price-bar-toggle.open .arrow {
        transform: rotate(180deg);
    }

    .btn-bar-submit {
        position: relative;
        padding: .65rem 1.1rem;
        background: #4caf50;
        color: #fff;
        border: none;
        border-radius: 9999px;
        font-family: inherit;
        font-size: .9rem;
        font-weight: 700;
        cursor: pointer;
        transition: background .2s;
        white-space: nowrap;
        flex-shrink: 0;
        box-shadow: 0 2px 8px rgba(76, 175, 80, .35);
    }

    .btn-bar-submit:active {
        background: #388e3c;
    }
}

/* ============================================================
   フィールドエラー状態
============================================================ */
.field--error input,
.field--error select,
.field--error textarea,
.field--error gmp-place-autocomplete {
    border-color: var(--color-danger, #f44336);
}
