/*
 * WordPress / WooCommerce / Blocksy bridges for the approved design.
 * Keeps theme CSS decoupled from plugin markup: WC prices, add-to-cart,
 * notices, the account disclosure, the mobile sheet and Blocksy chrome.
 */

/* Blocksy canvas around the custom homepage chrome */
body.pharmacy-modern [class*="ct-container"] .wrap,
body.pharmacy-modern #main {
	min-inline-size:0;
}

/* Product photos ship on white; blend into tinted tiles without boxes. */
body.pharmacy-modern .category-photo img {
	mix-blend-mode:multiply;
}
body.pharmacy-modern .product-media-fallback {
	display:grid;
	place-items:center;
	inline-size:64px;
	block-size:64px;
	border-radius:20px;
	background:var(--white);
	color:var(--primary);
	box-shadow:0 10px 20px var(--shadow-soft-color);
}
body.pharmacy-modern .product-media-fallback svg {
	inline-size:28px;
	block-size:28px;
	stroke-width:1.6;
}
body.pharmacy-modern .hero-empty-art {
	position:absolute;
	inset-inline:12%;
	inset-block-start:90px;
	block-size:240px;
}
body.pharmacy-modern .hero-cross {
	display:grid;
	place-items:center;
	position:absolute;
	inset-inline-start:32%;
	inset-block-start:28px;
	inline-size:150px;
	block-size:170px;
	border-radius:var(--radius-32);
	background:var(--white);
	color:var(--primary);
	box-shadow:0 24px 36px #02312b40;
	transform:rotate(-9deg);
}
body.pharmacy-modern .hero-cross svg {
	inline-size:80px;
	block-size:80px;
}
body.pharmacy-modern .hero-leaf {
	display:grid;
	place-items:center;
	position:absolute;
	inset-inline-start:0;
	inset-block-start:0;
	inline-size:106px;
	block-size:126px;
	background:var(--mint);
	color:var(--primary-deep);
	border-radius:var(--radius-hero);
	transform:rotate(9deg);
}
body.pharmacy-modern .hero-leaf svg {
	inline-size:52px;
	block-size:52px;
}

/* WooCommerce price/label rendering inside the approved card */
body.pharmacy-modern .tabs a {
	display:flex;
	align-items:center;
}
body.pharmacy-modern .product-card { display:flex; flex-direction:column; }
body.pharmacy-modern .product-card h3 { overflow-wrap:anywhere; }
body.pharmacy-modern .woocommerce-Price-amount { white-space:nowrap; unicode-bidi:isolate; }
body.pharmacy-modern .price ins { text-decoration:none; background:none; }
body.pharmacy-modern .product-price del { text-decoration-color:currentColor; }

/* Native loop add-to-cart styling (AJAX-aware). */
body.pharmacy-modern .product-action .button {
	display:flex;
	inline-size:100%;
	justify-content:center;
	align-items:center;
	gap:8px;
	min-block-size:var(--control-h);
	border:0;
	border-radius:var(--control);
	color:var(--white);
	background:var(--mint);
	color:var(--primary-deep);
	font-family:inherit;
	font-size:var(--s14);
	font-weight:700;
	padding:8px 12px;
	line-height:1.8;
	transition:background var(--motion),color var(--motion),box-shadow var(--motion);
}
body.pharmacy-modern .product-action .button:hover {
	background:var(--primary);
	color:var(--white);
	box-shadow:0 10px 20px var(--shadow-accent-color);
}
body.pharmacy-modern .product-action .button.loading {
	opacity:.6;
	cursor:progress;
}
/* WooCommerce switches OOS loop buttons to "اطلاعات بیشتر"; present as read-only. */
body.pharmacy-modern .product-out .product-action .button {
	background:var(--white);
	color:var(--muted);
	border:1px solid var(--border);
	font-weight:600;
}
body.pharmacy-modern .product-out .product-action .button:hover {
	background:var(--soft);
	color:var(--navy);
	border-color:var(--border-strong);
	box-shadow:none;
}
body.pharmacy-modern .product-action .added_to_cart {
	display:flex;
	align-items:center;
	justify-content:center;
	inline-size:100%;
	text-align:center;
	min-block-size:var(--control-h);
	padding:8px 12px;
	border:0;
	border-radius:var(--control);
	background:var(--primary);
	color:var(--white);
	font-size:var(--s14);
	font-weight:700;
	line-height:1.8;
}
/* Native AJAX appends the cart link: use the same action slot, not a second row. */
body.pharmacy-modern .product-action:has(> .added_to_cart) > .button.added {
	display:none;
}
body.pharmacy-modern .product-action .added_to_cart::before {
	display:none;
}
body.pharmacy-modern .product-action .added_to_cart:hover {
	background:var(--primary-deep);
	color:var(--white);
}

/* Empty states */
body.pharmacy-modern .empty-state h3 { font-size:var(--s16); font-weight:650; }
body.pharmacy-modern .empty-state p { color:var(--muted); font-size:var(--s14); line-height:1.9; }
body.pharmacy-modern .category-empty { display:flex; align-items:center; gap:24px; padding:32px; }
body.pharmacy-modern .category-empty > svg { inline-size:36px; block-size:36px; color:var(--primary); }
body.pharmacy-modern .category-empty > div { flex:1; }
body.pharmacy-modern .product-empty {
	display:grid;
	justify-items:center;
	text-align:center;
	gap:12px;
	min-block-size:280px;
	padding:40px;
	background:linear-gradient(165deg,#fbfdfc,var(--mint-soft));
}
body.pharmacy-modern .product-empty p { color:var(--muted); max-inline-size:560px; }
body.pharmacy-modern .empty-icon {
	display:grid;
	place-items:center;
	inline-size:56px;
	block-size:56px;
	border-radius:var(--radius);
	background:var(--white);
	color:var(--primary);
	box-shadow:var(--shadow-soft);
}
body.pharmacy-modern .empty-icon svg { inline-size:26px; block-size:26px; }

/* Accessible mobile sheet driven by native <dialog>. */
body.pharmacy-modern .pharmacy-menu-dialog {
	color:var(--navy);
	background:var(--white);
	padding:0;
	border:0;
	margin:0;
	inset-inline-start:0;
	inset-inline-end:auto;
	inset-block:0;
	inline-size:min(88vw,360px);
	max-inline-size:none;
	block-size:100dvh;
	max-block-size:100dvh;
	border-start-end-radius:24px;
	border-end-end-radius:24px;
	box-shadow:var(--shadow);
}
body.pharmacy-modern .pharmacy-menu-dialog::backdrop { background:var(--overlay-color); }
body.pharmacy-modern .pharmacy-menu-heading {
	display:flex;
	align-items:center;
	justify-content:space-between;
	padding:20px;
	border-block-end:1px solid var(--border);
}
body.pharmacy-modern .pharmacy-menu-close {
	font-size:26px;
	background:var(--soft);
	color:var(--navy);
}
body.pharmacy-modern .pharmacy-menu-dialog .navigation {
	display:flex;
	flex-direction:column;
	align-items:stretch;
	gap:8px;
	inline-size:auto;
	max-inline-size:none;
	margin:0;
	padding:20px;
	border:0;
}
body.pharmacy-modern .pharmacy-menu-dialog .navigation a {
	display:flex;
	max-inline-size:none;
	margin:0;
	padding:12px 14px;
	min-block-size:var(--control-h);
	border:1px solid var(--border);
	border-radius:var(--control);
	color:var(--navy);
}
body.pharmacy-modern .pharmacy-menu-dialog .navigation a:hover { color:var(--primary); border-color:var(--border-accent); }
body.pharmacy-modern .pharmacy-menu-dialog .navigation a.nav-guide { margin:0; display:flex!important; }
body.pharmacy-modern.pharmacy-menu-open { overflow:hidden; }

/* Native account disclosure (reused across the storefront). */
body.pharmacy-modern .pharmacy-account-menu { position:relative; }
body.pharmacy-modern .pharmacy-account-menu summary {
	list-style:none;
	cursor:pointer;
	border-radius:var(--radius-sm);
	padding:4px 8px;
	display:inline-flex;
	align-items:center;
	gap:6px;
}
body.pharmacy-modern .pharmacy-account-menu summary::-webkit-details-marker { display:none; }
body.pharmacy-modern .pharmacy-account-menu summary > svg:last-child { inline-size:16px; }
body.pharmacy-modern .pharmacy-account-menu[open] summary { background:var(--mint); color:var(--primary); }
body.pharmacy-modern .pharmacy-account-menu nav {
	position:absolute;
	z-index:30;
	inset-block-start:calc(100% + 10px);
	inset-inline-start:0;
	inset-inline-end:auto;
	inline-size:212px;
	padding:8px;
	border:1px solid var(--border);
	border-radius:var(--radius);
	background:var(--white);
	box-shadow:var(--shadow);
}
body.pharmacy-modern .pharmacy-account-menu nav a {
	display:flex;
	align-items:center;
	min-block-size:var(--control-h-sm);
	padding:8px 12px;
	border-radius:var(--radius-xs);
	font-size:var(--s14);
	color:var(--navy);
}
body.pharmacy-modern .pharmacy-account-menu nav a:hover { background:var(--mint); color:var(--primary); }
body.pharmacy-modern .pharmacy-account-menu nav a:last-child {
	color:var(--danger);
	border-block-start:1px solid var(--border);
	margin-block-start:4px;
}

/* Catalog card rhythm (shop archive and related products). */
/* One unavailable state for the shared homepage, archive and related-product card. */
body.pharmacy-modern :is(#pharmacy-sale,#pharmacy-products,.products) .product-card.product-out {
	border:1px solid var(--border);
	box-shadow:none;
}
body.pharmacy-modern :is(#pharmacy-sale,#pharmacy-products,.products) .product-card.product-out:hover {
	border-color:var(--border-strong);
	box-shadow:none;
	transform:none;
}
body.pharmacy-modern :is(#pharmacy-sale,#pharmacy-products,.products) .product-out .product-media {
	background:var(--neutral-soft);
}
body.pharmacy-modern :is(#pharmacy-sale,#pharmacy-products,.products) .product-out .product-media img {
	filter:grayscale(100%);
	opacity:.76;
	mix-blend-mode:multiply;
}
body.pharmacy-modern .product-unavailable-badge {
	position:absolute;
	inset-block-start:var(--space-2);
	inset-inline-start:var(--space-2);
	z-index:1;
	padding:4px 12px;
	border-radius:6px;
	background:var(--neutral-text);
	color:var(--white);
	font-size:var(--text-xs);
	font-weight:700;
	line-height:1.8;
}
body.pharmacy-modern :is(#pharmacy-sale,#pharmacy-products,.products) .product-out .product-price :is(.price,.sale-price,ins) {
	color:var(--neutral-text);
}
body.pharmacy-modern :is(#pharmacy-sale,#pharmacy-products,.products) .product-out .product-price del {
	display:none;
}
body.pharmacy-modern :is(#pharmacy-sale,#pharmacy-products,.products) .product-out .product-action .product-details {
	min-block-size:44px;
	border:1px solid var(--border-strong);
	background:var(--soft);
	color:var(--navy);
	box-shadow:none;
}
body.pharmacy-modern :is(#pharmacy-sale,#pharmacy-products,.products) .product-out .product-action .product-details:hover {
	background:var(--neutral-soft);
	color:var(--navy);
	box-shadow:none;
}
body.pharmacy-modern .product-out :is(.product-media,h3 a,.product-details):focus-visible {
	outline:2px solid var(--primary);
	outline-offset:3px;
}

body.pharmacy-shop .product-card h3,
body.pharmacy-single .product-card h3 {
	min-block-size:var(--control-h);
	font-size:var(--s14);
	font-weight:650;
	line-height:1.8;
}
body.pharmacy-shop .product-card .product-price,
body.pharmacy-single .product-card .product-price { margin-block-end:12px; }
@media(max-width:600px) {
	body.pharmacy-modern #coming-soon-footer-banner { position:static; }
	body.pharmacy-shop .product-card h3,
	body.pharmacy-single .product-card h3 { min-block-size:64px; font-size:var(--s12); }
}

@media(max-width:900px) {
	body.pharmacy-modern .hero-empty-art { inset-inline:4%; }
	body.pharmacy-modern .hero-cross { inline-size:118px; block-size:140px; }
	body.pharmacy-modern .hero-leaf { inline-size:86px; block-size:108px; }
}
@media(max-width:600px) {
	body.pharmacy-modern .hero-empty-art { inset-block-start:24px; inset-inline:14%; }
}
/* Product-card refinement only: retain the approved home grids and sale context. */
body.pharmacy-modern .pharmacy-home :is(#pharmacy-sale,#pharmacy-products) .product-card { border-radius:14px; overflow:visible; }
body.pharmacy-modern .pharmacy-home :is(#pharmacy-sale,#pharmacy-products) .product-media { background:var(--white); padding:26px 10px 10px; border-radius:10px; }
body.pharmacy-modern .pharmacy-home :is(#pharmacy-sale,#pharmacy-products) .product-media img { inline-size:auto; block-size:auto; max-inline-size:100%; max-block-size:100%; object-fit:contain; padding:0; mix-blend-mode:normal; }
body.pharmacy-modern .pharmacy-home :is(#pharmacy-sale,#pharmacy-products) .product-info { display:flex; flex-direction:column; flex:1; }
body.pharmacy-modern .pharmacy-home :is(#pharmacy-sale,#pharmacy-products) .product-meta { position:static; display:flex; flex-wrap:wrap; align-items:center; justify-content:space-between; max-inline-size:none; min-block-size:24px; margin-block:6px; font-size:12px; gap:4px 8px; }
body.pharmacy-modern .pharmacy-home :is(#pharmacy-sale,#pharmacy-products) .product-brand { color:var(--neutral-text); font-size:12px; }
body.pharmacy-modern .pharmacy-home :is(#pharmacy-sale,#pharmacy-products) .product-status { color:var(--primary-deep); font-size:11px; }
body.pharmacy-modern .pharmacy-home :is(#pharmacy-sale,#pharmacy-products) .product-card h3 { font-weight:700; line-height:1.9; min-block-size:3.8em; margin-block:0 12px; }
body.pharmacy-modern .pharmacy-home :is(#pharmacy-sale,#pharmacy-products) .product-price { margin-block-start:auto; text-align:end; }
body.pharmacy-modern .pharmacy-home :is(#pharmacy-sale,#pharmacy-products) .product-price :is(.price,.sale-price) { align-items:flex-end; font-variant-numeric:tabular-nums; }
body.pharmacy-modern .pharmacy-home :is(#pharmacy-sale,#pharmacy-products) .product-price del { color:var(--neutral-text); }
body.pharmacy-modern .pharmacy-home :is(#pharmacy-sale,#pharmacy-products) .product-sale-badge { background:var(--primary); color:var(--white); border-radius:6px; box-shadow:none; }
body.pharmacy-modern .pharmacy-home :is(#pharmacy-sale,#pharmacy-products) .product-action .button { min-block-size:46px; font-size:13px; box-shadow:none; }
body.pharmacy-modern .pharmacy-home :is(#pharmacy-sale,#pharmacy-products) .product-out .product-media img { opacity:1; filter:grayscale(1); }
body.pharmacy-modern .pharmacy-home :is(#pharmacy-sale,#pharmacy-products) .product-unavailable-badge { background:var(--neutral-soft); color:var(--neutral-text); }
@media(max-width:600px) {
 body.pharmacy-modern .pharmacy-home :is(#pharmacy-sale,#pharmacy-products) .product-card h3 { min-block-size:5.7em; font-size:14px; }
 body.pharmacy-modern .pharmacy-home :is(#pharmacy-sale,#pharmacy-products) .product-action .button { font-size:12px; padding-inline:3px; }
}
@media(prefers-reduced-motion:reduce) { body.pharmacy-modern .pharmacy-home :is(#pharmacy-sale,#pharmacy-products) .product-card,body.pharmacy-modern .pharmacy-home :is(#pharmacy-sale,#pharmacy-products) .product-card * { transition:none; } }

/* Keep discovery-card prices close to their complete, wrapping titles. */
body.pharmacy-modern .pharmacy-home :is(#pharmacy-sale,#pharmacy-newest,#pharmacy-products) .product-card h3 { min-block-size:0; margin-block:0 8px; }
body.pharmacy-modern .pharmacy-home :is(#pharmacy-sale,#pharmacy-newest,#pharmacy-products) .product-price { min-block-size:0; padding-block-start:0; margin-block-start:0; }
body.pharmacy-modern .pharmacy-home :is(#pharmacy-sale,#pharmacy-newest,#pharmacy-products) .product-action { margin-block-start:auto; }
@media(max-width:600px) {
 body.pharmacy-modern .pharmacy-home .trust-strip ul { gap:8px; }
 body.pharmacy-modern .pharmacy-home .trust-strip li { padding:10px 8px; gap:8px; align-items:center; }
 body.pharmacy-modern .pharmacy-home .trust-icon { inline-size:28px; block-size:28px; flex-basis:28px; }
 body.pharmacy-modern .pharmacy-home .trust-icon svg { inline-size:16px; block-size:16px; }
 body.pharmacy-modern .pharmacy-home .trust-copy strong { font-size:11px; }
 body.pharmacy-modern .pharmacy-home .trust-copy span { font-size:10px; }
}
