:root {
    --blue: #1d4466;
    --blue-dark: #183954;
    --purple: #8224e3;
    --button: #44515e;
    --ink: #222;
    --text: #444;
    --muted: #777;
    --line: #eee;
    --footer: #3d2626;
    --cream: #efeee3;
}

* { box-sizing: border-box; }
body {
    margin: 0;
    background: #fff;
    color: var(--text);
    font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans TC", sans-serif;
    font-size: 16px;
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
button:disabled { cursor: wait; opacity: .72; }
.col-full { max-width: 1400px; margin: 0 auto; padding: 0 20px; }
.screen-reader-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }

.topbar-wrapper { border-bottom: 1px solid var(--line); background: #fff; }
.top-bar .col-full {
    display: grid;
    grid-template-columns: 1fr 1.4fr 1fr;
    align-items: center;
    min-height: 40px;
    gap: 18px;
    color: #121313;
    font-size: 14px;
}
.top-bar-center { text-align: center; }
.top-bar-right { text-align: right; }
.top-bar-right a { color: #1e68c4; }

.site-header { background: #fff; }
.main-header {
    display: grid;
    grid-template-columns: 270px minmax(260px, 1fr) auto auto;
    gap: 24px;
    align-items: center;
    padding-top: 30px;
    padding-bottom: 30px;
}
.site-branding { display: flex; align-items: center; gap: 14px; }
.menu-toggle {
    display: none;
    width: 42px;
    border: 0;
    background: transparent;
    color: #1e73be;
}
.menu-toggle .bar { display: block; width: 24px; height: 2px; margin: 5px 0; background: #1e73be; }
.bar-text { font-size: 12px; }
.custom-logo-link { display: grid; line-height: 1; color: #111; }
.logo-large { font-weight: 900; font-size: 32px; letter-spacing: 0; }
.logo-sub { margin-top: 7px; color: #777; font-weight: 700; font-size: 13px; }

.woocommerce-product-search {
    display: grid;
    grid-template-columns: 1fr 92px;
    border: 1px solid #ddd;
}
.search-field {
    min-height: 46px;
    padding: 0 14px;
    border: 0;
    outline: 0;
}
.woocommerce-product-search button,
.button,
.elementor-button,
.checkout-section button,
.wm-dialog button {
    border: 0;
    background: var(--button);
    color: #fff;
    cursor: pointer;
    font-weight: 600;
}
.secondary-navigation .menu {
    display: flex;
    gap: 16px;
    margin: 0;
    padding: 0;
    list-style: none;
    color: #404040;
    font-size: 14px;
}
.site-header-cart { justify-self: end; }
.cart-contents {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-height: 44px;
    padding: 0 10px;
    border: 0;
    background: transparent;
    color: #333;
    cursor: pointer;
}
.count {
    display: inline-grid;
    place-items: center;
    min-width: 28px;
    height: 28px;
    color: #81d742;
    border: 2px solid #81d742;
    border-radius: 99px;
    font-weight: 700;
}

.col-full-nav { background: var(--blue); }
.shoptimizer-primary-navigation { min-height: 60px; display: flex; align-items: center; }
.main-navigation .menu {
    display: flex;
    flex-wrap: wrap;
    gap: 0;
    margin: 0;
    padding: 0;
    list-style: none;
}
.main-navigation a {
    display: block;
    padding: 20px 14px;
    color: #fff;
    font-size: 15px;
    font-weight: 600;
}
.main-navigation a:hover { background: var(--blue-dark); }

.site-content { background: #fff; }
.archive-header {
    background: var(--cream);
    padding: 16px 0;
}
.woocommerce-breadcrumb {
    color: #666;
    font-size: 14px;
}
.breadcrumb-separator { margin: 0 8px; color: #999; }
.home-banner { padding-top: 18px; }
.hero-banner {
    display: block;
    min-height: 430px;
    padding: 52px 58px;
    background:
        linear-gradient(90deg, rgba(255,255,255,.92), rgba(255,255,255,.28)),
        url("https://images.unsplash.com/photo-1464965911861-746a04b4bca6?auto=format&fit=crop&w=1800&q=80") center/cover;
}
.hero-banner div { max-width: 560px; }
.hero-banner span { color: #dc9814; font-size: 18px; font-weight: 800; }
.hero-banner h1 {
    margin: 12px 0;
    color: #111;
    font-size: 42px;
    line-height: 1.2;
    font-weight: 600;
}
.hero-banner p { line-height: 1.7; }
.hero-banner strong { display: inline-block; margin-top: 12px; color: #111; }

.home-section { padding: 34px 0 18px; }
.promo-section { background: #f8f8f8; margin-top: 28px; }
.home-section h2 {
    margin: 0 0 22px;
    color: #222;
    font-size: 30px;
    line-height: 1.25;
    font-weight: 600;
    letter-spacing: 0;
    text-align: center;
}
.promo-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}
.promo-row article {
    padding: 16px 18px;
    background: #fff;
    border: 1px solid var(--line);
}
.promo-row strong,
.promo-row span { display: block; }
.promo-row span { margin-top: 5px; color: var(--muted); font-size: 14px; }

.woocommerce ul.products,
.related.products ul.products {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 26px 22px;
    margin: 0;
    padding: 0;
    list-style: none;
}
li.product {
    position: relative;
    min-width: 0;
    background: #fff;
}
.woocommerce-image__wrapper {
    position: relative;
    overflow: hidden;
    background: #f6f6f6;
}
.woocommerce-image__wrapper img {
    display: block;
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    transition: transform .2s ease;
}
li.product:hover img { transform: scale(1.035); }
.product-label {
    position: absolute;
    z-index: 2;
    top: 10px;
    left: 10px;
    min-width: 48px;
    padding: 7px 8px;
    color: #fff;
    background: var(--purple);
    border-radius: 999px;
    font-size: 13px;
    font-weight: 700;
    text-align: center;
}
.woocommerce-card__header { padding: 12px 0 0; }
.product__categories {
    min-height: 34px;
    margin: 0 0 7px;
    color: #888;
    font-size: 12px;
    line-height: 1.45;
}
.product__categories a { color: #777; }
.woocommerce-loop-product__title {
    min-height: 42px;
    margin-bottom: 8px;
    color: #222;
    font-size: 15px;
    font-weight: 600;
    line-height: 1.35;
}
.price {
    display: block;
    min-height: 26px;
    margin-bottom: 10px;
    color: #000;
    font-size: 17px;
    font-weight: 700;
}
.price del {
    margin-right: 5px;
    color: #999;
    font-weight: 400;
}
.price ins { color: #000; text-decoration: none; }
.product-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}
.add_to_cart_button,
.buy-now-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    padding: 0 18px;
    font-size: 14px;
}
.buy-now-button { background: #1d4466; }
.add_to_cart_button:hover,
.elementor-button:hover,
.checkout-section button:hover,
.wm-dialog button:hover { background: #000; }
.wpced {
    margin-top: 10px;
    color: #666;
    font-size: 13px;
}
.wpced-inner {
    display: inline-block;
    padding: 7px 9px;
    background: #f7f7f7;
    border-left: 3px solid #dc9814;
}
.ws-note {
    margin: -12px 0 20px;
    color: #777;
    text-align: center;
    font-size: 14px;
}
.more-wrap { text-align: center; margin-top: 28px; }
.elementor-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 0 22px;
    border-radius: 3px;
}

.testimonial-section { background: #fff; }
.testimonials {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
}
.testimonials article {
    padding: 22px;
    border: 1px solid var(--line);
    text-align: center;
}
.testimonials strong,
.testimonials span { display: block; }
.testimonials span { margin-top: 8px; color: #777; }

.checkout-section {
    margin-top: 28px;
    padding: 34px 0;
    background: var(--cream);
}
.checkout-grid {
    display: grid;
    grid-template-columns: 1fr 430px;
    gap: 32px;
    align-items: start;
}
.checkout-section h2 { margin-top: 0; color: #222; font-size: 30px; }
.checkout-section form {
    display: grid;
    gap: 12px;
    padding: 18px;
    background: #fff;
    border: 1px solid #ddd;
}
label { display: grid; gap: 6px; color: #555; font-size: 14px; font-weight: 600; }
input, select, textarea {
    min-height: 42px;
    padding: 8px 10px;
    border: 1px solid #ddd;
    background: #fff;
}
.checkout-section button { min-height: 44px; }

.product-content .col-full {
    max-width: calc(1400px + 5.2325em);
}
.product-details-wrapper {
    display: grid;
    grid-template-columns: minmax(360px, .92fr) minmax(360px, 1fr);
    gap: 46px;
    align-items: start;
    padding: 36px 0 28px;
    background: #f8f8f8;
}
.woocommerce-product-gallery,
.summary {
    background: #fff;
}
.woocommerce-product-gallery {
    padding: 18px;
}
.woocommerce-product-gallery__image img {
    display: block;
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
}
.product-thumbs {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin-top: 12px;
}
.product-thumbs button {
    padding: 0;
    border: 2px solid transparent;
    background: #fff;
    cursor: pointer;
}
.product-thumbs button.selected,
.product-thumbs button:hover { border-color: var(--blue); }
.product-thumbs img {
    display: block;
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
}
.summary {
    position: relative;
    padding: 22px 24px;
}
.onsale {
    display: inline-block;
    margin-bottom: 10px;
    padding: 5px 9px;
    color: #fff;
    background: var(--purple);
    border-radius: 999px;
    font-size: 13px;
    font-weight: 700;
}
.product_title {
    margin: 0 0 12px;
    color: #111;
    font-size: 34px;
    line-height: 1.2;
    font-weight: 600;
}
.summary > .product-label {
    position: static;
    display: inline-block;
    margin-bottom: 14px;
}
.woocommerce-product-details__short-description {
    padding: 14px 0;
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    line-height: 1.75;
}
.product-detail-form {
    display: grid;
    gap: 14px;
    margin-top: 18px;
}
.variations {
    width: 100%;
    border-collapse: collapse;
}
.variations th,
.variations td {
    padding: 10px 0;
    vertical-align: top;
    border-bottom: 1px solid var(--line);
}
.variations th {
    width: 92px;
    color: #222;
    text-align: left;
}
.swatchly-type-wrap {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.swatchly-swatch {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-height: 34px;
    padding: 0 12px;
    border: 1px solid #ddd;
    background: #fff;
    color: #333;
    cursor: pointer;
}
.swatchly-swatch:hover,
.swatchly-swatch.swatchly-selected {
    border-color: #111;
    box-shadow: inset 0 0 0 1px #111;
}
.swatchly-swatch.swatchly-selected {
    background: #111;
    color: #fff;
}
.selected-badge {
    display: inline-flex;
    align-items: center;
    min-height: 20px;
    padding: 0 6px;
    background: #dc9814;
    color: #111;
    font-size: 12px;
    font-weight: 800;
    line-height: 1;
}
.variant-select {
    width: 100%;
    min-height: 42px;
}
.quantity {
    display: inline-flex;
    align-items: center;
}
.quantity .qty {
    width: 86px;
    text-align: center;
}
.single-product-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}
.single_add_to_cart_button {
    width: fit-content;
    min-height: 46px;
    padding: 0 26px;
}
.variation-message {
    min-height: 22px;
    margin: 0;
    color: #2f7a4f;
    font-size: 14px;
}
.variation-message.error { color: #b42318; }
.direct-buy-note {
    margin: 0;
    padding: 12px;
    background: #f7f7f7;
    border-left: 3px solid #dc9814;
}
.product-widget {
    margin-top: 18px;
    padding: 16px;
    background: #fbfbfb;
    border: 1px solid var(--line);
}
.product-widget ul { margin-bottom: 0; padding-left: 20px; }
.woocommerce-tabs {
    margin-top: 20px;
    background: #fff;
}
.wc-tabs {
    display: flex;
    gap: 0;
    margin: 0;
    padding: 0;
    list-style: none;
    border-bottom: 1px solid var(--line);
}
.wc-tabs a {
    display: block;
    padding: 15px 18px;
    color: #222;
    font-weight: 700;
}
.wc-tabs a:hover { color: #1e68c4; }
.wc-tab {
    padding: 24px 0;
    line-height: 1.75;
}
.shop_attributes {
    width: 100%;
    border-collapse: collapse;
}
.shop_attributes th,
.shop_attributes td {
    padding: 12px;
    border: 1px solid var(--line);
    text-align: left;
}
.related.products {
    margin: 28px 0 50px;
}
.related.products h2 {
    margin-bottom: 20px;
    text-align: center;
}

.shoptimizer-mini-cart-wrap {
    position: fixed;
    inset: 0 0 0 auto;
    z-index: 80;
    display: none;
    width: min(390px, 92vw);
    padding: 22px;
    background: #fff;
    box-shadow: -18px 0 50px rgba(0,0,0,.2);
}
.shoptimizer-mini-cart-wrap.open { display: block; }
.cart-drawer-heading {
    margin-bottom: 18px;
    color: #111;
    font-size: 22px;
    font-weight: 700;
}
.close-drawer {
    position: absolute;
    top: 18px;
    right: 18px;
    border: 0;
    background: #f1f1f1;
    padding: 8px 12px;
    cursor: pointer;
}
.cart-item {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 8px;
    padding: 12px 0;
    border-bottom: 1px solid var(--line);
}
.mini-cart-total { margin-top: 18px; color: #111; font-size: 20px; font-weight: 700; }

.wm-dialog {
    width: min(520px, calc(100vw - 28px));
    padding: 0;
    border: 0;
    background: transparent;
}
.product-option-dialog { width: min(640px, calc(100vw - 28px)); }
.wm-dialog::backdrop { background: rgba(0,0,0,.45); }
.dialog-shell {
    position: relative;
    display: grid;
    gap: 14px;
    padding: 24px;
    background: #fff;
    border: 1px solid var(--line);
    box-shadow: 0 22px 80px rgba(0,0,0,.26);
}
.dialog-shell h2 {
    margin: 0;
    color: #111;
    font-size: 26px;
}
.dialog-message {
    margin: 0;
    color: #666;
    line-height: 1.65;
}
.dialog-grid { display: grid; gap: 12px; }
.option-dialog-head {
    display: grid;
    grid-template-columns: 96px 1fr;
    gap: 14px;
    align-items: center;
    padding-right: 58px;
}
.option-dialog-head img {
    width: 96px;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    background: #f6f6f6;
}
.option-dialog-head .price {
    margin: 8px 0 0;
    min-height: auto;
}
.option-group {
    display: grid;
    gap: 8px;
    padding: 12px 0;
    border-top: 1px solid var(--line);
}
.dialog-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}
.dialog-shell button {
    min-height: 44px;
    padding: 0 16px;
}
.dialog-close {
    position: absolute;
    top: 12px;
    right: 12px;
    min-height: 34px !important;
    padding: 0 10px !important;
    background: #f1f1f1 !important;
    color: #333 !important;
}

.wm-toast {
    position: fixed;
    z-index: 120;
    right: 22px;
    bottom: 22px;
    max-width: min(380px, calc(100vw - 32px));
    padding: 13px 16px;
    background: #111;
    color: #fff;
    box-shadow: 0 14px 46px rgba(0,0,0,.28);
    font-size: 14px;
    font-weight: 700;
    line-height: 1.5;
    transform: translateY(14px);
    opacity: 0;
    pointer-events: none;
    transition: opacity .18s ease, transform .18s ease;
}
.wm-toast.show {
    transform: translateY(0);
    opacity: 1;
}

.site-footer,
.copyright {
    background: var(--footer);
    color: #fff;
}
.footer-widgets {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 28px;
    padding-top: 34px;
    padding-bottom: 34px;
}
.widget-title {
    display: block;
    margin-bottom: 12px;
    color: #1e73be;
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
}
.site-footer ul { margin: 0; padding: 0; list-style: none; }
.site-footer li { margin: 7px 0; }
.site-footer p { margin: 0; line-height: 1.7; }
.copyright .col-full {
    padding-top: 16px;
    padding-bottom: 16px;
    border-top: 1px solid rgba(255,255,255,.15);
    font-size: 14px;
}

.admin-shell {
    max-width: 1180px;
    margin: 0 auto;
    padding: 28px 20px 56px;
}
.admin-grid { display: grid; grid-template-columns: 340px 1fr; gap: 18px; align-items: start; }
.admin-form, .admin-table {
    display: grid;
    gap: 14px;
    padding: 18px;
    background: #fff;
    border: 1px solid var(--line);
}
.admin-table table { width: 100%; border-collapse: collapse; }
.admin-table th, .admin-table td { padding: 11px; text-align: left; border-bottom: 1px solid var(--line); }
.admin-actions button { min-height: 42px; padding: 0 14px; border: 0; background: var(--button); color: #fff; cursor: pointer; font-weight: 700; }

@media (max-width: 992px) {
    .top-bar .col-full { grid-template-columns: 1fr; text-align: center; padding-top: 9px; padding-bottom: 9px; }
    .top-bar-right { text-align: center; }
    .main-header { grid-template-columns: 1fr auto; gap: 14px; padding-top: 14px; padding-bottom: 14px; }
    .menu-toggle { display: block; }
    .site-search, .secondary-navigation { grid-column: 1 / -1; }
    .main-navigation .menu { display: grid; grid-template-columns: repeat(2, 1fr); width: 100%; }
    .main-navigation a { padding: 14px; }
    .hero-banner { min-height: 330px; padding: 34px 24px; }
    .woocommerce ul.products, .related.products ul.products { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px 16px; }
    .checkout-grid, .admin-grid { grid-template-columns: 1fr; }
    .footer-widgets, .testimonials { grid-template-columns: repeat(2, 1fr); }
    .product-details-wrapper { grid-template-columns: 1fr; gap: 18px; }
    .product_title { font-size: 28px; }
}

@media (max-width: 600px) {
    .col-full { padding-left: 14px; padding-right: 14px; }
    .logo-large { font-size: 24px; }
    .woocommerce ul.products, .related.products ul.products { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 12px; }
    .product__categories { display: none; }
    .woocommerce-loop-product__title { font-size: 13px; }
    .price { font-size: 15px; }
    .add_to_cart_button { width: 100%; padding: 0 10px; }
    .wpced { font-size: 11px; }
    .promo-row, .footer-widgets, .testimonials { grid-template-columns: 1fr; }
}
