/* ================================================
   order_html — style.css
   ================================================ */

*, *::before, *::after { box-sizing: border-box; }

body {
    margin: 0;
    font-family: "Hiragino Sans", "Hiragino Kaku Gothic ProN", Meiryo, sans-serif;
    font-size: 15px;
    color: #333;
    background: #f5f5f5;
}

a { color: #0b7def; text-decoration: none; }
a:hover { text-decoration: underline; }

#wrapper { min-height: 100vh; display: flex; flex-direction: column; }

/* ------------------------------------------------
   Header
   ------------------------------------------------ */
#site-header {
    background: #1a2a4a;
    color: #fff;
    padding: 0 24px;
    height: 52px;
    position: sticky;
    top: 0;
    z-index: 100;
}
.header-inner {
    max-width: 960px;
    margin: 0 auto;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.header-logo {
    font-size: 16px;
    font-weight: bold;
    letter-spacing: 0.05em;
}
.header-nav { display: flex; gap: 20px; align-items: center; }
.header-nav a { color: #cce0ff; font-size: 13px; }
.header-nav a:hover { color: #fff; text-decoration: none; }
.btn-logout {
    background: rgba(255,255,255,0.15);
    padding: 4px 12px;
    border-radius: 4px;
}

/* ------------------------------------------------
   Main content
   ------------------------------------------------ */
#main-content {
    flex: 1;
    max-width: 960px;
    margin: 32px auto;
    padding: 0 16px;
    width: 100%;
}

.page-title {
    font-size: 20px;
    font-weight: bold;
    margin-bottom: 24px;
    padding-bottom: 10px;
    border-bottom: 2px solid #1a2a4a;
}

/* ------------------------------------------------
   Steps indicator
   ------------------------------------------------ */
.steps {
    display: flex;
    align-items: center;
    gap: 0;
    margin-bottom: 32px;
    counter-reset: step;
}
.step {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #999;
    white-space: nowrap;
}
.step.is-active { color: #1a2a4a; font-weight: bold; }
.step-num {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #ccc;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
}
.step.is-active .step-num { background: #1a2a4a; }
.step.is-done .step-num { background: #4caf50; }
.step.is-done { color: #666; }
.step-sep { flex: 1; height: 2px; background: #ddd; min-width: 24px; }

/* ------------------------------------------------
   Card / section block
   ------------------------------------------------ */
.card {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 24px;
    margin-bottom: 24px;
}
.card-title {
    font-size: 15px;
    font-weight: bold;
    margin-bottom: 16px;
    color: #1a2a4a;
}

/* ------------------------------------------------
   Login page
   ------------------------------------------------ */
#login-wrap {
    max-width: 420px;
    margin: 80px auto;
}
#login-wrap .card { padding: 40px; }
#login-wrap .site-name {
    text-align: center;
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 28px;
    color: #1a2a4a;
}
.form-group { margin-bottom: 16px; }
.form-group label {
    display: block;
    font-size: 13px;
    font-weight: bold;
    margin-bottom: 6px;
    color: #555;
}
.form-control {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 15px;
    transition: border-color 0.2s;
}
.form-control:focus { border-color: #0b7def; outline: none; }

/* ------------------------------------------------
   Buttons
   ------------------------------------------------ */
.btn {
    display: inline-block;
    padding: 10px 24px;
    border-radius: 4px;
    font-size: 15px;
    font-weight: bold;
    cursor: pointer;
    border: none;
    text-align: center;
    text-decoration: none;
    transition: background 0.2s;
}
.btn-primary {
    background: #1a2a4a;
    color: #fff;
}
.btn-primary:hover { background: #2a3e6e; color: #fff; text-decoration: none; }
.btn-secondary {
    background: #fff;
    color: #555;
    border: 1px solid #ccc;
}
.btn-secondary:hover { background: #f0f0f0; text-decoration: none; }
.btn-block { display: block; width: 100%; }
.btn-lg { padding: 14px 32px; font-size: 16px; }

/* ------------------------------------------------
   Product list (index.php)
   ------------------------------------------------ */
.product-table { width: 100%; border-collapse: collapse; }
.product-table th {
    background: #f0f4f8;
    padding: 10px 12px;
    text-align: left;
    font-size: 13px;
    color: #555;
    border-bottom: 2px solid #dde5ef;
    white-space: nowrap;
}
.product-table td {
    padding: 12px;
    border-bottom: 1px solid #eee;
    vertical-align: middle;
}
.product-table tr:last-child td { border-bottom: none; }
.product-name { font-weight: bold; }
.price-cell { text-align: right; font-size: 14px; }
.price-cell .tax-note { font-size: 11px; color: #888; }
.qty-input {
    width: 70px;
    padding: 6px 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 14px;
    text-align: right;
}
.qty-input:focus { border-color: #0b7def; outline: none; }
.out-of-stock { font-size: 12px; color: #c00; background: #fff0f0; padding: 2px 8px; border-radius: 3px; }
.stock-count { font-size: 12px; color: #777; margin-left: 6px; }

/* ------------------------------------------------
   Address list (set_shipping.php)
   ------------------------------------------------ */
.addr-list { display: flex; flex-direction: column; gap: 12px; }
.addr-item {
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    padding: 16px 20px;
    cursor: pointer;
    transition: border-color 0.2s;
    display: flex;
    align-items: flex-start;
    gap: 14px;
}
.addr-item:has(input:checked) { border-color: #1a2a4a; background: #f0f4f8; }
.addr-item input[type="radio"] { margin-top: 3px; cursor: pointer; }
.addr-body { flex: 1; }
.addr-name { font-weight: bold; font-size: 15px; margin-bottom: 4px; }
.addr-detail { font-size: 13px; color: #555; line-height: 1.8; }
.addr-badge {
    font-size: 11px;
    background: #1a2a4a;
    color: #fff;
    padding: 2px 8px;
    border-radius: 3px;
    margin-left: 8px;
}
.no-address {
    padding: 24px;
    text-align: center;
    color: #888;
    background: #f9f9f9;
    border-radius: 6px;
}

/* ------------------------------------------------
   Confirm / summary table
   ------------------------------------------------ */
.summary-table { width: 100%; border-collapse: collapse; }
.summary-table th {
    width: 30%;
    padding: 10px 12px;
    text-align: left;
    font-size: 13px;
    color: #666;
    background: #f8f8f8;
    border: 1px solid #e8e8e8;
    vertical-align: top;
}
.summary-table td {
    padding: 10px 12px;
    border: 1px solid #e8e8e8;
    font-size: 14px;
}
.order-table { width: 100%; border-collapse: collapse; margin-bottom: 12px; }
.order-table th {
    background: #f0f4f8;
    padding: 8px 12px;
    font-size: 13px;
    color: #555;
    border-bottom: 2px solid #dde5ef;
    text-align: right;
}
.order-table th:first-child { text-align: left; }
.order-table td {
    padding: 10px 12px;
    border-bottom: 1px solid #eee;
    vertical-align: middle;
    text-align: right;
}
.order-table td:first-child { text-align: left; }
.totals-table { width: 100%; border-collapse: collapse; margin-top: 4px; }
.totals-table td { padding: 6px 12px; font-size: 14px; }
.totals-table td:last-child { text-align: right; }
.totals-table .total-row { font-weight: bold; font-size: 16px; border-top: 2px solid #333; }
.totals-table .total-row td { padding-top: 10px; }

/* ------------------------------------------------
   Complete page
   ------------------------------------------------ */
.complete-wrap { text-align: center; padding: 48px 0; }
.complete-icon {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: #4caf50;
    color: #fff;
    font-size: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
}
.complete-title { font-size: 22px; font-weight: bold; margin-bottom: 12px; color: #1a2a4a; }
.complete-msg { font-size: 15px; color: #555; margin-bottom: 8px; }
.order-num { font-size: 13px; color: #777; margin-bottom: 32px; }
.order-num span { font-weight: bold; color: #333; }

/* ------------------------------------------------
   Order history (orders/index.php)
   ------------------------------------------------ */
.month-group { margin-bottom: 32px; }
.month-label {
    font-size: 14px;
    font-weight: bold;
    color: #555;
    margin-bottom: 10px;
    padding-bottom: 6px;
    border-bottom: 1px solid #e0e0e0;
}
.history-table { width: 100%; border-collapse: collapse; }
.history-table th {
    background: #f0f4f8;
    padding: 8px 12px;
    font-size: 13px;
    color: #555;
    border-bottom: 2px solid #dde5ef;
    text-align: left;
}
.history-table td {
    padding: 10px 12px;
    border-bottom: 1px solid #eee;
    font-size: 14px;
    vertical-align: middle;
}
.history-table td:last-child { text-align: right; }
.status-badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 12px;
    background: #e8eef6;
    color: #1a2a4a;
}
.empty-msg { text-align: center; padding: 40px; color: #888; }

/* ------------------------------------------------
   Alert / flash message
   ------------------------------------------------ */
.alert {
    padding: 12px 16px;
    border-radius: 4px;
    margin-bottom: 20px;
    font-size: 14px;
}
.alert-error { background: #fff0f0; color: #c00; border: 1px solid #f5c6c6; }
.alert-success { background: #f0fff4; color: #2e7d32; border: 1px solid #a5d6a7; }

/* ------------------------------------------------
   Action bar
   ------------------------------------------------ */
.action-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid #e0e0e0;
}
.action-bar-right { display: flex; gap: 12px; }

/* ------------------------------------------------
   Footer
   ------------------------------------------------ */
#site-footer {
    background: #1a2a4a;
    color: #8899bb;
    text-align: center;
    font-size: 12px;
    padding: 16px;
    margin-top: auto;
}

/* ------------------------------------------------
   Responsive
   ------------------------------------------------ */
@media (max-width: 640px) {
    #main-content { margin: 16px auto; }
    .product-table, .order-table, .history-table { font-size: 13px; }
    .product-table th, .product-table td { padding: 8px 6px; }
    .steps { gap: 0; }
    .step span:not(.step-num) { display: none; }
}
