/*
 * What only the WordPress site needs, on top of site.css (the design, shared with the prototype).
 */

/* The owner is logged in: the WordPress admin bar is fixed on top, so the sticky header stops under it */
.admin-bar .site-header { top: calc(var(--wp-admin--admin-bar--height, 32px) - 37px); }

@media (max-width: 1160px) {
	.admin-bar .site-header { top: var(--wp-admin--admin-bar--height, 32px); }
}

/* On phones the admin bar scrolls away with the page */
@media (max-width: 600px) {
	.admin-bar .site-header { top: 0; }
}

/*
 * Pages that Kadence still draws (category, product, cart, checkout, account, 404) until we build our own.
 * Kadence paints the page light; here the page stays dark like ours, and Kadence's content (dark text)
 * stands on a white island, the way our shop pages are planned (white cards and checkout on the dark page).
 */
body { background: none; }
#wrapper { background: none; }

#saturs > .entry-hero,
#saturs > .content-area {
	width: calc(100% - 2 * var(--gutter));
	max-width: calc(var(--wrap) - 2 * var(--gutter));
	margin-inline: auto;
	color: #2D2438;
	background: #fff;
}

#saturs > .entry-hero { margin-top: 32px; border-radius: 20px 20px 0 0; }
#saturs > .content-area { margin-block: 32px 64px; border-radius: 20px; }
#saturs > .entry-hero + .content-area { margin-top: 0; border-radius: 0 0 20px 20px; }

/* site.css sets paragraphs and headings tight for its own blocks; Kadence's text needs its spacing back */
#saturs > .content-area p { margin: 0 0 1em; }
#saturs > .content-area :is(h1, h2, h3) { margin: 0 0 0.6em; }

/*
 * WooCommerce on our shop pages.
 */

/* Its messages («… added to your cart», errors): a calm dark bar above the page */
.shop-notices { padding-top: 20px; }
:is(.shop-notices, .woocommerce-NoticeGroup) :is(.woocommerce-message, .woocommerce-info, .woocommerce-error) {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 10px 16px;
	margin: 0;
	padding: 14px 18px;
	list-style: none;
	color: var(--text);
	background: var(--surface);
	border: 1px solid var(--line);
	border-radius: 14px;
}
:is(.shop-notices, .woocommerce-NoticeGroup) .woocommerce-error { border-color: var(--red); }
.shop-notices .button { order: 2; margin-left: auto; color: var(--orange); font-weight: 700; text-decoration: none; }

/* After adding, WooCommerce puts «View cart» next to the button; ours already leads to the cart (shop.js removes it) */
.added_to_cart { display: none; }

/* While the product is being added */
.btn.loading { opacity: 0.6; pointer-events: none; }

/* Subscriptions and databases: the way back to their section under the price */
.buy .card-link { margin-top: 24px; }

/*
 * The cart, the checkout and the cart drawer: WooCommerce's markup inside the prototype's design
 * (assets/css/drawer.css and checkout.css are copies of the prototype; what only the site needs is here).
 */

/* WooCommerce's text for screen readers only */
.screen-reader-text { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* No empty gap above the cart when there is no message */
.shop-notices:has(.woocommerce-notices-wrapper:empty) { padding-top: 0; }
.woocommerce-NoticeGroup { margin-bottom: 16px; }
.woocommerce-NoticeGroup .woocommerce-error { display: grid; gap: 6px; }
.woocommerce-NoticeGroup .woocommerce-error a { color: inherit; }

/* Fields: WooCommerce prints <p class="form-row field"><label><span class="woocommerce-input-wrapper"><input>.
   Our labels say «(необязательно)» themselves; no asterisks in the design */
.field .required, .field .optional { display: none; }
.field .woocommerce-input-wrapper { display: block; }
.field textarea { min-height: 104px; padding: 12px 14px; line-height: 1.5; resize: vertical; }
.field.woocommerce-invalid :is(input, select, textarea) { border-color: #D93025; }
.checkout-inline-error-message { margin: 0; color: #B3261E; font-size: 13px; font-weight: 700; }

/* The cart: the note between the total and the checkout button */
.cart_totals .cart-delivery-note { margin: 14px 0 18px; font-size: 14px; }

/* Delivery: the parcel machine field under a parcel machine choice */
.dw-locker { margin-top: 12px; }

/* «+ Комментарий к заказу» opens the comment field (no script: <details>) */
.co-note summary { list-style: none; }
.co-note summary::-webkit-details-marker { display: none; }
.co-note[open] summary { margin-bottom: 12px; }
.v1 .co-sections .co-note + section { padding-top: 30px; border-top: 1px solid var(--paper-line); }

/* «Быстрая оплата»: Stripe's Apple Pay / Google Pay / Link buttons over the form. Stripe's own «— OR —» line gives way
   to ours; while the block is hidden (no wallet on this device) the next section has no line over it */
.co-express .consent { margin-bottom: 14px; }
.express-slot { position: relative; }
#wc-stripe-express-checkout-element { margin-top: 0 !important; }
#wc-stripe-express-checkout-button-separator { display: none !important; }
.co-express.is-locked #wc-stripe-express-checkout-element { opacity: 0.45; }
.express-lock { position: absolute; top: 0; right: 0; bottom: 0; left: 0; z-index: 1; width: 100%; padding: 0; background: none; border: 0; cursor: not-allowed; }
.co-express:not(.is-locked) .express-lock { display: none; }
.co-or { margin-top: 18px; color: var(--ink-muted); font-size: 14px; font-weight: 600; text-align: center; }
.v1 .co-sections .co-express[hidden] + section { padding-top: 0; border-top: 0; }

/* Payment methods as cards; a gateway's own fields (Stripe's card form) open under its card */
.wc_payment_methods { margin: 0; padding: 0; list-style: none; }
.wc_payment_method { position: relative; }
.wc_payment_method > .input-radio { position: absolute; opacity: 0; pointer-events: none; }
.wc_payment_method > .choice { font-weight: 700; } /* Stripe's script leaves its title as plain text */
.wc_payment_method > .choice::before { content: ""; width: 20px; height: 20px; border: 2px solid #B9B0C7; border-radius: 50%; }
.wc_payment_method > .input-radio:checked + .choice { border-color: var(--ink); background: var(--paper-soft); }
.wc_payment_method > .input-radio:checked + .choice::before { border: 6px solid var(--ink); }
.wc_payment_method > .input-radio:focus-visible + .choice { outline: 3px solid var(--orange); outline-offset: 2px; }
.wc_payment_method .pay-icon img { width: auto; max-height: 24px; }
.payment_box { margin: 8px 0 4px; padding: 16px; color: var(--ink-muted); font-size: 14px; line-height: 1.5; background: var(--paper-soft); border-radius: 14px; }
.payment_box p { margin: 0; }
.payment_box fieldset { min-width: 0; margin: 0; padding: 0; border: 0; } /* Stripe's form sits in fieldsets: no browser frames */
.place-order { margin-top: 18px; }
.place-order .woocommerce-terms-and-conditions-wrapper { margin-bottom: 12px; font-size: 14px; }
.place-order .consent { margin-bottom: 14px; }
.legal a { color: inherit; }

/* PayPal's button in place of «Оплатить» (its plugin hides the inner block while another method is chosen) */
.ppc-button-wrapper > [id^="ppc-button"] { margin-top: 14px; }
.ppc-button-wrapper paypal-button { display: block; width: 100%; }

/* The drawer's inside comes from WooCommerce as one block: it fills the drawer under the title */
.drawer .widget_shopping_cart_content { display: flex; flex: 1; flex-direction: column; min-height: 0; }

/* The empty cart */
.wc-empty-cart-message p + p { margin-top: 6px; }
.empty-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 20px; }

/* The pages after the order (thank you, pay for an order) still show WooCommerce's markup on a white island */
.wc-island :is(h2, h3) { margin: 24px 0 12px; }
.wc-island p { margin: 0 0 1em; }
.wc-island table { width: 100%; border-collapse: collapse; }
.wc-island :is(th, td) { padding: 10px 0; text-align: left; border-bottom: 1px solid var(--paper-line); }
.wc-island ul.order_details { display: flex; flex-wrap: wrap; gap: 8px 28px; margin: 0 0 20px; padding: 0; list-style: none; }
.wc-island address { font-style: normal; line-height: 1.6; }
/* «Заказ принят»: our channels under the order (inc/checkout.php), the footer's buttons in the island's colours */
.wc-island .thanks-soc { margin-top: 32px; padding: 24px; border: 1px solid var(--paper-line); border-radius: 16px; }
.wc-island .thanks-soc h2 { margin: 0 0 6px; font-size: 20px; }
.wc-island .thanks-soc p { margin: 0 0 16px; color: var(--ink-muted); }
.wc-island .soc-btn { color: var(--ink); background: #fff; border-color: var(--paper-line); }

/*
 * «Мой аккаунт»: our frame (woocommerce/myaccount/my-account.php); WooCommerce's own pages inside it (orders, an order,
 * the address, the account details) on the white island. The garage and the login are styled in system.css.
 */
.co-account { margin-top: 16px; } /* «Создать аккаунт» under the address fields at checkout */
.sys > .shop-notices { padding: 0 0 16px; }
.sys > .shop-notices:has(.woocommerce-notices-wrapper:empty) { display: none; }

.wc-island .form-row { display: grid; gap: 6px; margin: 0 0 16px; }
.wc-island .form-row label { font-size: 14px; font-weight: 700; }
.wc-island .form-row .required { display: none; }
.wc-island .form-row :is(input.input-text, select, textarea) {
	width: 100%;
	min-height: var(--field-h);
	padding: 0 14px;
	color: var(--ink);
	font: 500 16px var(--font);
	background: var(--paper);
	border: 1.5px solid #D6CFE1;
	border-radius: 12px;
}
.wc-island .form-row :is(input, select, textarea):focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 3px rgba(20, 15, 28, 0.12); }
.wc-island .form-row :is(em, .description) { color: var(--ink-muted); font-size: 13px; font-style: normal; }
.wc-island .password-input { display: block; }
.wc-island fieldset { margin: 28px 0 8px; padding: 0; border: 0; }
.wc-island legend { margin-bottom: 14px; font-size: 18px; font-weight: 800; }
.wc-island :is(.button, .woocommerce-button) {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 40px;
	padding: 0 16px;
	color: var(--ink);
	font: 700 14px var(--font);
	text-decoration: none;
	background: var(--paper);
	border: 1.5px solid var(--paper-line);
	border-radius: 10px;
	cursor: pointer;
}
.wc-island button[type="submit"]:is(.button, .woocommerce-Button) { min-height: 52px; padding: 0 24px; color: var(--on-orange); font-size: 16px; background: var(--orange); border-color: var(--orange); border-radius: 12px; }
.wc-island .woocommerce-orders-table__cell-order-actions { text-align: right; }
.wc-island .woocommerce-orders-table__cell-order-actions .button + .button { margin-left: 6px; }
.wc-island mark { color: inherit; font-weight: 700; background: none; }
.wc-island .woocommerce-Address-title { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.wc-island .woocommerce-Address-title .edit { font-weight: 700; }

/* Phones: each order is a block of lines «Заказ … №1336» instead of a table wider than the screen */
@media (max-width: 640px) {
	.wc-island .shop_table_responsive thead { display: none; }
	.wc-island .shop_table_responsive tr { display: grid; padding: 10px 0; border-bottom: 1px solid var(--paper-line); }
	.wc-island .shop_table_responsive :is(th, td) { display: flex; justify-content: space-between; gap: 12px; padding: 4px 0; text-align: right; border: 0; }
	.wc-island .shop_table_responsive :is(th, td)[data-title]::before { content: attr(data-title); color: var(--ink-muted); font-weight: 700; text-align: left; }
	.wc-island .woocommerce-orders-table__cell-order-actions { justify-content: flex-end; }
}

/* The gap before «(необязательно)»: on translated pages TranslatePress trims a space there */
[id$="_address_2_field"] .opt { margin-left: 0.3em; }
