:root { --brand: #c30017; --brand-dark: #8f0011; --on-brand: #ffffff; --page-bg: #ffffff; --text: #333333; }
body { font-family: Arial, Helvetica, sans-serif; margin: 0; color: var(--text); background: var(--page-bg); }
header.sp-header { background: var(--brand); color: var(--on-brand); padding: 16px 24px; display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px; }
header.sp-header a { color: var(--on-brand); text-decoration: none; }
.sp-logo { font-size: 20px; font-weight: bold; }
.sp-header-right { display: flex; align-items: center; gap: 14px; font-size: 14px; }
.sp-cart-btn { background: var(--on-brand); color: var(--brand); border: 0; padding: 8px 14px; border-radius: 20px; cursor: pointer; font-weight: bold; }
main { max-width: 1000px; margin: 0 auto; padding: 24px; }
h3.sp-cat { border-bottom: 2px solid var(--brand); padding-bottom: 6px; margin-top: 36px; color: var(--brand-dark); }
.sp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; margin-top: 12px; }
.sp-product { border: 1px solid #eee; border-radius: 8px; padding: 12px; position: relative; }
.sp-product-link { color: inherit; text-decoration: none; display: block; }
.sp-product-img { width: 100%; height: 140px; object-fit: cover; border-radius: 6px; margin-bottom: 8px; background: #f2f2f2; }
.sp-no-img { display: flex; align-items: center; justify-content: center; color: #aaa; font-size: 12px; }
.sp-wish-btn { position: absolute; top: 18px; right: 18px; background: rgba(255,255,255,0.9); border: none; border-radius: 50%; width: 30px; height: 30px; cursor: pointer; font-size: 15px; line-height: 1; z-index: 2; }
.sp-wish-btn.sp-wished { color: var(--brand); }
.sp-product-name { font-weight: bold; font-size: 14px; min-height: 36px; }
.sp-product-unit { font-size: 12px; color: #777; }
.sp-pack-select { width: 100%; padding: 6px; margin-top: 6px; border: 1px solid #ccc; border-radius: 4px; font-size: 13px; background: #fff; }
.sp-product-price { font-size: 16px; color: var(--brand); margin: 8px 0; }
.sp-product-add { display: flex; gap: 6px; }
.sp-qty { width: 50px; padding: 6px; }
.sp-product-add button, .sp-checkout-btn, .sp-pay-btn, .sp-apply-btn, .sp-enquire-btn, .sp-enquiry-submit { background: var(--brand); color: var(--on-brand); border: 0; padding: 8px 12px; border-radius: 4px; cursor: pointer; }
.sp-product-add button:hover, .sp-checkout-btn:hover, .sp-pay-btn:hover { background: var(--brand-dark); }
.sp-out-of-stock { color: var(--brand); font-weight: bold; font-size: 13px; margin-bottom: 6px; }
.sp-enquire-btn { width: 100%; font-size: 12px; padding: 7px; }

/* Cart drawer */
#sp-cart-drawer { position: fixed; top: 0; right: -380px; width: 360px; height: 100%; background: #fff; box-shadow: -2px 0 8px rgba(0,0,0,0.2); transition: right 0.25s ease; padding: 20px; box-sizing: border-box; overflow-y: auto; z-index: 100; }
#sp-cart-drawer.sp-open { right: 0; }
.sp-cart-line { display: grid; grid-template-columns: 1fr 50px 70px 24px; gap: 6px; align-items: center; margin-bottom: 10px; font-size: 13px; }
.sp-remove { background: none; border: none; color: var(--brand); font-size: 18px; cursor: pointer; }
.sp-summary-row { display: flex; justify-content: space-between; font-size: 13px; margin-top: 6px; }
.sp-cart-total-row { display: flex; justify-content: space-between; font-weight: bold; margin-top: 10px; padding-top: 10px; border-top: 1px solid #eee; }
.sp-checkout-btn { width: 100%; margin-top: 16px; padding: 12px; }
.sp-close { float: right; background: none; border: none; font-size: 20px; cursor: pointer; }
.sp-coupon-row { display: flex; gap: 6px; margin-top: 14px; }
.sp-coupon-row input { flex: 1; padding: 8px; border: 1px solid #ccc; border-radius: 4px; }
.sp-coupon-msg { font-size: 12px; margin-top: 6px; }
.sp-coupon-msg.ok { color: #1a7f37; }
.sp-coupon-msg.err { color: var(--brand); }
.sp-delivery-choice { margin-top: 16px; border-top: 1px solid #eee; padding-top: 12px; }
.sp-delivery-choice label { display: block; font-size: 13px; margin-top: 8px; cursor: pointer; }

/* Modals (checkout + enquiry share this) */
.sp-modal { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 200; align-items: center; justify-content: center; }
.sp-modal.sp-open { display: flex; }
.sp-modal-box { background: #fff; padding: 24px; border-radius: 8px; max-width: 420px; width: 90%; max-height: 90vh; overflow-y: auto; }
.sp-modal-box label { display: block; margin-top: 12px; font-size: 13px; font-weight: bold; }
.sp-modal-box input, .sp-modal-box select, .sp-modal-box textarea { width: 100%; padding: 8px; margin-top: 4px; box-sizing: border-box; border: 1px solid #ccc; border-radius: 4px; }
.sp-pay-btn { width: 100%; margin-top: 20px; padding: 12px; font-size: 15px; }
.sp-enquiry-submit { width: 100%; margin-top: 16px; padding: 10px; }

/* Product detail page */
.sp-detail { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; }
.sp-detail-main-img { width: 100%; height: 360px; object-fit: cover; border-radius: 8px; background: #f2f2f2; }
.sp-detail-thumbs { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.sp-detail-thumbs img { width: 60px; height: 60px; object-fit: cover; border-radius: 4px; cursor: pointer; border: 2px solid transparent; }
.sp-detail-thumbs img.active { border-color: var(--brand); }
.sp-detail-price { font-size: 24px; color: var(--brand); margin: 10px 0; }
.sp-detail-unit { color: #777; font-size: 13px; }
.sp-detail-desc { margin-top: 16px; line-height: 1.5; }
table.sp-specs { width: 100%; border-collapse: collapse; margin-top: 20px; }
table.sp-specs th, table.sp-specs td { text-align: left; padding: 8px 10px; border-bottom: 1px solid #eee; font-size: 14px; }
table.sp-specs th { color: #777; font-weight: normal; width: 40%; }
@media (max-width: 700px) {
  .sp-detail { grid-template-columns: 1fr; }
}
