/* 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 {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Hiragino Sans", "Yu Gothic", Meiryo, sans-serif;
    color: var(--ink);
    background: var(--bg);
    line-height: 1.6;
}
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; }
.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; }

/* 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; }

/* 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; }

/* 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); }

@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; } }
