/* ===== RESET & BASE ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body { font-family: 'Noto Sans TC', sans-serif; color: #333; background: #fff; line-height: 1.6; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
ul { list-style: none; }

/* ===== VARIABLES ===== */
:root {
  --black: #0b1f3a;
  --orange: #2563eb;
  --orange-light: #3b82f6;
  --red: #dc2626;
  --gray-100: #f8f8f8;
  --gray-200: #efefef;
  --gray-400: #aaa;
  --gray-600: #666;
  --white: #fff;
  --header-h: 64px;
  --radius: 8px;
  --shadow: 0 2px 12px rgba(0,0,0,.08);
  --shadow-hover: 0 6px 24px rgba(0,0,0,.14);
}

/* ===== HEADER ===== */
.site-header { background: var(--black); color: var(--white); position: sticky; top: 0; z-index: 1000; }
.header-inner { max-width: 1400px; margin: 0 auto; padding: 0 1.5rem; height: var(--header-h); display: flex; align-items: center; gap: 2rem; }
.logo { display: flex; align-items: center; gap: .5rem; font-size: 1.4rem; font-weight: 700; letter-spacing: .05em; flex-shrink: 0; }
.logo-icon { font-size: 1.6rem; }
.logo-text { color: var(--white); }
.main-nav { display: flex; align-items: center; gap: 1.5rem; flex: 1; overflow: hidden; }
.main-nav a { font-size: .88rem; color: rgba(255,255,255,.8); transition: color .2s; white-space: nowrap; padding: .25rem 0; border-bottom: 2px solid transparent; }
.main-nav a:hover, .main-nav a.active { color: var(--white); border-bottom-color: var(--orange); }
.header-actions { display: flex; align-items: center; gap: .5rem; margin-left: auto; }
.btn-icon { background: none; border: none; cursor: pointer; color: var(--white); display: flex; align-items: center; justify-content: center; padding: .4rem; border-radius: var(--radius); transition: background .2s; position: relative; }
.btn-icon:hover { background: rgba(255,255,255,.1); }
.cart-btn { position: relative; }
.cart-count { position: absolute; top: -2px; right: -4px; background: var(--orange); color: #fff; font-size: .65rem; font-weight: 700; min-width: 18px; height: 18px; border-radius: 9px; display: flex; align-items: center; justify-content: center; padding: 0 4px; }
.menu-toggle { display: none; }
.search-bar { background: var(--black); border-top: 1px solid rgba(255,255,255,.1); padding: .75rem 1.5rem; display: none; }
.search-bar.open { display: block; }
.search-form { max-width: 600px; margin: 0 auto; display: flex; gap: .5rem; }
.search-form input { flex: 1; padding: .6rem 1rem; border: 1px solid rgba(255,255,255,.2); background: rgba(255,255,255,.05); color: #fff; border-radius: var(--radius); outline: none; font-size: .9rem; }
.search-form input::placeholder { color: rgba(255,255,255,.4); }
.search-form input:focus { border-color: var(--orange); }
.search-form button { padding: .6rem 1.4rem; background: var(--orange); color: #fff; border: none; border-radius: var(--radius); cursor: pointer; font-size: .9rem; transition: background .2s; }
.search-form button:hover { background: var(--orange-light); }

/* ===== HERO BANNER ===== */
.hero { background: #dbeafe; color: var(--black); padding: 5rem 1.5rem; display: flex; align-items: center; min-height: 480px; position: relative; overflow: hidden; }
.hero::before { content: 'RCT'; position: absolute; bottom: -20px; right: -10px; font-size: 11rem; font-weight: 900; color: rgba(0,0,0,.06); letter-spacing: .1em; pointer-events: none; }
.hero-inner { max-width: 1400px; margin: 0 auto; width: 100%; }
.hero-tag { display: inline-block; background: rgba(0,0,0,.12); padding: .3rem .8rem; border-radius: 20px; font-size: .8rem; margin-bottom: 1rem; }
.hero h1 { font-size: clamp(2.5rem, 6vw, 5rem); font-weight: 900; line-height: 1.1; margin-bottom: .5rem; }
.hero p { font-size: 1.1rem; opacity: .75; margin-bottom: 2rem; }
.hero-btns { display: flex; gap: 1rem; }
.hero-banner { margin: 0; }
.hero-banner-link { display: block; }
.hero-banner-img { width: 100%; height: auto; display: block; }
.btn-primary { background: var(--black); color: #fff; padding: .8rem 2rem; border-radius: var(--radius); font-size: .95rem; font-weight: 600; transition: transform .2s, box-shadow .2s; display: inline-block; }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 4px 16px rgba(0,0,0,.25); }
.btn-outline { background: transparent; color: var(--black); border: 2px solid var(--black); padding: .75rem 2rem; border-radius: var(--radius); font-size: .95rem; font-weight: 600; transition: all .2s; display: inline-block; }
.btn-outline:hover { background: var(--black); color: #fff; }

/* ===== SECTION ===== */
.section { padding: 4rem 1.5rem; }
.section-header { max-width: 1400px; margin: 0 auto 2rem; display: flex; align-items: baseline; justify-content: space-between; }
.section-title { font-size: 1.6rem; font-weight: 700; }
.section-title span { color: var(--orange); }
.section-more { font-size: .88rem; color: var(--gray-600); border-bottom: 1px solid var(--gray-400); padding-bottom: 1px; transition: color .2s; }
.section-more:hover { color: var(--orange); border-color: var(--orange); }

/* ===== CATEGORY BAR ===== */
.cat-bar { background: var(--gray-100); border-bottom: 1px solid var(--gray-200); }
.cat-bar-inner { max-width: 1400px; margin: 0 auto; padding: 0 1.5rem; display: flex; gap: .5rem; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.cat-bar::-webkit-scrollbar { height: 0; }
.cat-btn { padding: .75rem 1.25rem; font-size: .88rem; white-space: nowrap; color: var(--gray-600); border-bottom: 2px solid transparent; transition: all .2s; cursor: pointer; display: block; }
.cat-btn:hover, .cat-btn.active { color: var(--orange); border-bottom-color: var(--orange); font-weight: 600; }

/* ===== PRODUCT GRID ===== */
.products-grid { max-width: 1400px; margin: 0 auto; display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 1.5rem; }
.product-card { background: #fff; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); transition: transform .25s, box-shadow .25s; }
.product-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-hover); }
.product-card:hover .product-img img { transform: scale(1.05); }
.product-img { aspect-ratio: 1/1; overflow: hidden; background: var(--gray-100); position: relative; }
.product-img img { width: 100%; height: 100%; object-fit: cover; transition: transform .35s; }
.product-badge { position: absolute; top: .6rem; left: .6rem; background: var(--red); color: #fff; font-size: .7rem; font-weight: 700; padding: .2rem .5rem; border-radius: 3px; }
.product-info { padding: 1rem; }
.product-cat { font-size: .75rem; color: var(--gray-400); margin-bottom: .25rem; }
.product-name { font-size: .92rem; font-weight: 500; line-height: 1.4; margin-bottom: .5rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.product-price { color: var(--red); font-weight: 700; font-size: 1.05rem; }
.product-original-price { color: var(--gray-400); font-size: .85rem; text-decoration: line-through; margin-right: .4rem; }
.product-actions { padding: 0 1rem 1rem; display: flex; gap: .5rem; }
.btn-cart { flex: 1; background: var(--black); color: #fff; border: none; padding: .65rem; border-radius: var(--radius); font-size: .88rem; cursor: pointer; transition: background .2s; font-family: inherit; }
.btn-cart:hover { background: #333; }
.btn-view { width: 40px; height: 40px; display: flex; align-items: center; justify-content: center; border: 1px solid var(--gray-200); border-radius: var(--radius); color: var(--gray-600); transition: all .2s; }
.btn-view:hover { border-color: var(--orange); color: var(--orange); }

/* ===== PRODUCT DETAIL ===== */
.product-detail { max-width: 1100px; margin: 2rem auto; padding: 0 1.5rem; }
.product-detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 3rem; align-items: start; }
.product-gallery { position: relative; }
.product-main-img { aspect-ratio: 1/1; overflow: hidden; border-radius: var(--radius); background: var(--gray-100); }
.product-main-img img { width: 100%; height: 100%; object-fit: cover; }
.product-detail-info { }
.product-detail-cat { color: var(--gray-400); font-size: .85rem; margin-bottom: .5rem; }
.product-detail-name { font-size: 1.6rem; font-weight: 700; line-height: 1.3; margin-bottom: 1rem; }
.product-detail-price { display: flex; align-items: baseline; gap: .75rem; margin-bottom: 1.5rem; }
.product-detail-price .price { font-size: 2rem; font-weight: 700; color: var(--red); }
.product-detail-price .original { font-size: 1.1rem; color: var(--gray-400); text-decoration: line-through; }
.product-detail-desc { color: var(--gray-600); line-height: 1.8; margin-bottom: 1.5rem; border-bottom: 1px solid var(--gray-200); padding-bottom: 1.5rem; }
.qty-control { display: flex; align-items: center; gap: 0; border: 1px solid var(--gray-200); border-radius: var(--radius); width: fit-content; margin-bottom: 1.5rem; }
.qty-btn { width: 40px; height: 44px; border: none; background: none; cursor: pointer; font-size: 1.2rem; color: var(--black); display: flex; align-items: center; justify-content: center; transition: background .2s; }
.qty-btn:hover { background: var(--gray-100); }
.qty-input { width: 60px; height: 44px; text-align: center; border: none; border-left: 1px solid var(--gray-200); border-right: 1px solid var(--gray-200); font-size: 1rem; font-family: inherit; outline: none; }
.btn-add-cart { width: 100%; padding: 1rem; background: var(--orange); color: #fff; border: none; border-radius: var(--radius); font-size: 1.05rem; font-weight: 600; cursor: pointer; transition: background .2s, transform .15s; font-family: inherit; margin-bottom: .75rem; }
.btn-add-cart:hover { background: var(--orange-light); transform: translateY(-1px); }
.product-spec { margin-top: 1.5rem; }
.product-spec h3 { font-size: 1rem; font-weight: 600; margin-bottom: .75rem; }
.product-spec p { color: var(--gray-600); font-size: .9rem; line-height: 2; white-space: pre-line; }
.breadcrumb { max-width: 1100px; margin: 1.5rem auto 0; padding: 0 1.5rem; display: flex; gap: .5rem; font-size: .85rem; color: var(--gray-400); }
.breadcrumb a { color: var(--gray-400); transition: color .2s; }
.breadcrumb a:hover { color: var(--orange); }
.breadcrumb span { color: var(--black); }

/* ===== CART ===== */
.cart-page { max-width: 1100px; margin: 2rem auto; padding: 0 1.5rem; }
.cart-page h1 { font-size: 1.6rem; font-weight: 700; margin-bottom: 2rem; }
.cart-layout { display: grid; grid-template-columns: 1fr 340px; gap: 2rem; align-items: start; }
.cart-items { }
.cart-item { display: grid; grid-template-columns: 90px 1fr auto; gap: 1rem; align-items: center; padding: 1.25rem 0; border-bottom: 1px solid var(--gray-200); }
.cart-item-img { width: 90px; height: 90px; object-fit: cover; border-radius: var(--radius); background: var(--gray-100); }
.cart-item-info { }
.cart-item-name { font-size: .95rem; font-weight: 500; margin-bottom: .25rem; }
.cart-item-price { font-size: .9rem; color: var(--red); font-weight: 600; }
.cart-item-actions { display: flex; flex-direction: column; align-items: flex-end; gap: .75rem; }
.cart-qty { display: flex; align-items: center; border: 1px solid var(--gray-200); border-radius: var(--radius); }
.cart-qty-btn { width: 32px; height: 32px; border: none; background: none; cursor: pointer; font-size: 1rem; }
.cart-qty-input { width: 44px; height: 32px; text-align: center; border: none; border-left: 1px solid var(--gray-200); border-right: 1px solid var(--gray-200); font-size: .9rem; font-family: inherit; outline: none; }
.cart-remove { background: none; border: none; cursor: pointer; color: var(--gray-400); font-size: .8rem; transition: color .2s; }
.cart-remove:hover { color: var(--red); }
.cart-summary { background: var(--gray-100); border-radius: var(--radius); padding: 1.5rem; position: sticky; top: calc(var(--header-h) + 1rem); }
.cart-summary h2 { font-size: 1.1rem; font-weight: 700; margin-bottom: 1.25rem; }
.summary-row { display: flex; justify-content: space-between; margin-bottom: .75rem; font-size: .92rem; }
.summary-row.total { border-top: 1px solid var(--gray-200); padding-top: .75rem; margin-top: .75rem; font-size: 1.1rem; font-weight: 700; color: var(--red); }
.free-shipping-note { font-size: .8rem; color: var(--orange); margin-bottom: 1rem; }
.btn-checkout { width: 100%; padding: 1rem; background: var(--orange); color: #fff; border: none; border-radius: var(--radius); font-size: 1rem; font-weight: 600; cursor: pointer; transition: background .2s; font-family: inherit; margin-bottom: .75rem; }
.btn-checkout:hover { background: var(--orange-light); }
.btn-continue { display: block; text-align: center; color: var(--gray-600); font-size: .88rem; padding: .5rem; transition: color .2s; }
.btn-continue:hover { color: var(--orange); }
.cart-empty { text-align: center; padding: 4rem 1.5rem; }
.cart-empty svg { color: var(--gray-200); margin: 0 auto 1rem; }
.cart-empty h2 { font-size: 1.3rem; color: var(--gray-400); margin-bottom: 1rem; }

/* ===== CHECKOUT ===== */
.checkout-page { max-width: 960px; margin: 2rem auto; padding: 0 1.5rem; }
.checkout-page h1 { font-size: 1.6rem; font-weight: 700; margin-bottom: 2rem; }
.checkout-steps { display: flex; gap: 0; margin-bottom: 2.5rem; }
.step { flex: 1; text-align: center; padding: .75rem; font-size: .88rem; color: var(--gray-400); border-bottom: 3px solid var(--gray-200); }
.step.active { color: var(--orange); border-bottom-color: var(--orange); font-weight: 600; }
.step.done { color: var(--gray-600); border-bottom-color: var(--gray-400); }
.checkout-layout { display: grid; grid-template-columns: 1fr 320px; gap: 2rem; align-items: start; }
.checkout-form { background: #fff; border: 1px solid var(--gray-200); border-radius: var(--radius); padding: 1.75rem; }
.checkout-form h2 { font-size: 1.1rem; font-weight: 700; margin-bottom: 1.25rem; }
.form-group { margin-bottom: 1.25rem; }
.form-group label { display: block; font-size: .88rem; font-weight: 500; margin-bottom: .4rem; color: #555; }
.form-group label span { color: var(--red); }
.form-control { width: 100%; padding: .7rem 1rem; border: 1px solid var(--gray-200); border-radius: var(--radius); font-size: .95rem; font-family: inherit; outline: none; transition: border-color .2s; }
.form-control:focus { border-color: var(--orange); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.payment-options { display: flex; flex-direction: column; gap: .75rem; }
.payment-option { border: 2px solid var(--gray-200); border-radius: var(--radius); padding: .9rem 1rem; cursor: pointer; transition: border-color .2s; display: flex; align-items: center; gap: .75rem; }
.payment-option:hover { border-color: var(--orange); }
.payment-option input[type="radio"] { accent-color: var(--orange); }
.payment-option.selected { border-color: var(--orange); background: #eff6ff; }
.checkout-order-summary { background: var(--gray-100); border-radius: var(--radius); padding: 1.5rem; position: sticky; top: calc(var(--header-h) + 1rem); }
.checkout-order-summary h2 { font-size: 1rem; font-weight: 700; margin-bottom: 1rem; }
.order-product-list { margin-bottom: 1rem; }
.order-product-item { display: flex; gap: .75rem; margin-bottom: .75rem; align-items: center; }
.order-product-item img { width: 52px; height: 52px; object-fit: cover; border-radius: 4px; flex-shrink: 0; }
.order-product-name { font-size: .85rem; flex: 1; line-height: 1.3; }
.order-product-price { font-size: .9rem; font-weight: 600; color: var(--red); white-space: nowrap; }
.btn-place-order { width: 100%; padding: 1rem; background: var(--orange); color: #fff; border: none; border-radius: var(--radius); font-size: 1rem; font-weight: 600; cursor: pointer; transition: background .2s; font-family: inherit; }
.btn-place-order:hover { background: var(--orange-light); }

/* ===== ORDER SUCCESS ===== */
.success-page { max-width: 600px; margin: 4rem auto; padding: 0 1.5rem; text-align: center; }
.success-icon { width: 80px; height: 80px; background: #e6f9ee; border-radius: 50%; display: flex; align-items: center; justify-content: center; margin: 0 auto 1.5rem; }
.success-icon svg { color: #2ecc71; }
.success-page h1 { font-size: 1.8rem; font-weight: 700; margin-bottom: .75rem; }
.success-page p { color: var(--gray-600); margin-bottom .5rem; }
.order-info-box { background: var(--gray-100); border-radius: var(--radius); padding: 1.25rem 1.5rem; margin: 1.5rem 0; text-align: left; }
.order-info-row { display: flex; justify-content: space-between; padding: .5rem 0; border-bottom: 1px solid var(--gray-200); font-size: .92rem; }
.order-info-row:last-child { border-bottom: none; font-weight: 700; }

/* ===== STATIC PAGES ===== */
.static-page { max-width: 800px; margin: 3rem auto; padding: 0 1.5rem; }
.static-page h1 { font-size: 1.8rem; font-weight: 700; margin-bottom: 2rem; padding-bottom: 1rem; border-bottom: 2px solid var(--orange); }
.static-page h2 { font-size: 1.2rem; font-weight: 700; margin: 2rem 0 .75rem; color: var(--orange); }
.static-page p, .static-page li { color: var(--gray-600); line-height: 2; }
.static-page ul { padding-left: 1.5rem; list-style: disc; }
.static-page .step-box { background: var(--gray-100); border-radius: var(--radius); padding: 1.25rem 1.5rem; margin-bottom: 1rem; display: flex; gap: 1rem; align-items: flex-start; }
.step-num { width: 32px; height: 32px; background: var(--orange); color: #fff; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 700; flex-shrink: 0; }

/* ===== PAGINATION ===== */
.pagination { display: flex; justify-content: center; gap: .5rem; padding: 2rem 0; }
.page-btn { width: 38px; height: 38px; display: flex; align-items: center; justify-content: center; border: 1px solid var(--gray-200); border-radius: var(--radius); font-size: .9rem; color: var(--gray-600); transition: all .2s; }
.page-btn:hover, .page-btn.active { background: var(--orange); color: #fff; border-color: var(--orange); }

/* ===== TOAST ===== */
.toast { position: fixed; bottom: 1.5rem; left: 50%; transform: translateX(-50%) translateY(100px); background: var(--black); color: #fff; padding: .75rem 1.5rem; border-radius: 30px; font-size: .9rem; z-index: 9999; transition: transform .3s; white-space: nowrap; }
.toast.show { transform: translateX(-50%) translateY(0); }
.toast.success { background: #2ecc71; }
.toast.error { background: var(--red); }

/* ===== NO IMAGE PLACEHOLDER ===== */
.no-image { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; background: var(--gray-100); color: var(--gray-400); font-size: .8rem; }

/* ===== PRODUCTS PAGE ===== */
.products-page { max-width: 1400px; margin: 0 auto; padding: 2rem 1.5rem; display: grid; grid-template-columns: 220px 1fr; gap: 2rem; align-items: start; }
.products-sidebar { background: #fff; border: 1px solid var(--gray-200); border-radius: var(--radius); overflow: hidden; position: sticky; top: calc(var(--header-h) + 1rem); }
.sidebar-title { padding: 1rem 1.25rem; font-weight: 700; background: var(--black); color: #fff; font-size: .95rem; }
.sidebar-link { display: block; padding: .75rem 1.25rem; font-size: .9rem; color: var(--gray-600); border-bottom: 1px solid var(--gray-100); transition: all .2s; }
.sidebar-link:hover, .sidebar-link.active { color: var(--orange); background: #eff6ff; padding-left: 1.5rem; }
.products-main { }
.products-toolbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1.5rem; padding-bottom: 1rem; border-bottom: 1px solid var(--gray-200); }
.products-count { font-size: .9rem; color: var(--gray-600); }
.products-sort select { border: 1px solid var(--gray-200); padding: .5rem .75rem; border-radius: var(--radius); font-size: .88rem; font-family: inherit; outline: none; cursor: pointer; }

/* ===== FOOTER ===== */
.site-footer { background: var(--black); color: rgba(255,255,255,.75); padding: 3.5rem 1.5rem 0; margin-top: 4rem; }
.footer-inner { max-width: 1400px; margin: 0 auto; display: grid; grid-template-columns: 2fr 1fr 1fr 1.5fr; gap: 2rem; }
.footer-logo { display: flex; align-items: center; gap: .5rem; font-size: 1.3rem; font-weight: 700; color: #fff; margin-bottom: .75rem; }
.footer-col p { font-size: .88rem; line-height: 1.9; margin-bottom: .5rem; }
.footer-col h4 { color: #fff; font-size: .95rem; margin-bottom: .75rem; }
.footer-col ul li { margin-bottom: .5rem; }
.footer-col ul li a { font-size: .88rem; color: rgba(255,255,255,.6); transition: color .2s; }
.footer-col ul li a:hover { color: var(--orange); }
.footer-col a { color: rgba(255,255,255,.6); }
.footer-col a:hover { color: var(--orange); }
.footer-contact-info { margin-top: 1rem; display: flex; flex-direction: column; gap: .5rem; }
.footer-contact-info p { font-size: .82rem; color: #aaa; line-height: 1.5; margin: 0; }
.footer-contact-info a { color: #aaa; text-decoration: none; }
.footer-contact-info a:hover { color: #3b82f6; }
.footer-bottom { max-width: 1400px; margin: 2.5rem auto 0; border-top: 1px solid rgba(255,255,255,.1); padding: 1.25rem 0; text-align: center; font-size: .82rem; color: rgba(255,255,255,.4); }

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
  .main-nav { gap: 1rem; }
  .footer-inner { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 768px) {
  .main-nav { display: none; position: fixed; top: var(--header-h); left: 0; right: 0; background: var(--black); flex-direction: column; padding: 1.5rem; gap: 0; z-index: 999; border-top: 1px solid rgba(255,255,255,.1); }
  .main-nav.open { display: flex; }
  .main-nav a { padding: .85rem 0; border-bottom: 1px solid rgba(255,255,255,.07); border-right: none; font-size: 1rem; }
  .main-nav a.active { border-bottom-color: rgba(255,255,255,.07); }
  .menu-toggle { display: flex; }
  .hero { padding: 3rem 1.5rem; min-height: 320px; }
  .products-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 1rem; }
  .cart-layout { grid-template-columns: 1fr; }
  .checkout-layout { grid-template-columns: 1fr; }
  .product-detail-grid { grid-template-columns: 1fr; }
  .products-page { grid-template-columns: 1fr; }
  .products-sidebar { position: static; }
  .form-row { grid-template-columns: 1fr; }
  .footer-inner { grid-template-columns: 1fr; }
  .checkout-order-summary { position: static; }
  .cart-summary { position: static; }
}
@media (max-width: 480px) {
  .hero h1 { font-size: 2.2rem; }
  .products-grid { grid-template-columns: repeat(2, 1fr); }
  .cart-item { grid-template-columns: 70px 1fr; }
  .cart-item-actions { grid-column: 1 / -1; flex-direction: row; justify-content: space-between; }
}
