/* cartxnws shop — storefront */
:root {
	--cxws-primary: #4f46e5;
	--cxws-primary-dark: #4338ca;
	--cxws-text: #0f172a;
	--cxws-muted: #64748b;
	--cxws-border: #e2e8f0;
	--cxws-bg: #f8fafc;
	--cxws-radius: 12px;
	--cxws-green: #059669;
	--cxws-red: #dc2626;
	--cxws-shadow: 0 1px 2px rgba(15, 23, 42, .05), 0 8px 24px rgba(15, 23, 42, .08);
}

.cxws-shop, .cxws-cart-page, .cxws-checkout, .cxws-received, .cxws-register, .cxws-single { color: var(--cxws-text); }
.cxws-btn {
	display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 10px 18px; border: 0; border-radius: 10px;
	background: var(--cxws-primary); color: #fff !important; font-weight: 600; font-size: 15px; line-height: 1.2; cursor: pointer;
	text-decoration: none !important; transition: background .15s, transform .1s;
}
.cxws-btn:hover { background: var(--cxws-primary-dark); }
.cxws-btn:active { transform: translateY(1px); }
.cxws-btn:focus-visible { outline: 3px solid rgba(79, 70, 229, .4); outline-offset: 2px; }
.cxws-btn[disabled] { opacity: .65; cursor: progress; }
.cxws-btn-ghost { background: transparent; color: var(--cxws-primary) !important; border: 1px solid var(--cxws-border); }
.cxws-btn-ghost:hover { background: var(--cxws-bg); }
.cxws-btn-block { width: 100%; margin-top: 12px; }
.cxws-btn.is-loading { opacity: .7; }
.cxws-btn.is-added { background: var(--cxws-green); }
.cxws-link { background: none; border: 0; padding: 0; color: var(--cxws-primary); cursor: pointer; text-decoration: underline; }
.cxws-card { background: #fff; border: 1px solid var(--cxws-border); border-radius: var(--cxws-radius); padding: 20px; margin-bottom: 18px; box-shadow: var(--cxws-shadow); }
.cxws-card h3 { margin-top: 0; }
.cxws-muted { color: var(--cxws-muted); }
.cxws-empty { color: var(--cxws-muted); }
.cxws-empty-state { text-align: center; padding: 40px 20px; }
.cxws-notice { padding: 12px 16px; border-radius: 10px; background: #eef2ff; margin-bottom: 16px; }
.cxws-notice-success { background: #ecfdf5; color: #065f46; }
.cxws-notice-error { background: #fef2f2; color: #991b1b; }
.cxws-notice-warn { background: #fffbeb; color: #92400e; }
.cxws-hp { position: absolute !important; left: -9999px !important; }

/* Shop grid */
.cxws-shop-filter { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; }
.cxws-shop-filter input, .cxws-shop-filter select { flex: 1 1 200px; padding: 10px 12px; border: 1px solid var(--cxws-border); border-radius: 10px; }
.cxws-grid { display: grid; gap: 22px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.cxws-cols-1 { grid-template-columns: 1fr; }
.cxws-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cxws-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.cxws-cols-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.cxws-cols-6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.cxws-product-card { display: flex; flex-direction: column; background: #fff; border: 1px solid var(--cxws-border); border-radius: var(--cxws-radius); overflow: hidden; transition: box-shadow .2s, transform .2s; }
.cxws-product-card:hover { box-shadow: var(--cxws-shadow); transform: translateY(-2px); }
.cxws-product-media { position: relative; display: block; aspect-ratio: 1 / 1; background: var(--cxws-bg); overflow: hidden; }
.cxws-product-media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cxws-product-placeholder { position: absolute; inset: 0; background: linear-gradient(135deg, #eef2ff, #f5f3ff); }
.cxws-badge { position: absolute; top: 10px; left: 10px; background: #e11d48; color: #fff; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.cxws-product-body { display: flex; flex-direction: column; gap: 8px; padding: 14px 16px 18px; flex: 1; }
.cxws-product-title { font-size: 16px; margin: 0; line-height: 1.35; }
.cxws-product-title a { color: inherit; text-decoration: none; }
.cxws-price { margin: 0; font-size: 17px; font-weight: 700; }
.cxws-price del { color: var(--cxws-muted); font-weight: 400; margin-right: 6px; font-size: 14px; }
.cxws-price ins { text-decoration: none; }
.cxws-add-wrap { display: flex; gap: 8px; margin-top: auto; }
.cxws-add-wrap .cxws-btn { flex: 1; }
.cxws-add-qty { width: 72px; padding: 8px; border: 1px solid var(--cxws-border); border-radius: 10px; }
.cxws-stock-out { color: var(--cxws-red); font-weight: 600; margin: auto 0 0; }
.cxws-pagination { display: flex; gap: 6px; justify-content: center; margin-top: 26px; }
.cxws-pagination a, .cxws-pagination span { padding: 6px 12px; border: 1px solid var(--cxws-border); border-radius: 8px; text-decoration: none; }
.cxws-pagination .current { background: var(--cxws-primary); color: #fff; border-color: var(--cxws-primary); }

/* Single product */
.cxws-single { margin-top: 24px; }
.cxws-single .cxws-price { font-size: 26px; }
.cxws-specs { display: grid; grid-template-columns: 140px 1fr; gap: 6px 12px; margin: 18px 0 0; }
.cxws-specs dt { color: var(--cxws-muted); }
.cxws-specs dd { margin: 0; }

/* Tables */
.cxws-table { width: 100%; border-collapse: collapse; margin-bottom: 16px; }
.cxws-table th, .cxws-table td { padding: 12px; border-bottom: 1px solid var(--cxws-border); text-align: left; vertical-align: middle; }
.cxws-table th { font-size: 13px; text-transform: uppercase; letter-spacing: .03em; color: var(--cxws-muted); }
.cxws-cart-grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr); gap: 24px; align-items: start; }
.cxws-cart-product { display: flex; align-items: center; gap: 12px; }
.cxws-cart-product img { border-radius: 8px; object-fit: cover; }
.cxws-qty { display: inline-flex; border: 1px solid var(--cxws-border); border-radius: 10px; overflow: hidden; }
.cxws-qty-btn { width: 34px; border: 0; background: var(--cxws-bg); cursor: pointer; font-size: 16px; }
.cxws-qty-input { width: 52px; border: 0; text-align: center; -moz-appearance: textfield; }
.cxws-qty-input::-webkit-outer-spin-button, .cxws-qty-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.cxws-remove { width: 30px; height: 30px; border-radius: 50%; border: 0; background: #fef2f2; color: var(--cxws-red); font-size: 18px; line-height: 1; cursor: pointer; }
.cxws-remove:hover { background: #fee2e2; }
.cxws-totals { display: grid; grid-template-columns: 1fr auto; gap: 8px; margin: 14px 0 0; }
.cxws-totals dt { color: var(--cxws-muted); }
.cxws-totals dd { margin: 0; text-align: right; font-weight: 600; }
.cxws-totals .cxws-grand { font-size: 18px; color: var(--cxws-text); padding-top: 10px; border-top: 1px solid var(--cxws-border); }
.cxws-coupon { display: flex; gap: 8px; align-items: center; margin: 10px 0; flex-wrap: wrap; }
.cxws-coupon input { flex: 1; min-width: 120px; padding: 9px 12px; border: 1px solid var(--cxws-border); border-radius: 10px; }
.cxws-coupon-applied { margin: 0; color: var(--cxws-green); font-weight: 600; }

/* Checkout */
.cxws-checkout { display: grid; grid-template-columns: minmax(0, 3fr) minmax(300px, 2fr); gap: 24px; align-items: start; }
.cxws-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 16px; }
.cxws-field { margin: 0; }
.cxws-field.cxws-full { grid-column: 1 / -1; }
.cxws-field label, .cxws-checkout label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 4px; }
.cxws-field input, .cxws-field select, .cxws-checkout textarea, .cxws-pickup-fields input {
	width: 100%; padding: 10px 12px; border: 1px solid #cbd5e1; border-radius: 10px; font-size: 15px; background: #fff; box-sizing: border-box;
}
.cxws-field input:focus, .cxws-field select:focus, .cxws-checkout textarea:focus { border-color: var(--cxws-primary); outline: none; box-shadow: 0 0 0 3px rgba(79, 70, 229, .15); }
.cxws-check { display: flex !important; align-items: center; gap: 8px; }
.cxws-check input { width: auto; }
.cxws-review-items { list-style: none; margin: 0 0 10px; padding: 0; }
.cxws-review-items li { display: flex; justify-content: space-between; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--cxws-border); }
.cxws-review-items em { color: var(--cxws-muted); font-style: normal; }
.cxws-rates { border: 0; padding: 0; margin: 14px 0; }
.cxws-rates legend { font-weight: 700; margin-bottom: 8px; }
.cxws-rate, .cxws-gateway { display: flex !important; align-items: center; gap: 10px; padding: 12px; border: 1px solid var(--cxws-border); border-radius: 10px; margin-bottom: 8px; cursor: pointer; font-weight: 500 !important; }
.cxws-rate:has(input:checked), .cxws-gateway:has(input:checked) { border-color: var(--cxws-primary); background: #f5f3ff; }
.cxws-rate input, .cxws-gateway input { width: auto; margin: 0; }
.cxws-rate-label { flex: 1; }
.cxws-rate small { color: var(--cxws-muted); }
.cxws-gateway span { display: flex; flex-direction: column; }
.cxws-gateway small { color: var(--cxws-muted); font-weight: 400; }
.cxws-sandbox { color: #b45309; font-size: 12px; font-style: normal; }
.cxws-pickup-fields { display: grid; gap: 8px; margin: 8px 0; }
.cxws-checkout-error { background: #fef2f2; color: #991b1b; padding: 10px 12px; border-radius: 10px; margin-top: 12px; }
.cxws-secure { text-align: center; color: var(--cxws-muted); font-size: 13px; margin: 10px 0 0; }
.cxws-secure::before { content: "🔒 "; }

/* Order received & account */
.cxws-received { text-align: left; }
.cxws-success-icon { width: 56px; height: 56px; border-radius: 50%; background: #ecfdf5; position: relative; margin-bottom: 12px; }
.cxws-success-icon::after { content: ""; position: absolute; left: 20px; top: 14px; width: 12px; height: 22px; border: solid var(--cxws-green); border-width: 0 4px 4px 0; transform: rotate(45deg); }
.cxws-order-meta { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; margin: 18px 0; }
.cxws-order-meta div { background: var(--cxws-bg); border-radius: 10px; padding: 12px; }
.cxws-order-meta span { display: block; font-size: 12px; text-transform: uppercase; color: var(--cxws-muted); }
.cxws-tracking-list, .cxws-notes { padding-left: 18px; }
.cxws-account-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 16px; }
.cxws-status { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; background: #f1f5f9; }
.cxws-status-processing, .cxws-status-shipped { background: #e0f2fe; color: #075985; }
.cxws-status-completed { background: #ecfdf5; color: #065f46; }
.cxws-status-on-hold, .cxws-status-pending { background: #fffbeb; color: #92400e; }
.cxws-status-cancelled, .cxws-status-failed, .cxws-status-refunded { background: #fef2f2; color: #991b1b; }

/* Floating cart & drawer */
.cxws-floating-cart {
	position: fixed; right: 22px; bottom: 22px; z-index: 99990; width: 60px; height: 60px; border-radius: 50%; border: 0;
	background: var(--cxws-primary); color: #fff; box-shadow: 0 10px 30px rgba(79, 70, 229, .45); cursor: pointer;
	display: flex; align-items: center; justify-content: center; transition: transform .15s;
}
.cxws-floating-cart:hover { transform: scale(1.06); }
.cxws-inline-cart { position: relative; display: inline-flex; align-items: center; background: none; border: 0; cursor: pointer; padding: 6px; color: inherit; }
.cxws-cart-icon { width: 24px; height: 24px; display: inline-block; background: currentColor;
	-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M7 18a2 2 0 1 0 0 4 2 2 0 0 0 0-4zm10 0a2 2 0 1 0 0 4 2 2 0 0 0 0-4zM5.2 4l.9 2H21l-3.6 7.2A2 2 0 0 1 15.6 14H8.1l-.9 1.6-.1.4H19v2H7a2 2 0 0 1-1.8-3l1.3-2.4L3 4H1V2h3.3z'/%3E%3C/svg%3E") center / contain no-repeat;
	mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M7 18a2 2 0 1 0 0 4 2 2 0 0 0 0-4zm10 0a2 2 0 1 0 0 4 2 2 0 0 0 0-4zM5.2 4l.9 2H21l-3.6 7.2A2 2 0 0 1 15.6 14H8.1l-.9 1.6-.1.4H19v2H7a2 2 0 0 1-1.8-3l1.3-2.4L3 4H1V2h3.3z'/%3E%3C/svg%3E") center / contain no-repeat; }
.cxws-cart-count { position: absolute; top: -4px; right: -4px; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 11px; background: #e11d48; color: #fff; font-size: 12px; font-weight: 700; display: flex; align-items: center; justify-content: center; box-sizing: border-box; transition: transform .2s; }
.cxws-cart-count.is-bumped { transform: scale(1.3); }
.cxws-drawer-overlay { position: fixed; inset: 0; background: rgba(15, 23, 42, .45); z-index: 99991; }
.cxws-drawer {
	position: fixed; top: 0; right: 0; bottom: 0; z-index: 99992; width: min(420px, 100vw); background: #fff; display: flex; flex-direction: column;
	transform: translateX(100%); transition: transform .25s ease; box-shadow: -10px 0 40px rgba(15, 23, 42, .2);
}
.cxws-drawer.is-open { transform: translateX(0); }
.cxws-drawer header { display: flex; justify-content: space-between; align-items: center; padding: 18px 20px; border-bottom: 1px solid var(--cxws-border); }
.cxws-drawer header h3 { margin: 0; font-size: 18px; }
.cxws-drawer-close { border: 0; background: var(--cxws-bg); width: 36px; height: 36px; border-radius: 50%; font-size: 22px; cursor: pointer; }
.cxws-drawer-body { padding: 16px 20px; overflow-y: auto; flex: 1; }
.cxws-mini-list { list-style: none; margin: 0; padding: 0; }
.cxws-mini-item { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--cxws-border); }
.cxws-mini-item img { border-radius: 8px; object-fit: cover; }
.cxws-mini-info { flex: 1; display: flex; flex-direction: column; }
.cxws-mini-info a { color: inherit; font-weight: 600; text-decoration: none; }
.cxws-mini-info span { color: var(--cxws-muted); font-size: 14px; }
.cxws-mini-total { display: flex; justify-content: space-between; padding: 16px 0; font-size: 16px; }
.cxws-mini-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.cxws-toast { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); z-index: 99995; background: #0f172a; color: #fff; padding: 12px 18px; border-radius: 10px; box-shadow: var(--cxws-shadow); font-weight: 500; }
.cxws-toast.is-error { background: var(--cxws-red); }

@media (max-width: 900px) {
	.cxws-grid, .cxws-cols-4, .cxws-cols-5, .cxws-cols-6 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.cxws-cart-grid, .cxws-checkout { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
	.cxws-grid, .cxws-cols-2, .cxws-cols-3, .cxws-cols-4, .cxws-cols-5, .cxws-cols-6 { grid-template-columns: 1fr; }
	.cxws-fields { grid-template-columns: 1fr; }
	.cxws-cart-table thead { display: none; }
	.cxws-cart-table tr { display: grid; grid-template-columns: 1fr auto; padding: 10px 0; border-bottom: 1px solid var(--cxws-border); }
	.cxws-cart-table td { border: 0; padding: 4px 0; }
	.cxws-cart-table td[data-label]::before { content: attr(data-label) ": "; color: var(--cxws-muted); font-size: 13px; }
}
@media (prefers-reduced-motion: reduce) {
	.cxws-drawer, .cxws-product-card, .cxws-floating-cart, .cxws-cart-count { transition: none; }
}
