/* Cardify responsive rules. Tested widths: 360, 390, 430, 768, 1024, desktop. */

@media (max-width: 1100px) {
	.header-search { width: 200px; }
	.grid-4 { grid-template-columns: repeat(2, 1fr); }
	.post-grid { grid-template-columns: repeat(2, 1fr); }
	.footer-grid { grid-template-columns: 1fr 1fr; }
	body.woocommerce-cart .woocommerce { grid-template-columns: minmax(0, 1fr); }
	.hero h1 { font-size: 2.5rem; }
}

/* Tablet and below: hamburger menu, single-column layouts */
@media (max-width: 900px) {
	.nav-toggle { display: inline-flex; }
	.main-nav { display: none; position: absolute; top: 100%; left: 0; right: 0; background: var(--primary); border-top: 1px solid rgba(255,255,255,.12); padding: 8px var(--margin) 16px; box-shadow: 0 12px 24px rgba(0,0,0,.2); }
	.nav-open .main-nav { display: block; }
	.main-nav { flex-direction: column; align-items: stretch; gap: 0; }
	.main-nav .menu { flex-direction: column; gap: 0; }
	.cat-toggle { width: 100%; justify-content: space-between; min-height: 48px; padding: 14px 8px; border-radius: 8px; }
	.cat-menu { position: static; min-width: 0; max-height: none; margin: 0 0 8px; background: rgba(255,255,255,.06); border: 0; box-shadow: none; }
	.main-nav .cat-menu a { color: rgba(255,255,255,.88); min-height: 44px; }
	.main-nav .cat-menu a:hover, .main-nav .cat-menu a[aria-current] { background: rgba(255,255,255,.1); color: var(--white); }
	.main-nav .cat-menu .all a { color: var(--accent); }
	.main-nav .cat-menu .all { border-top-color: rgba(255,255,255,.14); }
	.main-nav a { padding: 14px 8px; min-height: 48px; }
	.header-inner { position: relative; }
	.search-toggle { display: inline-flex; }
	.header-search { display: none; position: absolute; top: 100%; left: 0; right: 0; width: auto; padding: 12px var(--margin); background: var(--primary); border-top: 1px solid rgba(255,255,255,.12); box-shadow: 0 12px 24px rgba(0,0,0,.2); }
	.search-open .header-search { display: block; }
	.hero-inner, .contact-grid, div.product, form.checkout, body.woocommerce-account.logged-in .woocommerce, .u-columns.col2-set { grid-template-columns: minmax(0, 1fr); }
	.hero-inner { gap: 28px; }
	div.product { gap: 24px; }
	#customer_details, #order_review_heading, #order_review { grid-column: 1; grid-row: auto; }
	#customer_details { margin-bottom: var(--gap); }
	.grid-3 { grid-template-columns: minmax(0, 1fr); }
	.woocommerce-MyAccount-navigation ul { display: flex; flex-wrap: wrap; gap: 6px; }
	.woocommerce-MyAccount-navigation li { flex: 1 1 calc(50% - 6px); }
}

/* Responsive tables (cart, orders): rows become stacked cards */
@media (max-width: 768px) {
	table.shop_table_responsive thead { display: none; }
	table.shop_table_responsive tr { display: block; border-bottom: 1px solid var(--line); padding: 8px 0; }
	table.shop_table_responsive tr:last-child { border-bottom: 0; }
	table.shop_table_responsive td, table.shop_table_responsive th { display: flex; align-items: center; justify-content: space-between; gap: 12px; border: 0; text-align: right; padding: 8px 16px; }
	table.shop_table_responsive td[data-title]::before { content: attr(data-title); font-weight: 600; color: var(--primary); text-align: left; }
	table.shop_table_responsive td.product-remove::before, table.shop_table_responsive td.product-thumbnail::before, table.shop_table_responsive td.actions::before { display: none; }
	table.shop_table_responsive td.product-thumbnail { justify-content: center; }
	table.shop_table_responsive td.actions { flex-direction: column; align-items: stretch; }
	table.shop_table_responsive td.actions .coupon { flex-direction: column; float: none; max-width: none; }
	table.shop_table_responsive td.actions > .button[name="update_cart"] { float: none; }
	table.shop_table_responsive td.product-thumbnail { width: auto; }
	table.shop_table_responsive td.product-remove { width: auto; }
	table.shop_table_responsive td.actions .button { width: 100%; }
	.woocommerce-checkout-review-order-table td, .woocommerce-checkout-review-order-table th { font-size: .9375rem; }
}

/* Mobile */
@media (max-width: 640px) {
	:root { --sec: 44px; --margin: 16px; --gap: 16px; --pad: 18px; --head-gap: 16px; }
	body { font-size: 15.5px; }
	h1 { font-size: 1.875rem; }
	h2 { font-size: 1.5rem; }
	.hero { padding-block: 44px; }
	.hero h1 { font-size: 2rem; }
	.hero p { font-size: 1rem; }
	.hero-actions .button { flex: 1 1 100%; }
	.notfound .code { font-size: 4.5rem; }
	.notfound-actions .button { flex: 1 1 100%; }
	.page-hero { padding-block: 32px; }
	.page-hero h1 { font-size: 1.75rem; }
	.cta-band { padding-block: 40px; }
	.section-head { flex-wrap: wrap; }
	.grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
	.feature-card { padding: 16px; }
	.feature-icon, .step-no { width: 46px; height: 46px; margin-bottom: 12px; }
	.cat-card { padding: 12px; }
	.post-grid { grid-template-columns: minmax(0, 1fr); }

	/* compact two-column product cards */
	ul.products { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
	ul.products li.product { padding: 12px; }
	ul.products li.product img { margin-bottom: 10px; }
	.woocommerce-loop-product__title { font-size: .9375rem; min-height: 2.6em; word-break: break-word; }
	.price { font-size: 1rem; }
	.stock-label { font-size: .75rem; }
	.card-actions { gap: 8px; padding-top: 12px; }
	.card-actions .button { min-height: 46px; padding: 10px 8px; font-size: .9375rem; }
	span.onsale { top: 8px; left: 8px; }

	/* single product: large, separated buttons */
	.product_title { font-size: 1.5rem; }
	.summary .price { font-size: 1.5rem; }
	form.cart .button, .woocommerce-variation-add-to-cart .button { flex: 1 1 100%; min-height: 54px; font-size: 1.0625rem; }
	.woocommerce-product-gallery { padding: 12px; }
	.woocommerce-product-gallery__trigger { top: 20px; right: 20px; }
	.wc-tabs li { flex: 1 1 100%; }
	.wc-tabs li a { border-radius: 10px; border-bottom: 1px solid var(--line); }

	/* footer */
	.footer-grid { grid-template-columns: minmax(0, 1fr); gap: 24px; padding-block: 40px; }
	.footer-bottom { text-align: center; padding-bottom: 84px; }
	body:has(.whatsapp-float) .footer-bottom { padding-right: var(--margin); }

	/* WhatsApp: smaller and kept in the corner; page gets bottom room so it never covers controls */
	.whatsapp-float { width: 52px; height: 52px; right: 12px; bottom: 12px; }
	body:has(.whatsapp-float) #place_order { margin-bottom: 8px; }
	.shop-wrap, .entry-content { padding-bottom: 8px; }
	.woocommerce-MyAccount-navigation li { flex: 1 1 100%; }
	.policy { padding: var(--pad); }
	.button, button.button, input.button { min-height: 48px; }
	td.product-remove a.remove { width: 40px; height: 40px; }
}

/* Narrow phones (360 to 430): keep cards readable */
@media (max-width: 400px) {
	.grid-4 { grid-template-columns: minmax(0, 1fr); }
	.feature-card { flex-direction: row; align-items: flex-start; gap: 14px; }
	.feature-card .feature-icon { flex-shrink: 0; margin: 0; }
	.cat-card { flex-direction: row; align-items: center; gap: 12px; flex-wrap: wrap; }
	.cat-card__img { width: 72px; margin: 0; }
	.cat-card__name { flex: 1 1 auto; }
	.cat-card__count { flex: 0 0 100%; padding-left: 84px; margin-top: -8px; }
	.woocommerce-loop-product__title { font-size: .875rem; }
}

@media (prefers-reduced-motion: reduce) {
	* { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}
