/*
Theme Name: Ceyloné
Description: Brands the WordPress-rendered pages (checkout, payment, order and account) to match the Next.js storefront. All other pages redirect to the storefront.
Version: 1.0.0
Requires PHP: 8.1
Text Domain: ceylone
*/

/* Brand palette and fonts, matching app/globals.css in the storefront. */
:root {
	--sky: #c0dae6;
	--ceylon: #5481c5;
	--coffee: #342821;
	--rose: #f3b5ae;
	--sunny: #fdf0b4;
	--olive: #988413;
	--script: "Sacramento", cursive;
	--sans: "Red Hat Display", system-ui, sans-serif;
	--line: rgba(52, 40, 33, 0.12);
	--line-strong: rgba(52, 40, 33, 0.6);
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
	display: flex;
	flex-direction: column;
	min-height: 100dvh;
	margin: 0;
	background: #fff;
	color: var(--coffee);
	font: 400 14px/1.5 var(--sans);
	-webkit-font-smoothing: antialiased;
}

a { color: inherit; }
img { max-width: 100%; height: auto; }
:focus-visible { outline: 2px solid var(--ceylon); outline-offset: 2px; }

.screen-reader-text {
	position: absolute !important;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip-path: inset(50%);
	white-space: nowrap;
}

/* ---- Announcement, header and footer ---- */
.c-announcement {
	padding: 8px 16px;
	background: var(--coffee);
	color: #fff;
	font-size: 12px;
	letter-spacing: 0.025em;
	text-align: center;
}

.c-header {
	position: sticky;
	top: 0;
	z-index: 30;
	display: grid;
	grid-template-columns: 1fr auto 1fr;
	align-items: center;
	height: 60px;
	padding: 0 20px;
	background: #fff;
}
.admin-bar .c-header { top: 32px; }

.c-nav { display: flex; gap: 32px; font-size: 13px; }
.c-nav a { text-decoration: none; transition: opacity 0.2s; }
.c-nav a:hover { opacity: 0.6; }
.c-nav__mobile { display: none; }

.c-logo { display: block; color: var(--ceylon); }
.c-logo svg { display: block; width: auto; height: 44px; }

.c-tools { display: flex; align-items: center; justify-content: flex-end; gap: 16px; }
.c-tools a { display: block; padding: 4px; }
.c-tools svg { display: block; width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.3; }

.c-footer { margin-top: auto; background: var(--sky); }
.c-footer__main { display: grid; grid-template-columns: 1fr 2fr; gap: 48px; padding: 80px 40px; }
.c-footer__logo { display: block; width: 320px; max-width: 100%; color: var(--ceylon); }
.c-footer__logo svg { display: block; width: 100%; height: auto; }
.c-footer__cols { display: grid; grid-template-columns: repeat(3, 1fr); gap: 40px; }
.c-footer h2 { margin: 0 0 16px; font-size: 13px; font-weight: 500; }
.c-footer ul { margin: 0; padding: 0; list-style: none; font-size: 13px; font-weight: 300; }
.c-footer li + li { margin-top: 10px; }
.c-footer a { text-decoration: none; }
.c-footer a:hover { text-decoration: underline; }
.c-footer__legal { display: flex; justify-content: space-between; gap: 16px; padding: 0 40px 24px; font-size: 12px; font-weight: 300; }

/* ---- Page layout ---- */
.c-main { width: 100%; max-width: 1240px; margin: 0 auto; padding: 40px 40px 80px; }
.c-title {
	margin: 0 0 28px;
	color: var(--ceylon);
	font: 400 60px/1.1 var(--script);
}
.c-backlink { display: inline-block; margin-bottom: 12px; font-size: 13px; font-weight: 300; text-decoration: none; }
.c-backlink:hover { text-decoration: underline; }

.c-main h2, .c-main h3 { font: 500 15px/1.4 var(--sans); }
.woocommerce-checkout .c-main h3,
#order_review_heading { margin: 0 0 16px; font: 400 40px/1.1 var(--script); color: var(--ceylon); }

/* ---- Buttons ---- */
.woocommerce .button,
.woocommerce a.button,
.woocommerce button.button,
.woocommerce input.button,
.woocommerce a.button.alt,
.woocommerce button.button.alt,
.woocommerce #payment #place_order,
.woocommerce-page #payment #place_order {
	padding: 14px 16px;
	border: 0;
	border-radius: 0;
	background: var(--coffee);
	color: #fff;
	font: 400 13px/1.4 var(--sans);
	text-align: left;
	text-decoration: none;
	transition: background-color 0.2s;
}
.woocommerce .button:hover,
.woocommerce a.button:hover,
.woocommerce button.button:hover,
.woocommerce a.button.alt:hover,
.woocommerce button.button.alt:hover,
.woocommerce #payment #place_order:hover { background: var(--ceylon); color: #fff; }
.woocommerce .button:disabled,
.woocommerce button.button:disabled[disabled],
.woocommerce button.button.alt:disabled[disabled] { background: var(--coffee); color: #fff; opacity: 0.6; }
.woocommerce #payment #place_order { width: 100%; float: none; }

/* ---- Form fields: underlined, like the storefront ---- */
.woocommerce form .form-row { margin: 0 0 18px; padding: 0; }
.woocommerce form .form-row label,
.woocommerce-page form .form-row label { margin-bottom: 2px; font-size: 13px; font-weight: 400; line-height: 1.5; }
.woocommerce form .form-row .input-text,
.woocommerce form .form-row select,
.woocommerce .input-text,
.select2-container--default .select2-selection--single {
	width: 100%;
	height: auto;
	padding: 8px 0;
	border: 0;
	border-bottom: 1px solid var(--line-strong);
	border-radius: 0;
	background: transparent;
	color: var(--coffee);
	font: 400 14px/1.5 var(--sans);
	box-shadow: none;
}
.woocommerce form .form-row textarea.input-text { min-height: 80px; }
.woocommerce form .form-row .input-text:focus,
.woocommerce form .form-row select:focus { outline: 0; border-bottom-color: var(--ceylon); }
.woocommerce form .form-row.woocommerce-invalid .input-text,
.woocommerce form .form-row.woocommerce-invalid select { border-color: #b4483b; }
.woocommerce form .form-row.woocommerce-validated .input-text { border-color: var(--line-strong); }
.woocommerce form .form-row .required { color: var(--ceylon); text-decoration: none; }
.select2-container .select2-selection--single .select2-selection__rendered { padding: 0; color: var(--coffee); line-height: 1.5; }
.select2-container--default .select2-selection--single .select2-selection__arrow { top: 6px; right: 0; }
.select2-dropdown { border-color: var(--line); border-radius: 0; font-family: var(--sans); }
.select2-container--default .select2-results__option--highlighted[aria-selected],
.select2-container--default .select2-results__option--highlighted[data-selected] { background: var(--ceylon); }
.woocommerce-form__label-for-checkbox { display: inline-flex; align-items: center; gap: 8px; }
.woocommerce form input[type="checkbox"], .woocommerce form input[type="radio"] { accent-color: var(--coffee); }

/* ---- Notices ---- */
.woocommerce-error,
.woocommerce-info,
.woocommerce-message,
.woocommerce .woocommerce-error,
.woocommerce .woocommerce-info,
.woocommerce .woocommerce-message {
	margin: 0 0 24px;
	padding: 12px 16px;
	border: 0;
	background: rgba(192, 218, 230, 0.35);
	color: var(--coffee);
	font-size: 13px;
	list-style: none;
}
.woocommerce-error, .woocommerce .woocommerce-error { background: rgba(243, 181, 174, 0.4); }
.woocommerce-error::before, .woocommerce-info::before, .woocommerce-message::before { display: none; }
.woocommerce-error li { margin: 0; }
.woocommerce-info a, .woocommerce-message a, .woocommerce-error a { text-decoration: underline; }
/* Notice actions read as text links. */
.woocommerce .woocommerce-info .button,
.woocommerce .woocommerce-message .button,
.woocommerce .woocommerce-info a.button,
.woocommerce .woocommerce-message a.button {
	display: inline-block;
	float: none;
	margin: 0 12px 0 0;
	padding: 0;
	background: none;
	color: inherit;
	font-weight: 500;
	text-decoration: underline;
}
.woocommerce .woocommerce-info .button:hover,
.woocommerce .woocommerce-message .button:hover,
.woocommerce .woocommerce-info a.button:hover,
.woocommerce .woocommerce-message a.button:hover { background: none; color: inherit; opacity: 0.65; }

/* ---- Tables ---- */
.woocommerce table.shop_table {
	width: 100%;
	margin: 0 0 24px;
	border: 0;
	border-collapse: collapse;
	border-radius: 0;
	font-size: 13px;
}
.woocommerce table.shop_table th,
.woocommerce table.shop_table td {
	padding: 12px 8px 12px 0;
	border: 0;
	border-top: 1px solid var(--line);
	font-weight: 300;
	text-align: left;
}
.woocommerce table.shop_table thead th { border-top: 0; font-weight: 500; }
.woocommerce table.shop_table tfoot th { font-weight: 400; }
.woocommerce table.shop_table tfoot .order-total th,
.woocommerce table.shop_table tfoot .order-total td { font-size: 14px; font-weight: 500; }
.woocommerce table.shop_table td.product-total,
.woocommerce table.shop_table th.product-total,
.woocommerce table.shop_table tfoot td { padding-right: 0; text-align: right; }
.woocommerce ul#shipping_method { margin: 0; padding: 0; text-align: right; }
.woocommerce ul#shipping_method li { margin: 0; padding: 0; }

/* ---- Checkout ---- */
.woocommerce-checkout form.checkout {
	display: grid;
	grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
	grid-template-rows: auto 1fr;
	column-gap: 64px;
}
.woocommerce-checkout #customer_details { grid-column: 1; grid-row: 1 / span 2; }
.woocommerce-checkout #customer_details .col-1,
.woocommerce-checkout #customer_details .col-2 { float: none; width: 100%; }
.woocommerce-checkout #customer_details .col-2 { margin-top: 32px; }
.woocommerce-checkout #order_review_heading { grid-column: 2; grid-row: 1; }
.woocommerce-checkout #order_review { grid-column: 2; grid-row: 2; align-self: start; position: sticky; top: 80px; }
.woocommerce-checkout .woocommerce-form-coupon-toggle .woocommerce-info,
.woocommerce-checkout .woocommerce-form-login-toggle .woocommerce-info { margin-bottom: 16px; }
.woocommerce form.checkout_coupon,
.woocommerce form.login,
.woocommerce form.register,
.woocommerce form.lost_reset_password {
	margin: 0 0 24px;
	padding: 0;
	border: 0;
	border-radius: 0;
}
.woocommerce form.checkout_coupon { display: flex; flex-wrap: wrap; gap: 16px; align-items: end; max-width: 480px; }
.woocommerce form.checkout_coupon p:first-child { flex-basis: 100%; margin: 0; }
.woocommerce form.checkout_coupon .form-row { flex: 1; width: auto; float: none; margin: 0; }
.woocommerce form.checkout_coupon .clear { display: none; }

/* Sub-headings that are really form controls stay in the sans face. */
.woocommerce-checkout .c-main h3#ship-to-different-address {
	margin: 0 0 24px;
	color: var(--coffee);
	font: 400 14px/1.5 var(--sans);
}
.woocommerce-checkout .woocommerce-additional-fields h3 { margin-top: 8px; }

/* Payment methods */
.woocommerce-checkout #payment, #add_payment_method #payment { border-radius: 0; background: transparent; }
.woocommerce-checkout #payment ul.payment_methods,
#add_payment_method #payment ul.payment_methods { padding: 0; border-bottom: 1px solid var(--line); }
.woocommerce-checkout #payment ul.payment_methods li { padding: 12px 0; border-top: 1px solid var(--line); line-height: 1.5; }
.woocommerce-checkout #payment ul.payment_methods li label { font-size: 13px; }
.woocommerce-checkout #payment div.payment_box,
#add_payment_method #payment div.payment_box {
	margin: 10px 0 0;
	padding: 10px 12px;
	border-radius: 0;
	background: rgba(192, 218, 230, 0.35);
	color: var(--coffee);
	font-size: 13px;
	font-weight: 300;
}
.woocommerce-checkout #payment div.payment_box::before,
#add_payment_method #payment div.payment_box::before { display: none; }
.woocommerce-checkout #payment div.form-row { padding: 16px 0 0; }
.woocommerce-privacy-policy-text { font-size: 12px; font-weight: 300; }

/* Order pay and order details */
.woocommerce ul.order_details { margin: 0 0 32px; padding: 0; list-style: none; }
.woocommerce ul.order_details li { margin: 0 24px 12px 0; padding: 0 24px 0 0; border-color: var(--line); font-size: 12px; font-weight: 300; }
.woocommerce ul.order_details li strong { font-size: 13px; font-weight: 500; }
.woocommerce address,
.woocommerce .woocommerce-customer-details address {
	padding: 0;
	border: 0;
	border-radius: 0;
	font-size: 13px;
	font-style: normal;
	font-weight: 300;
}

/* ---- Account ---- */
.woocommerce-account .woocommerce:has(.woocommerce-MyAccount-navigation) {
	display: grid;
	grid-template-columns: 220px minmax(0, 1fr);
	gap: 64px;
}
.woocommerce-account .woocommerce:has(.woocommerce-MyAccount-navigation) > * { grid-column: 1 / -1; }
.woocommerce-account .woocommerce:has(.woocommerce-MyAccount-navigation) > .woocommerce-MyAccount-navigation { grid-column: 1; }
.woocommerce-account .woocommerce:has(.woocommerce-MyAccount-navigation) > .woocommerce-MyAccount-content { grid-column: 2; }
.woocommerce-account .woocommerce-MyAccount-navigation,
.woocommerce-account .woocommerce-MyAccount-content { float: none; width: auto; }
.woocommerce-account .woocommerce::before, .woocommerce-account .woocommerce::after { display: none; }
.woocommerce-MyAccount-navigation ul { margin: 0; padding: 0; list-style: none; font-size: 13px; }
.woocommerce-MyAccount-navigation li { border-top: 1px solid var(--line); }
.woocommerce-MyAccount-navigation li:last-child { border-bottom: 1px solid var(--line); }
.woocommerce-MyAccount-navigation a { display: block; padding: 12px 0; font-weight: 300; text-decoration: none; }
.woocommerce-MyAccount-navigation a:hover { opacity: 0.6; }
.woocommerce-MyAccount-navigation .is-active a { font-weight: 500; }
.woocommerce-MyAccount-content { font-weight: 300; }
.woocommerce-MyAccount-content a:not(.button) { text-decoration: underline; }
.woocommerce-MyAccount-content strong { font-weight: 500; }
.woocommerce-Address-title h2, .woocommerce-Address-title h3 { font-size: 15px; font-weight: 500; }
.woocommerce-Address-title a.edit { font-size: 13px; }
.woocommerce-account fieldset { margin: 24px 0; padding: 0; border: 0; }
.woocommerce-account legend { padding: 0; font-weight: 500; }
.woocommerce-account .woocommerce-orders-table__cell-order-actions .button { padding: 8px 12px; margin: 0 4px 4px 0; }

/* Sign in and register */
.woocommerce-account #customer_login {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 64px;
	max-width: 900px;
}
.woocommerce-account #customer_login::before,
.woocommerce-account #customer_login::after { display: none; }
.woocommerce-account #customer_login .col-1,
.woocommerce-account #customer_login .col-2 { float: none; width: auto; }
.woocommerce-account #customer_login h2 { margin: 0 0 16px; color: var(--ceylon); font: 400 40px/1.1 var(--script); }
.woocommerce-account:not(.logged-in) .c-main > .woocommerce > form { max-width: 440px; }
.woocommerce-LostPassword { font-size: 13px; }
.woocommerce form .show-password-input { top: 8px; right: 0; }

/* ---- Small screens ---- */
@media (max-width: 1023px) {
	.c-header { padding: 0 16px; }
	.c-nav a { display: none; }
	.c-nav a.c-nav__mobile { display: block; }
	.c-main { padding: 28px 16px 56px; }
	.c-title { font-size: 48px; }
	.woocommerce-checkout form.checkout { display: block; }
	.woocommerce-checkout #order_review_heading { margin-top: 32px; }
	.woocommerce-checkout #order_review { position: static; }
	.woocommerce-account .woocommerce:has(.woocommerce-MyAccount-navigation) { display: block; }
	.woocommerce-MyAccount-navigation { margin-bottom: 32px; }
	.c-footer__main { grid-template-columns: 1fr; padding: 56px 16px; }
	.c-footer__logo { width: 224px; }
	.c-footer__legal { padding: 0 16px 24px; }
}
@media (max-width: 719px) {
	.woocommerce-account #customer_login { grid-template-columns: 1fr; gap: 32px; }
	.c-footer__cols { grid-template-columns: repeat(2, 1fr); }
	.woocommerce table.my_account_orders, .woocommerce-account .shop_table { font-size: 12px; }
}
@media (max-width: 782px) { .admin-bar .c-header { top: 46px; } }
