/* Happoya Netshop — base theme (smartphone-first) */
:root {
    --accent: #1e5fa8;
    --accent-dark: #16467c;
    --ink: #1a1a1a;
    --muted: #6b7280;
    --line: #e5e7eb;
    --bg: #f7f8fa;
    --price: #c0392b;
    --radius: 12px;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
    /* Apple-style stack: SF Pro + Hiragino on Apple devices (matches apple.com/jp),
       then Inter + Noto Sans JP webfonts as the clean fallback on Windows/Android.
       SF Pro can't be web-served (Apple license); apple.com only references the
       locally-installed system font the same way. */
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro JP", "SF Pro Text",
                 "Hiragino Kaku Gothic ProN", "Hiragino Sans",
                 "Inter", "Noto Sans JP", Meiryo, "Yu Gothic", sans-serif;
    color: var(--ink);
    background: var(--bg);
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
.wrap { width: 100%; max-width: 1100px; margin: 0 auto; padding: 0 14px; }

/* Header */
.site-header {
    position: sticky; top: 0; z-index: 50;
    background: #fff; border-bottom: 1px solid var(--line);
}
.header-inner { display: flex; align-items: center; gap: 12px; height: 60px; }
.logo { font-weight: 700; font-size: 1.2rem; color: var(--accent); white-space: nowrap; }
.logo span { display: block; font-size: .62rem; color: var(--muted); font-weight: 400; letter-spacing: .08em; }
.logo-img { height: 36px; width: auto; display: block; }
.search { flex: 1; display: flex; min-width: 0; }
.search input {
    flex: 1; min-width: 0; border: 1px solid var(--line); border-right: none;
    border-radius: 999px 0 0 999px; padding: 8px 14px; font-size: .9rem; background: var(--bg);
}
.search button {
    border: 1px solid var(--accent); background: var(--accent); color: #fff;
    border-radius: 0 999px 999px 0; padding: 0 16px; cursor: pointer;
}
.header-actions { display: flex; align-items: center; gap: 14px; font-size: .85rem; white-space: nowrap; }
.header-actions .cart { font-size: 1.3rem; }

/* Hero */
.hero {
    margin: 16px 0; padding: 28px 20px; border-radius: var(--radius);
    background: linear-gradient(135deg, var(--accent), var(--accent-dark)); color: #fff;
}
.hero h1 { font-size: 1.35rem; }
.hero p { opacity: .9; font-size: .9rem; margin-top: 4px; }

/* Notices */
.notice { padding: 16px; border-radius: var(--radius); background: #fff; border: 1px solid var(--line); margin: 16px 0; text-align: center; color: var(--muted); }
.notice.error { border-color: #f3c2c2; background: #fdecec; color: #a13b3b; }

/* Product grid */
.product-grid {
    display: grid; gap: 12px; margin: 16px 0;
    grid-template-columns: repeat(2, 1fr);
}
.card {
    background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
    overflow: hidden; transition: box-shadow .15s, transform .15s; display: flex; flex-direction: column;
}
.card:hover { box-shadow: 0 6px 18px rgba(0,0,0,.08); transform: translateY(-2px); }
.card-img { aspect-ratio: 1 / 1; background: #fafafa; display: flex; align-items: center; justify-content: center; }
.card-img img { width: 100%; height: 100%; object-fit: contain; }
.noimg { color: #c0c4cc; font-size: .8rem; letter-spacing: .1em; }
.card-body { padding: 10px 12px 14px; display: flex; flex-direction: column; gap: 6px; }
.card-title {
    font-size: .82rem; color: #333; line-height: 1.45; height: 2.9em; overflow: hidden;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}
.card-price { color: var(--price); font-weight: 700; font-size: 1.05rem; margin-top: auto; }
.card-price .tax { color: var(--muted); font-weight: 400; font-size: .68rem; }

/* Pagination */
.pagination { display: flex; align-items: center; justify-content: center; gap: 18px; margin: 24px 0 40px; }
.pagination a { padding: 8px 18px; border: 1px solid var(--accent); color: var(--accent); border-radius: 999px; font-size: .9rem; }
.page-info { color: var(--muted); font-size: .85rem; }

/* Footer */
.site-footer { background: #fff; border-top: 1px solid var(--line); margin-top: 30px; padding: 24px 0; }
.footer-links { display: flex; flex-wrap: wrap; gap: 14px 20px; justify-content: center; font-size: .82rem; color: var(--muted); }
.copyright { text-align: center; color: var(--muted); font-size: .78rem; margin-top: 14px; }

/* Tablet / desktop */
/* Cart badge + category nav */
.cart { position: relative; }
.cart-badge { position: absolute; top: -8px; right: -10px; background: var(--price); color: #fff; font-size: .66rem; min-width: 17px; height: 17px; line-height: 17px; text-align: center; border-radius: 999px; padding: 0 4px; }
.cat-nav { border-top: 1px solid var(--line); background: #fff; overflow-x: auto; }
.cat-nav-inner { display: flex; gap: 6px; padding: 8px 14px; white-space: nowrap; }
.cat-nav a { padding: 6px 12px; font-size: .82rem; color: #444; border-radius: 999px; background: var(--bg); }
.cat-nav a:hover { background: #e8eef6; color: var(--accent); }

/* Shared bits */
.breadcrumb { font-size: .8rem; color: var(--muted); margin: 14px 0 8px; }
.breadcrumb a { color: var(--accent); }
.breadcrumb span { margin: 0 4px; }
.page-title { font-size: 1.3rem; margin: 12px 0 16px; }
.notice.ok { border-color: #b6e2c2; background: #eafaf0; color: #1e7a44; }
.notice.pending { padding: 40px 20px; }
.btn-link { display: inline-block; margin-top: 10px; color: var(--accent); font-size: .9rem; }

/* CMS pages (footer legal/info) */
.cms-page { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; margin: 12px 0 40px; }
.cms-body { font-size: .9rem; color: #333; line-height: 1.9; }
.cms-body h3 { font-size: 1rem; margin: 18px 0 8px; border-left: 4px solid var(--accent); padding-left: 10px; }
.cms-body p { margin: 8px 0; }
.cms-body table { width: 100%; border-collapse: collapse; margin: 8px 0; }
.cms-body th, .cms-body td { border: 1px solid var(--line); padding: 10px 12px; text-align: left; vertical-align: top; font-size: .88rem; }
.cms-body th { background: #f0f3f7; white-space: nowrap; width: 34%; }

/* Product detail */
.pdp { display: grid; gap: 20px; margin: 8px 0 30px; }
.pdp-main { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); aspect-ratio: 1/1; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.pdp-main img { width: 100%; height: 100%; object-fit: contain; }
.noimg.big { font-size: 1rem; }
.pdp-thumbs { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.pdp-thumbs .thumb { width: 60px; height: 60px; border: 2px solid var(--line); border-radius: 8px; padding: 0; overflow: hidden; cursor: pointer; background: #fff; }
.pdp-thumbs .thumb.active { border-color: var(--accent); }
.pdp-thumbs .thumb img { width: 100%; height: 100%; object-fit: cover; }
.pdp-title { font-size: 1.25rem; line-height: 1.5; }
.pdp-part { color: var(--muted); font-size: .82rem; margin: 8px 0; }
.pdp-price { color: var(--price); font-weight: 700; font-size: 1.7rem; margin: 14px 0; }
.pdp-price .tax { font-size: .8rem; color: var(--muted); font-weight: 400; }
.pdp-price .excl { display: block; font-size: .8rem; color: var(--muted); font-weight: 400; margin-top: 2px; }
.pdp-stock { font-size: .9rem; margin: 10px 0 18px; font-weight: 600; }
.pdp-stock.in { color: #1e7a44; }
.pdp-stock.out { color: #b03a3a; }
.pdp-stock .low { color: #c87f1e; font-weight: 400; }
.pdp-buy { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; }
.pdp-buy label { font-size: .8rem; color: var(--muted); display: flex; flex-direction: column; gap: 4px; }
.pdp-buy input { width: 80px; padding: 9px; border: 1px solid var(--line); border-radius: 8px; font-size: 1rem; }
.btn-cart { flex: 1; min-width: 180px; background: var(--accent); color: #fff; border: none; border-radius: 999px; padding: 14px 24px; font-size: 1rem; font-weight: 700; cursor: pointer; }
.btn-cart:hover { background: var(--accent-dark); }
.pdp-restock { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.pdp-restock p { font-size: .85rem; color: var(--muted); margin-bottom: 10px; }
.pdp-restock input { width: 100%; padding: 11px; border: 1px solid var(--line); border-radius: 8px; margin-bottom: 10px; }
.btn-restock { width: 100%; background: #444; color: #fff; border: none; border-radius: 999px; padding: 12px; font-size: .95rem; cursor: pointer; }
.pdp-desc { margin-top: 24px; }
.pdp-desc h2 { font-size: 1rem; border-left: 4px solid var(--accent); padding-left: 10px; margin-bottom: 12px; }
.desc-body { font-size: .9rem; color: #333; line-height: 1.8; word-break: break-word; }
.desc-body img { height: auto; margin: 8px 0; }
.desc-body a { color: var(--accent); text-decoration: underline; }
.desc-body table { width: 100% !important; border-collapse: collapse; margin: 8px 0; font-size: .88rem; }
.desc-body td, .desc-body th { border: 1px solid var(--line); padding: 8px 10px; text-align: left; vertical-align: top; }
.desc-body th { background: #f0f3f7; }
.desc-body h2, .desc-body h3, .desc-body h4 { border: 0; padding: 0; margin: 14px 0 8px; font-size: 1rem; }

/* Reviews */
.reviews { margin: 8px 0 40px; }
.reviews-h { font-size: 1.1rem; display: flex; flex-wrap: wrap; align-items: baseline; gap: 10px; border-left: 4px solid var(--accent); padding-left: 10px; margin-bottom: 16px; }
.reviews-avg { font-size: .9rem; color: var(--muted); }
.reviews-avg strong { color: var(--price); font-size: 1.05rem; }
.stars { color: #f5a623; letter-spacing: 1px; }
.reviews-note { font-size: .85rem; color: var(--muted); margin-bottom: 16px; }
.reviews-note a { color: var(--accent); }
.review-form { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; display: flex; flex-direction: column; gap: 10px; margin-bottom: 24px; max-width: 560px; }
.review-form .rf-row { display: flex; align-items: center; gap: 10px; }
.review-form select, .review-form input, .review-form textarea { padding: 9px 11px; border: 1px solid var(--line); border-radius: 8px; font-size: .9rem; font-family: inherit; }
.review-form textarea { resize: vertical; }
.review-list { list-style: none; display: flex; flex-direction: column; gap: 14px; }
.review { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.review-head { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; font-size: .82rem; color: var(--muted); margin-bottom: 6px; }
.review-author { color: #333; font-weight: 600; }
.review-vp { background: #eafaf0; color: #1e7a44; border-radius: 999px; padding: 1px 8px; font-size: .7rem; }
.review-title { font-weight: 700; font-size: .92rem; margin: 2px 0; }
.review-body { font-size: .9rem; line-height: 1.7; }
.review-reply { margin-top: 10px; background: var(--bg); border-radius: 8px; padding: 10px 12px; font-size: .85rem; color: #444; }
.review-reply strong { color: var(--accent); }

/* Cart page */
.cart-list { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.cart-row { display: grid; grid-template-columns: 1fr auto auto auto; gap: 12px; align-items: center; padding: 14px; border-bottom: 1px solid var(--line); }
.cart-row:last-child { border-bottom: none; }
.cart-info { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.cart-name { font-size: .9rem; color: #222; }
.cart-part { font-size: .74rem; color: var(--muted); }
.cart-unit { font-size: .8rem; color: var(--price); }
.cart-qty input { width: 56px; padding: 7px; border: 1px solid var(--line); border-radius: 8px; text-align: center; }
.cart-line { font-weight: 700; color: var(--price); white-space: nowrap; }
.cart-del button { background: none; border: none; color: var(--muted); font-size: 1.1rem; cursor: pointer; }
.cart-summary { margin: 20px 0 40px; text-align: right; display: flex; flex-direction: column; align-items: flex-end; gap: 12px; }
.cart-total { font-size: 1.1rem; }
.cart-total strong { color: var(--price); font-size: 1.4rem; }
.btn-checkout { display: inline-block; background: var(--price); color: #fff; padding: 14px 40px; border-radius: 999px; font-weight: 700; }
.btn-checkout:hover { opacity: .92; }

/* Checkout */
.co-grid { display: grid; gap: 20px; margin: 8px 0 40px; }
.co-h { font-size: 1rem; border-left: 4px solid var(--accent); padding-left: 10px; margin: 18px 0 12px; }
.co-h:first-child { margin-top: 0; }
.co-fields label { display: flex; flex-direction: column; gap: 4px; font-size: .82rem; color: var(--muted); margin-bottom: 12px; }
.co-fields input, .co-fields textarea { padding: 11px; border: 1px solid var(--line); border-radius: 8px; font-size: 1rem; font-family: inherit; }
.co-fields .req { color: var(--price); font-size: .68rem; }
.co-radio { flex-direction: row !important; align-items: center; gap: 8px !important; font-size: .95rem !important; color: var(--ink) !important; }
.co-note { font-size: .8rem; color: var(--muted); background: var(--bg); border-radius: 8px; padding: 10px 12px; margin-bottom: 12px; }
.co-summary { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; align-self: start; }
.co-items { list-style: none; display: flex; flex-direction: column; gap: 10px; margin-bottom: 14px; }
.co-items li { display: grid; grid-template-columns: 1fr auto auto; gap: 8px; align-items: center; font-size: .85rem; border-bottom: 1px solid var(--line); padding-bottom: 10px; }
.co-it-q { color: var(--muted); }
.co-it-p { color: var(--price); font-weight: 600; white-space: nowrap; }
.co-totals { display: grid; grid-template-columns: 1fr auto; gap: 6px 12px; margin-bottom: 16px; font-size: .9rem; }
.co-totals dt { color: var(--muted); }
.co-totals dd { text-align: right; }
.co-totals .co-grand { font-weight: 700; font-size: 1.1rem; color: var(--price); border-top: 1px solid var(--line); padding-top: 8px; }
.co-submit { width: 100%; text-align: center; border: none; cursor: pointer; margin-bottom: 10px; }
.co-done { padding: 40px 20px; }
.co-done h1 { font-size: 1.3rem; margin-bottom: 14px; }
.co-done-no { font-size: 1.05rem; margin: 10px 0; }
@media (min-width: 768px) { .co-grid { grid-template-columns: 1.4fr 1fr; align-items: start; } }

/* Favorite button (PDP) */
.pdp-fav { margin: 4px 0 14px; }
.pdp-fav .fav { background: #fff; border: 1px solid var(--line); color: #555; border-radius: 999px; padding: 8px 16px; font-size: .85rem; cursor: pointer; }
.pdp-fav .fav.on { border-color: var(--price); color: var(--price); background: #fff5f4; }

/* Auth forms */
.auth-form { max-width: 420px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; display: flex; flex-direction: column; gap: 14px; margin: 8px 0; }
.auth-form label { display: flex; flex-direction: column; gap: 5px; font-size: .82rem; color: var(--muted); }
.auth-form input { padding: 11px; border: 1px solid var(--line); border-radius: 8px; font-size: 1rem; }
.auth-form .req { color: var(--price); font-size: .68rem; }
.btn-primary { background: var(--accent); color: #fff; border: none; border-radius: 999px; padding: 13px; font-size: 1rem; font-weight: 700; cursor: pointer; margin-top: 4px; }
.btn-primary:hover { background: var(--accent-dark); }
.auth-alt { font-size: .85rem; color: var(--muted); margin: 14px 0 40px; }
.auth-alt a { color: var(--accent); }

/* Account */
.account-greeting { margin: 4px 0 16px; font-size: 1rem; }
.account-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-bottom: 24px; }
.account-tile { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; text-align: center; display: flex; flex-direction: column; gap: 4px; font-size: .9rem; }
.account-tile .ico { font-size: 1.4rem; }
.account-tile small { color: var(--muted); font-size: .72rem; }
.account-tile.disabled { color: #b6bcc6; }
.account-info { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; margin-bottom: 40px; }
.account-info h2 { font-size: 1rem; margin-bottom: 12px; border-left: 4px solid var(--accent); padding-left: 10px; }
.account-info dl { display: grid; grid-template-columns: 90px 1fr; gap: 8px 12px; font-size: .88rem; }
.account-info dt { color: var(--muted); }
.acct-empty { color: var(--muted); font-size: .88rem; }
.order-history { width: 100%; border-collapse: collapse; font-size: .85rem; }
.order-history th, .order-history td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); }
.order-history th { color: var(--muted); font-weight: 600; font-size: .78rem; }
.ostat { border-radius: 999px; padding: 2px 10px; font-size: .72rem; font-weight: 600; white-space: nowrap; }
.ostat.st-pend { background: #fff3cd; color: #856404; }
.ostat.st-paid { background: #e3f2fd; color: #1565c0; }
.ostat.st-done { background: #eafaf0; color: #1e7a44; }
.ostat.st-cancel { background: #f8d7da; color: #721c24; }

@media (min-width: 600px) { .product-grid { grid-template-columns: repeat(3, 1fr); } .account-grid { grid-template-columns: repeat(4, 1fr); } }
@media (min-width: 768px) { .pdp { grid-template-columns: 1fr 1fr; align-items: start; } }
@media (min-width: 900px) { .product-grid { grid-template-columns: repeat(4, 1fr); gap: 16px; } .hero h1 { font-size: 1.7rem; } }
