/* CofeMan Shop — storefront. Inherits the theme's fonts; colours via tokens. */
:root {
	--cm-accent: #5b3a21;        /* coffee brown */
	--cm-accent-dark: #3f2816;
	--cm-accent-text: #fff;
	--cm-gold: #c99a3b;
	--cm-ink: #1b1b1b;
	--cm-muted: #7a7a7a;
	--cm-line: #e6e2dc;
	--cm-panel: #faf7f2;
	--cm-radius: 10px;
}

/* ---------- Page frame: full width, no theme sidebar on shop pages ---------- */
body.cm-shop-page .sidebar,
body.cm-shop-page .sidebar_container,
body.cm-shop-page aside.sidebar,
body.cm-shop-page .widget_area.sidebar { display: none !important; }
body.cm-shop-page .content_wrap .content,
body.cm-shop-page .content { width: 100% !important; max-width: 100% !important; float: none !important; }
.cm-wrap { max-width: 1100px; margin: 0 auto; padding: 0 16px; box-sizing: border-box; }
.cm-wrap *, .cm-wrap *::before, .cm-wrap *::after { box-sizing: border-box; }

/* ---------- Shared ---------- */
.cm-wrap .cm-btn, .cm-buy .cm-btn, .cm-thankyou .cm-btn {
	display: inline-flex; align-items: center; justify-content: center; gap: .5em;
	min-height: 48px; padding: 0 1.5em; border: 2px solid var(--cm-accent) !important; border-radius: var(--cm-radius) !important;
	background: transparent !important; color: var(--cm-accent) !important; font: inherit; font-weight: 600; letter-spacing: 0; text-transform: none;
	cursor: pointer; text-decoration: none; line-height: 1.2; transition: background .15s, color .15s, transform .05s;
}
.cm-wrap .cm-btn:hover, .cm-buy .cm-btn:hover { background: var(--cm-accent) !important; color: var(--cm-accent-text) !important; }
.cm-wrap .cm-btn-primary, .cm-buy .cm-btn-primary { background: var(--cm-accent) !important; color: var(--cm-accent-text) !important; }
.cm-wrap .cm-btn-primary:hover, .cm-buy .cm-btn-primary:hover { background: var(--cm-accent-dark) !important; border-color: var(--cm-accent-dark) !important; }
.cm-wrap .cm-btn:disabled, .cm-wrap .cm-btn.is-busy { opacity: .5; cursor: default; }
.cm-msg { margin-top: .75em; font-size: .95em; line-height: 1.4; }
.cm-msg.err { color: #b32d2e; }
.cm-msg.ok { color: #1a6b3a; }
.cm-empty { font-size: 1.1em; }
.cm-h { display: flex; align-items: center; gap: .6em; margin: 0 0 1em; font-size: 1.35em; line-height: 1.2; }
.cm-h small { font-size: .6em; font-weight: 400; color: var(--cm-muted); margin-left: .3em; }
.cm-step { display: inline-flex; align-items: center; justify-content: center; width: 1.7em; height: 1.7em; border-radius: 50%; background: var(--cm-accent); color: #fff; font-size: .65em; font-weight: 700; }

/* ---------- Product grid ---------- */
.cm-grid { display: grid; gap: 28px; grid-template-columns: repeat(3, 1fr); }
.cm-cols-2 { grid-template-columns: repeat(2, 1fr); }
.cm-cols-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 900px) { .cm-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .cm-grid { grid-template-columns: 1fr; } }
.cm-card { display: block; text-decoration: none !important; color: inherit !important; border: 1px solid var(--cm-line); border-radius: var(--cm-radius); overflow: hidden; background: #fff; transition: box-shadow .2s, transform .2s; }
.cm-card:hover { box-shadow: 0 10px 30px rgba(0,0,0,.08); transform: translateY(-2px); }
.cm-card-img img { width: 100%; height: auto; display: block; aspect-ratio: 1/1; object-fit: cover; }
.cm-card-body { padding: 18px 20px 22px; }
.cm-card-body h3 { margin: 0 0 .3em; font-size: 1.15em; }
.cm-card-type { color: var(--cm-muted); font-size: .85em; margin-bottom: .5em; }
.cm-card-price { font-weight: 700; margin-top: .6em; color: var(--cm-accent); }

/* ---------- Single product ---------- */
.cm-single-inner { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; max-width: 1100px; margin: 40px auto; padding: 0 16px; }
@media (max-width: 800px) { .cm-single-inner { grid-template-columns: 1fr; gap: 24px; } }
.cm-single-media img { width: 100%; height: auto; border-radius: var(--cm-radius); }
.cm-type { color: var(--cm-muted); margin-bottom: 1em; }
.cm-meta { display: grid; grid-template-columns: auto 1fr; gap: .35em 1.2em; margin: 1em 0 1.5em; font-size: .95em; }
.cm-meta dt { color: var(--cm-muted); }
.cm-meta dd { margin: 0; }
.cm-variants { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 1em; }
.cm-variant { border: 1.5px solid var(--cm-line); border-radius: var(--cm-radius); padding: .7em 1em; cursor: pointer; display: flex; gap: .6em; align-items: center; background: #fff; }
.cm-variant:has(input:checked) { border-color: var(--cm-accent); box-shadow: inset 0 0 0 1px var(--cm-accent); background: var(--cm-panel); }
.cm-variant input { margin: 0; accent-color: var(--cm-accent); }
.cm-variant.is-out { opacity: .5; }
.cm-variant-price { font-weight: 700; }
.cm-grind select, .cm-qty input { padding: .5em .7em; border: 1.5px solid var(--cm-line); border-radius: 8px; }
.cm-qty input { width: 5em; }
.cm-cart-link { margin-left: 1em; }
.cm-description { margin-top: 2em; }

/* ---------- Cart ---------- */
.cm-cart-wrap.is-busy { opacity: .5; pointer-events: none; }
.cm-table { width: 100%; border-collapse: collapse; border: 1px solid var(--cm-line); border-radius: var(--cm-radius); overflow: hidden; }
.cm-table thead th { background: var(--cm-panel); color: var(--cm-ink); font-weight: 600; font-size: .9em; text-transform: none; letter-spacing: 0; padding: .9em .8em; text-align: left; border-bottom: 1px solid var(--cm-line); }
.cm-table td { padding: .9em .8em; border-bottom: 1px solid var(--cm-line); vertical-align: middle; }
.cm-table tbody tr:last-child td { border-bottom: none; }
.cm-table .cm-thumb { width: 72px; }
.cm-table .cm-thumb img { width: 56px; height: 56px; object-fit: cover; border-radius: 8px; display: block; }
.cm-table td a { color: var(--cm-ink) !important; font-weight: 600; text-decoration: none; }
.cm-table small { color: var(--cm-muted); }
.cm-table th:nth-child(3), .cm-table td:nth-child(3), .cm-table th:nth-child(5), .cm-table td:nth-child(5) { text-align: right; white-space: nowrap; }
.cm-table th:nth-child(4), .cm-table td:nth-child(4) { text-align: center; }
.cm-qty-input { width: 4.5em !important; padding: .45em .5em !important; border: 1.5px solid var(--cm-line) !important; border-radius: 8px !important; text-align: center; background: #fff !important; }
.cm-remove { background: none !important; border: none !important; padding: 0 !important; width: 32px; height: 32px; border-radius: 50%; font-size: 1.3em; line-height: 1; cursor: pointer; color: var(--cm-muted) !important; }
.cm-remove:hover { background: #fdecea !important; color: #b32d2e !important; }
.cm-cart-foot { display: flex; justify-content: space-between; align-items: center; gap: 20px; margin-top: 1.5em; flex-wrap: wrap; }
.cm-cart-foot .cm-subtotal strong { font-size: 1.15em; }
.cm-cart-foot .cm-subtotal small { color: var(--cm-muted); }
.cm-cart-actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* ---------- Checkout ---------- */
.cm-checkout-cols { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(320px, 1fr); gap: 40px; align-items: start; }
@media (max-width: 860px) { .cm-checkout-cols { grid-template-columns: 1fr; gap: 24px; } .cm-checkout-summary { order: -1; } }
.cm-section { margin-bottom: 2.2em; }
.cm-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 20px; }
@media (max-width: 560px) { .cm-grid-2 { grid-template-columns: 1fr; } }
.cm-span-2 { grid-column: 1 / -1; }
.cm-field { margin: 0; }
.cm-field label { display: block; font-size: .85em; font-weight: 600; color: var(--cm-ink); margin: 0 0 .4em; }
.cm-checkout .cm-field input, .cm-checkout .cm-field select, .cm-checkout .cm-field textarea {
	width: 100% !important; min-height: 48px; padding: .7em .9em !important; margin: 0 !important;
	border: 1.5px solid var(--cm-line) !important; border-radius: 8px !important; background: #fff !important;
	font: inherit !important; font-size: 1em !important; color: var(--cm-ink) !important; box-shadow: none !important; appearance: none; -webkit-appearance: none;
}
.cm-checkout .cm-field textarea { min-height: 80px; resize: vertical; }
.cm-checkout .cm-field select { background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%237a7a7a' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat right 14px center !important; padding-right: 2.4em !important; }
.cm-checkout .cm-field input:focus, .cm-checkout .cm-field select:focus, .cm-checkout .cm-field textarea:focus { outline: none; border-color: var(--cm-accent) !important; box-shadow: 0 0 0 3px rgba(91,58,33,.12) !important; }
.cm-checkout .cm-field input.is-invalid, .cm-checkout .cm-field select.is-invalid { border-color: #b32d2e !important; }

.cm-rates { display: flex; flex-direction: column; gap: 10px; }
.cm-rates-hint { color: var(--cm-muted); font-size: .95em; margin: 0; padding: 1em; border: 1.5px dashed var(--cm-line); border-radius: 8px; }
.cm-rates-err { color: #b32d2e; font-size: .95em; margin: 0; padding: 1em; border: 1.5px solid #f3c2c0; border-radius: 8px; background: #fdecea; }
.cm-rate { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border: 1.5px solid var(--cm-line); border-radius: 8px; cursor: pointer; background: #fff; margin: 0; }
.cm-rate:has(input:checked) { border-color: var(--cm-accent); background: var(--cm-panel); box-shadow: inset 0 0 0 1px var(--cm-accent); }
.cm-rate input { margin: 0; width: 18px; height: 18px; flex: none; accent-color: var(--cm-accent); }
.cm-rate-body { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.cm-rate-name { font-weight: 600; }
.cm-rate-eta { font-size: .85em; color: var(--cm-muted); }
.cm-rate-cost { font-weight: 700; white-space: nowrap; }

.cm-checkout-summary { background: var(--cm-panel); border: 1px solid var(--cm-line); border-radius: var(--cm-radius); padding: 24px; position: sticky; top: 24px; }
.cm-sum-items { list-style: none; margin: 0 0 1em; padding: 0; }
.cm-sum-items li { display: flex; align-items: center; gap: 12px; padding: .7em 0; border-bottom: 1px solid var(--cm-line); }
.cm-sum-items img { width: 48px; height: 48px; border-radius: 8px; object-fit: cover; flex: none; }
.cm-sum-name { flex: 1; min-width: 0; display: flex; flex-direction: column; font-weight: 600; line-height: 1.3; }
.cm-sum-name small { font-weight: 400; color: var(--cm-muted); }
.cm-sum-price { font-weight: 600; white-space: nowrap; }
.cm-totals { width: 100%; margin: .5em 0 1.2em; border-collapse: collapse; }
.cm-totals th { text-align: left; font-weight: 400; padding: .35em 0; color: var(--cm-ink); border: none; background: none; }
.cm-totals td { text-align: right; padding: .35em 0; white-space: nowrap; border: none; }
.cm-totals .t-total th, .cm-totals .t-total td { font-weight: 700; font-size: 1.15em; border-top: 1px solid var(--cm-line); padding-top: .7em; }
.cm-pay { width: 100%; font-size: 1.05em; }
.cm-secure { font-size: .82em; color: var(--cm-muted); text-align: center; margin: .8em 0 0; line-height: 1.4; }
.cm-back { margin: 1em 0 0; font-size: .9em; text-align: center; }

/* ---------- Thank you ---------- */
.cm-thankyou { max-width: 720px; margin: 0 auto; }
.cm-summary { white-space: pre-wrap; background: var(--cm-panel); border: 1px solid var(--cm-line); padding: 20px; border-radius: var(--cm-radius); font-family: inherit; }
