/* Brookie's Shop cart — uses the theme's own color variables so it matches automatically. */

.bcs-cart-toggle {
	position: fixed;
	bottom: 24px;
	right: 24px;
	z-index: 9998;
	width: 56px;
	height: 56px;
	border-radius: 50%;
	background: var(--bcc-ink, #131417);
	color: var(--bcc-paper, #fff);
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
}

.bcs-cart-icon {
	font-size: 1.4rem;
}

.bcs-cart-count {
	position: absolute;
	top: -4px;
	right: -4px;
	background: var(--bcc-magenta, #ff0072);
	color: #fff;
	font-family: var(--bcc-font-mono, monospace);
	font-size: 0.72rem;
	min-width: 20px;
	height: 20px;
	border-radius: 999px;
	align-items: center;
	justify-content: center;
	display: none;
}

.bcs-cart-drawer {
	position: fixed;
	top: 0;
	bottom: 0;
	right: -420px;
	width: 100%;
	max-width: 400px;
	height: auto;
	max-height: 100%;
	max-height: 100dvh;
	background: var(--bcc-paper, #fff);
	color: var(--bcc-ink, #131417);
	z-index: 9999;
	box-shadow: -8px 0 24px rgba(0, 0, 0, 0.15);
	display: flex;
	flex-direction: column;
	overflow: hidden;
	transition: right 0.25s ease;
}

.bcs-cart-drawer.is-open {
	right: 0;
}

/* Keep the drawer clear of the WordPress admin bar when logged in.
   The admin bar is fixed at z-index 99999, so without this it covers
   the drawer header ("Your Cart" + close button). */
body.admin-bar .bcs-cart-drawer {
	top: 32px;
}

@media screen and (max-width: 782px) {
	body.admin-bar .bcs-cart-drawer {
		top: 46px;
	}
}

/* Below 600px WordPress un-fixes the admin bar, so it scrolls away
   and the drawer can use the full viewport again. */
@media screen and (max-width: 600px) {
	body.admin-bar .bcs-cart-drawer {
		top: 0;
	}
}

.bcs-cart-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 20px 24px;
	border-bottom: 1px solid var(--bcc-line, #e2e2e5);
	flex: 0 0 auto;
}

.bcs-cart-header h2 {
	margin: 0;
	font-size: 1.2rem;
}

.bcs-cart-close {
	background: none;
	border: none;
	font-size: 1.6rem;
	line-height: 1;
	cursor: pointer;
	color: var(--bcc-ink, #131417);
}

.bcs-cart-items {
	flex: 1 1 auto;
	min-height: 44px;
	overflow-y: auto;
	padding: 16px 24px;
	-webkit-overflow-scrolling: touch;
}

.bcs-cart-empty {
	color: var(--bcc-gray, #6b6f76);
	font-size: 0.95rem;
}

.bcs-cart-item {
	display: flex;
	gap: 12px;
	padding: 14px 0;
	border-bottom: 1px solid var(--bcc-line, #e2e2e5);
}

.bcs-cart-item-img {
	width: 56px;
	height: 56px;
	object-fit: cover;
	border-radius: 2px;
	flex-shrink: 0;
}

.bcs-cart-item-title {
	font-size: 0.95rem;
	font-weight: 600;
}

.bcs-cart-item-size {
	font-family: var(--bcc-font-mono, monospace);
	font-size: 0.75rem;
	color: var(--bcc-gray, #6b6f76);
	margin-top: 2px;
}

.bcs-cart-item-price {
	font-family: var(--bcc-font-mono, monospace);
	font-size: 0.85rem;
	color: var(--bcc-magenta, #ff0072);
	margin: 2px 0 8px;
}

.bcs-cart-item-qty {
	display: flex;
	align-items: center;
	gap: 8px;
	font-family: var(--bcc-font-mono, monospace);
	font-size: 0.85rem;
}

.bcs-cart-item-qty button {
	width: 22px;
	height: 22px;
	border: 1px solid var(--bcc-line, #e2e2e5);
	background: var(--bcc-surface, #f4f4f5);
	cursor: pointer;
	border-radius: 2px;
}

.bcs-cart-remove {
	margin-left: auto;
	background: none;
	border: none;
	color: var(--bcc-gray, #6b6f76);
	text-decoration: underline;
	cursor: pointer;
	font-family: var(--bcc-font-mono, monospace);
	font-size: 0.78rem;
}

.bcs-cart-footer {
	border-top: 1px solid var(--bcc-line, #e2e2e5);
	padding: 20px 24px 24px;
	flex: 0 1 auto;
	overflow-y: auto;
	-webkit-overflow-scrolling: touch;
	padding-bottom: calc(24px + env(safe-area-inset-bottom, 0px));
}

.bcs-cart-subtotal-row,
.bcs-cart-shipping-row {
	display: flex;
	justify-content: space-between;
	font-family: var(--bcc-font-mono, monospace);
	font-size: 0.85rem;
	color: var(--bcc-gray, #6b6f76);
	margin-bottom: 4px;
}

.bcs-cart-total-row {
	display: flex;
	justify-content: space-between;
	font-family: var(--bcc-font-mono, monospace);
	font-size: 1.05rem;
	font-weight: 600;
	padding-top: 8px;
	margin-bottom: 16px;
	border-top: 1px solid var(--bcc-line, #e2e2e5);
}

/* Delivery method picker */
.bcs-shipping-methods {
	border: 1px solid var(--bcc-line, #e2e2e5);
	border-radius: 2px;
	padding: 10px 12px 12px;
	margin: 4px 0 0;
}

.bcs-shipping-methods legend {
	font-family: var(--bcc-font-mono, monospace);
	font-size: 0.72rem;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--bcc-gray, #6b6f76);
	padding: 0 4px;
}

.bcs-ship-option {
	display: grid;
	grid-template-columns: auto 1fr auto;
	align-items: center;
	gap: 8px;
	padding: 7px 0;
	cursor: pointer;
	font-size: 0.88rem;
}

.bcs-ship-option + .bcs-ship-option {
	border-top: 1px dashed var(--bcc-line, #e2e2e5);
}

.bcs-ship-option.is-unpriced {
	opacity: 0.55;
	cursor: default;
}

.bcs-ship-option input[type="radio"] {
	width: auto;
	margin: 0;
}

.bcs-ship-price {
	font-family: var(--bcc-font-mono, monospace);
	font-size: 0.85rem;
	color: var(--bcc-magenta, #ff0072);
	white-space: nowrap;
}

.bcs-ship-note {
	grid-column: 2 / -1;
	font-size: 0.76rem;
	line-height: 1.4;
	color: var(--bcc-gray, #6b6f76);
}

.bcs-ship-hint,
.bcs-ship-loading {
	margin: 4px 0 0;
	font-size: 0.8rem;
	color: var(--bcc-gray, #6b6f76);
}

#bcs-address-fields {
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.bcs-checkout-form {
	display: flex;
	flex-direction: column;
	gap: 8px;
	margin-bottom: 12px;
}

.bcs-checkout-form input,
.bcs-checkout-form textarea {
	font-family: inherit;
	font-size: 0.9rem;
	padding: 9px 10px;
	border: 1px solid var(--bcc-line, #e2e2e5);
	border-radius: 2px;
	width: 100%;
	box-sizing: border-box;
}

.bcs-checkout-form textarea {
	min-height: 56px;
	resize: vertical;
}

.bcs-cart-message {
	font-size: 0.82rem;
	margin-bottom: 10px;
	min-height: 1em;
}

.bcs-cart-message--ok {
	color: var(--bcc-ink, #131417);
}

.bcs-cart-message--error {
	color: var(--bcc-magenta, #ff0072);
}

.bcs-checkout-buttons {
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.bcs-checkout-buttons .bcc-button {
	width: 100%;
}

.bcs-product-buy {
	display: flex;
	flex-direction: column;
	gap: 10px;
	align-items: flex-start;
}

.bcs-size-label {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	font-family: var(--bcc-font-mono, monospace);
	font-size: 0.82rem;
	color: var(--bcc-ink, #131417);
}

.bcs-size-select {
	font-family: inherit;
	font-size: 0.9rem;
	padding: 7px 10px;
	border: 1px solid var(--bcc-line, #e2e2e5);
	border-radius: 2px;
	background: var(--bcc-paper, #fff);
	color: var(--bcc-ink, #131417);
	cursor: pointer;
}

@media (max-width: 480px) {
	.bcs-cart-drawer {
		max-width: 100%;
	}
}

/* Roomier drawer on large desktop screens */
@media (min-width: 1200px) {
	.bcs-cart-drawer {
		max-width: 440px;
	}
}
