/*
Theme Name: Avada Child
Description: Child theme for Avada theme
Author: ThemeFusion
Author URI: https://theme-fusion.com
Template: Avada
Version: 1.0.0
Text Domain:  Avada
*/

/* ---------------------------------------------------------------------------
 * Store details (avada_portfolio) — feature image
 *
 * The template gives the image frame `min-width: 100%`, but the <img> inside
 * only carries Avada's `img-responsive` (max-width: 100%), so a source image
 * narrower than the column renders at its natural size and leaves the frame
 * part-empty. CMS feature images run from 498x380 up to 5091x3394, so any
 * store shipping a small asset (e.g. Klinik SSKK ships 553x397) looks broken
 * next to the ones shipping 1080x1080. Fill the frame width in every case and
 * keep the source aspect ratio.
 * ------------------------------------------------------------------------ */
.featureimg img {
	width: 100%;
	height: auto;
}

/* Store details — hide the "Visit Website" row when the outlet has no
 * retailerLink. Avada renders the button unconditionally, so with an empty
 * ACF `website` it outputs an <a> with no href: a dead control. The fa-link
 * icon is what distinguishes it from the lot/phone/hours rows, which are
 * also href-less buttons by design. */
.fusion-button:not([href]):has(> i.fa-link) {
	display: none;
}

/* ---------------------------------------------------------------------------
 * Footer image sizing, restored after the Avada 7.16 upgrade.
 *
 * Under 7.11.2 these frames shrink-wrapped their image. Under 7.16 the
 * inline-block frame collapses to zero width instead, so measured on the live
 * footer before this fix:
 *
 *   imageframe-34  app icon    img 0x0,    frame 0px wide   -> invisible
 *   imageframe-35  App Store   img 197x59, max-width 100%   -> stretched
 *   imageframe-36  Google Play img 197x59, max-width 100%   -> stretched
 *
 * The template already sets max_width 250px on the icon, which does nothing:
 * a ceiling on a zero-width inline-block changes nothing, so it needs an
 * explicit width. The badges have no max_width at all, so they stretched to
 * fill the column once the icon stopped occupying its own.
 *
 * 150px for the badges is taken from this footer's other badge pair
 * (imageframe-38/39), which already carries max_width 150px and renders
 * correctly. 75px for the icon was chosen by rendering 75/120/238 against the
 * live footer: 238px (the image's intrinsic size) overlaps the newsletter
 * column and collides the two headings. 75px also matches Pavilion KL.
 *
 * Keyed to the image filename only. The imageframe-NN classes are a
 * per-page counter (30-32 on the homepage, 34-36 on inner pages), so a
 * numbered selector hits a different image depending on the page. The
 * badges sit inside an <a>, so :has() must match any descendant img.
 * ------------------------------------------------------------------------- */
.fusion-tb-footer .fusion-imageframe:has(img[src*="PH-App-Icon"]) {
	display: inline-block !important;
	width: 75px !important;
	max-width: 75px !important;
}

.fusion-tb-footer .fusion-imageframe:has(img[src*="app-store"]),
.fusion-tb-footer .fusion-imageframe:has(img[src*="playstore"]) {
	max-width: 150px !important;
}

.fusion-tb-footer .fusion-imageframe:has(img[src*="PH-App-Icon"]) img,
.fusion-tb-footer .fusion-imageframe:has(img[src*="app-store"]) img,
.fusion-tb-footer .fusion-imageframe:has(img[src*="playstore"]) img {
	width: 100% !important;
	height: auto !important;
}
