/*
Theme Name: Sari-Sari
Theme URI: https://sarisari.se
Description: Webbshop för Sari-Sari, Mabuhays asiatiska livsmedelsbutik. Barntema till Mabuhay – samma färger och typsnitt, med WooCommerce.
Template: mabuhay
Version: 1.0.0
Requires at least: 6.5
Requires PHP: 8.1
License: GPL-2.0-or-later
Text Domain: sarisari
*/

/* Shop styles on top of the Mabuhay parent theme. */

/* ---------- Header ---------- */
.ss-header__row { gap: 1.5rem; }
.ss-header__actions { flex-shrink: 0; }
.ss-search { flex: 1 1 auto; max-width: 440px; }
.ss-search .wp-block-search__inside-wrapper {
	border: 1px solid var(--wp--preset--color--line) !important;
	border-radius: 999px;
	background: var(--wp--preset--color--white);
	padding: 3px !important;
}
.ss-search .wp-block-search__input { border: 0; background: transparent; padding: 0.55rem 1rem; font: inherit; font-size: 0.95rem; }
.ss-search .wp-block-search__input:focus { outline: none; }
.ss-search .wp-block-search__inside-wrapper:focus-within { outline: 2px solid var(--wp--preset--color--gold); outline-offset: 1px; }
.ss-search .wp-block-search__button {
	margin: 0;
	border-radius: 999px;
	padding: 0.45rem 0.8rem;
	background: var(--wp--preset--color--forest);
	color: var(--wp--preset--color--white);
}
.ss-header .wc-block-customer-account a { color: var(--wp--preset--color--forest); }
.ss-header .wc-block-mini-cart__button { padding: 0.4rem; }
.ss-header .wc-block-mini-cart__badge { font-weight: 700; }

/* Striped "sari-sari store" awning under the header and the hero */
.ss-header { border-bottom: 0 !important; }
.ss-header::after,
.ss-awning {
	content: "";
	display: block;
	height: 6px;
	background: repeating-linear-gradient(90deg,
		var(--wp--preset--color--chili) 0 28px,
		var(--wp--preset--color--sand) 28px 56px,
		var(--wp--preset--color--gold) 56px 84px,
		var(--wp--preset--color--sand) 84px 112px);
}
.ss-header::after { position: absolute; left: 0; right: 0; bottom: -6px; }
.ss-awning {
	height: 18px;
	margin: 0 !important;
	-webkit-mask: radial-gradient(14px at 50% 0, #000 98%, #0000) 0 0 / 28px 18px repeat-x;
	mask: radial-gradient(14px at 50% 0, #000 98%, #0000) 0 0 / 28px 18px repeat-x;
}

/* ---------- Front page ---------- */
.ss-hero h1 { max-width: 14ch; }
.ss-hero h1 em { color: var(--wp--preset--color--gold-light); font-weight: 500; }
.ss-hero .ss-button-ghost .wp-block-button__link { color: var(--wp--preset--color--white); border-color: #ffffff80; }
.ss-hero .ss-button-ghost .wp-block-button__link:hover { background: #ffffff1a; }
.ss-hero .ss-button-light .wp-block-button__link:hover { background: var(--wp--preset--color--white) !important; color: var(--wp--preset--color--ink) !important; }

.ss-hero__card {
	list-style: none;
	margin: 0;
	padding: 0.6rem 1.6rem;
	border-radius: 18px;
	background: #ffffff12;
	border: 1px solid #ffffff26;
}
.ss-hero__card li { display: flex; gap: 1rem; align-items: flex-start; padding: 1rem 0; }
.ss-hero__card li + li { border-top: 1px solid #ffffff1f; }
.ss-hero__card li > span:first-child { font-size: 1.6rem; line-height: 1; }
.ss-hero__card strong { display: block; color: var(--wp--preset--color--gold-light); font-size: 1.02rem; }
.ss-hero__card li > span:last-child { color: #ffffffcc; font-size: 0.95rem; line-height: 1.5; }

.ss-categories {
	list-style: none;
	padding: 0;
	margin: var(--wp--preset--spacing--40) 0 0;
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
	gap: 1rem;
}
.ss-categories li { display: flex; margin: 0; }
.ss-category {
	flex: 1;
	height: auto;
	box-sizing: border-box;
	display: flex;
	flex-direction: column;
	gap: 0.15rem;
	text-decoration: none;
	color: var(--wp--preset--color--ink);
	transition: transform 0.2s ease, border-color 0.2s ease;
}
.ss-category:hover { transform: translateY(-2px); border-color: var(--wp--preset--color--gold); color: var(--wp--preset--color--forest); }
.ss-category__name { font-family: var(--wp--preset--font-family--display); font-weight: 600; font-size: 1.15rem; line-height: 1.25; hyphens: auto; }
.ss-category__count { font-size: 0.85rem; color: var(--wp--preset--color--muted); }

/* ---------- Product cards (front page, shop, category, search) ---------- */
.wc-block-product-template > li.wc-block-product,
.wc-block-product-template > li.product {
	display: flex;
	flex-direction: column;
	padding: 0.8rem 0.8rem 1.1rem;
	border-radius: 16px;
	background: var(--wp--preset--color--white);
	border: 1px solid var(--wp--preset--color--line);
	box-shadow: 0 1px 2px rgb(16 40 36 / 0.04);
	transition: box-shadow 0.2s ease, transform 0.2s ease;
}
.wc-block-product-template > li.wc-block-product:hover { transform: translateY(-2px); box-shadow: 0 18px 34px -22px rgb(16 40 36 / 0.4); }
.wc-block-product-template .wc-block-components-product-image {
	border-radius: 12px;
	overflow: hidden;
	background: var(--wp--preset--color--sand);
	margin-bottom: 0 !important;
}
.wc-block-product-template .wc-block-components-product-image img { aspect-ratio: 1; object-fit: cover; }
.wc-block-product-template .wp-block-post-title { font-family: var(--wp--preset--font-family--body); font-weight: 600; line-height: 1.3; }
.wc-block-product-template .wp-block-post-title a { text-decoration: none; color: var(--wp--preset--color--ink); }
.wc-block-product-template .wp-block-post-title a:hover { color: var(--wp--preset--color--forest); }
.wc-block-product-template .wc-block-components-product-button { margin-top: auto !important; padding-top: 0.75rem; }
.wc-block-product-template .wc-block-components-product-button .wp-block-button__link { width: 100%; padding: 0.65rem 1rem; }
.wc-block-components-product-button .added_to_cart { font-size: 0.85rem; margin-top: 0.4rem; }

/* Comparison price (Jämförpris) appended to the price by the sarisari-butik plugin */
.ss-unit-price {
	display: block;
	margin-top: 0.15rem;
	font-size: 0.8rem;
	font-weight: 400;
	color: var(--wp--preset--color--muted);
}
.wc-block-components-product-price del { color: var(--wp--preset--color--muted); font-weight: 400; }
.wc-block-components-product-price ins { text-decoration: none; color: var(--wp--preset--color--chili); }

.wc-block-components-product-sale-badge {
	font-size: 0.75rem !important;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	padding: 0.25rem 0.7rem !important;
}

/* ---------- Single product ---------- */
.single-product .wp-block-woocommerce-product-image-gallery img,
.single-product .woocommerce-product-gallery img { border-radius: 18px; background: var(--wp--preset--color--sand); }
.single-product .wp-block-woocommerce-product-price { font-size: 1.6rem; }
.single-product .wp-block-woocommerce-product-price .ss-unit-price { font-size: 0.9rem; }
.single-product .quantity .qty {
	border: 1px solid var(--wp--preset--color--line);
	border-radius: 999px;
	padding: 0.7rem 0.5rem;
	font: inherit;
	width: 4.5rem;
	text-align: center;
}
.wp-block-woocommerce-product-details .wc-tabs { border-bottom: 1px solid var(--wp--preset--color--line); }
.wp-block-woocommerce-product-details .wc-tabs li a { text-decoration: none; }
.wp-block-woocommerce-product-details .wc-tabs li.active a { box-shadow: inset 0 -2px 0 var(--wp--preset--color--gold); }

/* Stock status */
.stock.in-stock { color: var(--wp--preset--color--forest); font-weight: 600; }
.stock.out-of-stock { color: var(--wp--preset--color--chili); font-weight: 600; }

/* ---------- Cart, checkout and notices ---------- */
.wc-block-components-notice-banner { border-radius: 12px; }
.wc-block-components-text-input input,
.wc-block-components-combobox .components-combobox-control__input,
.wc-blocks-components-select .wc-blocks-components-select__select,
.wc-block-components-textarea { border-radius: 10px !important; }
.wc-block-components-button:not(.is-link) { border-radius: 999px; }
.wc-block-components-checkout-place-order-button,
.wc-block-cart__submit-button { font-weight: 600; }
.wc-block-components-radio-control__option-checked,
.wc-block-components-radio-control-accordion-option--checked-option-highlighted { box-shadow: inset 0 0 0 2px var(--wp--preset--color--forest) !important; }

/* Breadcrumbs and result count on the catalogue */
.woocommerce-breadcrumb { font-size: 0.9rem; color: var(--wp--preset--color--muted); }
.woocommerce-breadcrumb a { text-decoration: none; }

/* ---------- Footer ---------- */
.ss-payments { display: flex; gap: 0.5rem; margin-top: 1.25rem !important; }
.ss-payments li {
	margin: 0 !important;
	padding: 0.3rem 0.9rem;
	border-radius: 8px;
	background: #ffffff14;
	border: 1px solid #ffffff2e;
	font-size: 0.85rem;
	font-weight: 700;
	letter-spacing: 0.04em;
}

/* ---------- Small screens ---------- */
@media (max-width: 781px) {
	.ss-header__row { flex-wrap: wrap !important; row-gap: 0.75rem; }
	.ss-search { order: 3; flex-basis: 100%; max-width: none; }
	.ss-header__actions { margin-left: auto; }
	.ss-hero h1 { max-width: none; }
}
@media (max-width: 600px) {
	.mb-topbar .wp-block-group > p:first-child { display: none; }
	.ss-categories { grid-template-columns: repeat(2, 1fr); gap: 0.75rem; }
	.ss-header__actions { gap: 0.9rem !important; }
}
@media (prefers-reduced-motion: reduce) {
	.ss-category, .ss-category:hover,
	.wc-block-product-template > li.wc-block-product:hover { transition: none; transform: none; }
}
