/* as_home: home page layout (HP1, HP3, HP5-HP10, HP12), 2026-10-24.
   Linked only on the home page (catalog/controller/common/home.php) with ?v=<mtime>. */

#common-home { --as-gap: 28px; --as-red: #cc0000; --as-line: #e5e7eb; }
#common-home #content { min-height: 0; }
#common-home .home-h1 { margin: .25rem 0 .9rem !important; }

/* HP6: one vertical rhythm for every section of content_top */
#common-home #content > :not(script):not(h1) { margin-top: 0; margin-bottom: var(--as-gap); }
.as-hp-section { margin-bottom: var(--as-gap); }
.as-hp-title { font-size: 1.35rem; font-weight: 700; text-align: center; margin: 0 0 .9rem; line-height: 1.25; }
.as-hp-more { text-align: center; margin: 1rem 0 0; }

/* ---------- HP7 hero ---------- */
.as-hero { border-radius: 10px; overflow: hidden; background: #f3f3f3; }
.as-hero .carousel-item img { height: auto; }
.as-hero .carousel-control-prev, .as-hero .carousel-control-next { width: 64px; opacity: 1; }
.as-hero-arrow { display: flex; align-items: center; justify-content: center; width: 42px; height: 42px; border-radius: 50%; background: rgba(0, 0, 0, .45); color: #fff; font-size: 18px; transition: background .2s; }
.as-hero .carousel-control-prev:hover .as-hero-arrow, .as-hero .carousel-control-next:hover .as-hero-arrow,
.as-hero .carousel-control-prev:focus-visible .as-hero-arrow, .as-hero .carousel-control-next:focus-visible .as-hero-arrow { background: rgba(0, 0, 0, .75); }
.as-hero .carousel-indicators { margin-bottom: .6rem; }
.as-hero .carousel-indicators [data-bs-target] { width: 10px; height: 10px; border-radius: 50%; border: 2px solid rgba(0, 0, 0, .25); background-clip: padding-box; background-color: #fff; margin: 0 4px; opacity: .6; }
.as-hero .carousel-indicators .active { opacity: 1; background-color: var(--as-red); }

/* ---------- HP3 promo strips ---------- */
.as-promo-list { display: grid; grid-template-columns: 1fr; gap: 8px; margin: 0; }
.as-promo-item { display: flex; align-items: center; gap: .65rem; min-height: 46px; padding: .45rem .9rem; border-radius: 8px; background: #fff5f5; border: 1px solid #f3cccc; font-size: .95rem; line-height: 1.25; }
.as-promo-link, .as-promo-text { display: flex; align-items: center; gap: .65rem; flex: 1 1 auto; min-width: 0; color: #212529; text-decoration: none; }
a.as-promo-link:hover .as-promo-text strong, a.as-promo-text:hover strong { text-decoration: underline; }
.as-promo-text { display: block; }
.as-promo-text span { color: #555; }
.as-promo-icon { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 4px; color: var(--as-red); font-size: 1.3rem; }
.as-pay-badge { display: block; height: 22px; width: auto; border-radius: 4px; }
.as-pay-tamara { border: 1px solid #d0d0d0; }
@media (min-width: 768px) {
	.as-promo-multi .as-promo-list { grid-template-columns: repeat(var(--as-items, 2), minmax(0, 1fr)); }
}

/* ---------- HP12 trust bar ---------- */
.as-trust-list { display: grid; grid-template-columns: repeat(var(--as-items, 4), minmax(0, 1fr)); gap: 8px; margin: 0; }
.as-trust-link { display: flex; align-items: center; gap: .6rem; height: 100%; padding: .6rem .75rem; border: 1px solid var(--as-line); border-radius: 8px; background: #fafafa; color: #212529; text-decoration: none; line-height: 1.2; }
a.as-trust-link:hover { border-color: #999; background: #fff; }
.as-trust-icon { flex: 0 0 auto; display: inline-flex; gap: 3px; color: var(--as-red); font-size: 1.35rem; width: 1.8rem; justify-content: center; }
.as-trust-icon.as-badges { width: auto; }
.as-trust-icon .as-pay-badge { height: 18px; }
.as-trust-text strong { display: block; font-size: .9rem; }
.as-trust-text span { display: block; color: #6c757d; font-size: .78rem; margin-top: 1px; }

/* ---------- HP5 category tiles + Daily Offers (grid_banner) ---------- */
.as-gb-list { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 18px 12px; margin: 0; padding: 0; }
.as-gb-item { display: flex; flex-direction: column; align-items: center; text-align: center; color: #212529; text-decoration: none; }
.as-gb-img { display: block; width: 100%; max-width: 132px; aspect-ratio: 1 / 1; border-radius: 50%; overflow: hidden; background: #eeeced; }
.as-gb-img img { display: block; width: 100%; height: 100%; object-fit: cover; mix-blend-mode: multiply; transition: transform .3s ease; }
a.as-gb-item:hover .as-gb-img img { transform: scale(1.07); }
a.as-gb-item:hover .as-gb-name { color: var(--as-red); }
.as-gb-name { margin-top: .45rem; font-size: .9rem; font-weight: 600; line-height: 1.2; }
.as-gb-rectangle .as-gb-img { border-radius: 8px; aspect-ratio: 5 / 3; max-width: none; }

/* ---------- HP10 product tabs (CSS-only) ---------- */
.as-tab-radio { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.as-tab-list { display: flex; justify-content: center; flex-wrap: wrap; gap: .5rem; margin: 0 0 1rem; }
.as-tab-label { cursor: pointer; padding: .45rem 1.15rem; border: 1px solid #ced4da; border-radius: 999px; background: #fff; color: #212529; font-weight: 600; font-size: .95rem; white-space: nowrap; user-select: none; }
.as-tab-label:hover { border-color: #212529; }
.as-tab-panel { display: none; }
.as-tab-radio:nth-of-type(1):checked ~ .as-tab-panels > .as-tab-panel:nth-child(1),
.as-tab-radio:nth-of-type(2):checked ~ .as-tab-panels > .as-tab-panel:nth-child(2),
.as-tab-radio:nth-of-type(3):checked ~ .as-tab-panels > .as-tab-panel:nth-child(3),
.as-tab-radio:nth-of-type(4):checked ~ .as-tab-panels > .as-tab-panel:nth-child(4) { display: block; }
.as-tab-radio:nth-of-type(1):checked ~ .as-tab-list > .as-tab-label:nth-child(1),
.as-tab-radio:nth-of-type(2):checked ~ .as-tab-list > .as-tab-label:nth-child(2),
.as-tab-radio:nth-of-type(3):checked ~ .as-tab-list > .as-tab-label:nth-child(3),
.as-tab-radio:nth-of-type(4):checked ~ .as-tab-list > .as-tab-label:nth-child(4) { background: var(--as-red); border-color: var(--as-red); color: #fff; }
.as-tab-radio:nth-of-type(1):focus-visible ~ .as-tab-list > .as-tab-label:nth-child(1),
.as-tab-radio:nth-of-type(2):focus-visible ~ .as-tab-list > .as-tab-label:nth-child(2),
.as-tab-radio:nth-of-type(3):focus-visible ~ .as-tab-list > .as-tab-label:nth-child(3),
.as-tab-radio:nth-of-type(4):focus-visible ~ .as-tab-list > .as-tab-label:nth-child(4) { outline: 2px solid #0d6efd; outline-offset: 2px; }

/* ---------- HP1 / HP8 product grid + compact cards (same product/thumb card as category pages) ---------- */
.as-hp-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.as-hp-grid > .product-thumb:nth-child(n+9) { display: none; }
.as-hp-grid .product-thumb { position: relative; display: flex; flex-direction: column; min-height: 0 !important; max-height: none !important; height: 100%; margin: 0; border: 1px solid var(--as-line); border-radius: 8px; overflow: hidden; background: #fff; }
.as-hp-grid .product-thumb .image { aspect-ratio: 1 / 1; display: flex; align-items: center; justify-content: center; margin: 0; padding: 8px; background: #fff; }
.as-hp-grid .product-thumb .image a { display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; }
.as-hp-grid .product-thumb .image img { width: 100%; height: 100%; object-fit: contain; }
.as-hp-grid .product-thumb .content { display: flex; flex-direction: column; flex: 1 1 auto; padding: 0 !important; }
.as-hp-grid .product-thumb .description { flex: 1 1 auto; padding: 8px 10px 4px; }
.as-hp-grid .product-thumb .as-card-brand { font-size: .7rem; text-transform: uppercase; letter-spacing: .03em; color: #6c757d; margin-bottom: .1rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.as-hp-grid .product-thumb h4 { font-size: .88rem; font-weight: 600; line-height: 1.3; height: 2.6em; margin: 0 0 .35rem; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.as-hp-grid .product-thumb h4 a { text-decoration: none; } /* colour: theme card style (red), as on category pages */
.as-hp-grid .product-thumb .price { margin: 0; font-size: 1rem; line-height: 1.3; }
.as-hp-grid .product-thumb .price-new { font-weight: 700; color: #212529; }
.as-hp-grid .product-thumb .price-old { font-size: .78rem; color: #6c757d; text-decoration: line-through; margin-left: .25rem; }
.as-hp-grid .product-thumb .as-card-tabby { font-size: .74rem; color: #555; margin-top: .1rem; }
.as-hp-grid .product-thumb .as-card-stock { font-size: .74rem; font-weight: 600; margin-top: .2rem; }
.as-hp-grid .product-thumb .as-stock-in { color: #198754; }
.as-hp-grid .product-thumb .description > p { font-size: .74rem; margin: .2rem 0 0; color: #555; }
.as-hp-grid .product-thumb .rating { font-size: .7rem; margin-top: .2rem; }
.as-hp-grid .product-thumb .content .product-action { position: static !important; padding: 6px 10px 10px; }
.as-hp-grid .product-thumb .button-group { display: flex; gap: 6px; border: 0; background: none; }
.as-hp-grid .product-thumb .button-group button { flex: 1 1 auto; display: inline-flex; align-items: center; justify-content: center; gap: .35rem; min-height: 36px; padding: .3rem .5rem; border: 0; border-radius: 6px; background: var(--as-red); color: #fff; font-size: .82rem; font-weight: 600; line-height: 1.1; }
.as-hp-grid .product-thumb .button-group button:hover { background: #a30000; color: #fff; }
.as-hp-grid .product-thumb .button-group button[disabled] { background: #adb5bd; }
.as-hp-grid .product-thumb .button-group button + button { flex: 0 0 36px; border: 1px solid #ced4da; background: #fff; color: #6c757d; }
.as-hp-grid .product-thumb .button-group button + button:hover { color: var(--as-red); background: #fff; border-color: var(--as-red); }

/* ---------- HP9 brands ---------- */
.as-brand-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; margin: 0; padding: 0; }
.as-brand { display: flex; align-items: center; justify-content: center; height: 100%; padding: 8px 12px; border: 1px solid var(--as-line); border-radius: 8px; background: #fff; }
a.as-brand:hover { border-color: #999; }
.as-brand img { display: block; width: 100%; max-width: 130px; height: auto; aspect-ratio: 13 / 10; object-fit: contain; }

/* ---------- breakpoints ---------- */
@media (min-width: 768px) {
	.as-hp-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
	.as-hp-grid > .product-thumb:nth-child(n+7) { display: none; }
}
@media (min-width: 992px) {
	.as-hp-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
	.as-hp-grid > .product-thumb:nth-child(n+7) { display: flex; }
	.as-hp-grid > .product-thumb:nth-child(n+9) { display: none; }
}
@media (min-width: 1400px) {
	.as-hp-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }
	.as-hp-grid > .product-thumb:nth-child(n+9) { display: flex; }
}
@media (max-width: 991.98px) {
	.as-trust-list { grid-template-columns: repeat(3, minmax(0, 1fr)); }
	.as-gb-grid .as-gb-list { grid-template-columns: repeat(4, minmax(0, 1fr)); }
	.as-brand-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 767.98px) {
	#common-home { --as-gap: 20px; }
	.as-hp-title { font-size: 1.15rem; margin-bottom: .65rem; }

	.as-hero { border-radius: 8px; }
	.as-hero .carousel-control-prev, .as-hero .carousel-control-next { width: 44px; }
	.as-hero-arrow { width: 32px; height: 32px; font-size: 14px; }
	.as-hero .carousel-indicators { margin-bottom: .3rem; }
	.as-hero .carousel-indicators [data-bs-target] { width: 8px; height: 8px; margin: 0 3px; }

	.as-promo-list { gap: 6px; }
	.as-promo-item { min-height: 40px; padding: .4rem .7rem; font-size: .84rem; }
	.as-promo-icon { font-size: 1.1rem; }
	.as-promo-text span { display: none; } /* the badges already say "tabby / tamara" */
	.as-pay-badge { height: 20px; }

	.as-trust-list { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
	.as-trust-item:last-child:nth-child(odd) { grid-column: 1 / -1; }
	.as-trust-link { padding: .5rem .55rem; gap: .45rem; }
	.as-trust-icon { font-size: 1.1rem; width: 1.4rem; }
	.as-trust-text strong { font-size: .8rem; }
	.as-trust-text span { display: none; } /* compact 2-column grid on phones */

	.as-gb-grid .as-gb-list { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px 8px; }
	.as-gb-name { font-size: .8rem; }
	/* Daily Offers: one swipeable row, no JS */
	.as-gb-scroll .as-gb-list { display: flex; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch; scrollbar-width: none; padding-bottom: 4px; }
	.as-gb-scroll .as-gb-list::-webkit-scrollbar { display: none; }
	.as-gb-scroll .as-gb-cell { flex: 0 0 28%; scroll-snap-align: start; }

	/* Tabs become a swipeable chip row */
	.as-tab-list { flex-wrap: nowrap; justify-content: flex-start; overflow-x: auto; scroll-snap-type: x proximity; scrollbar-width: none; padding-bottom: 2px; margin-bottom: .75rem; }
	.as-tab-list::-webkit-scrollbar { display: none; }
	.as-tab-label { scroll-snap-align: start; padding: .4rem .95rem; font-size: .875rem; }

	.as-hp-grid .product-thumb .description { padding: 6px 8px 2px; }
	.as-hp-grid .product-thumb h4 { font-size: .82rem; }
	.as-hp-grid .product-thumb .price { font-size: .92rem; }
	.as-hp-grid .product-thumb .as-card-tabby { display: none; }
	.as-hp-grid .product-thumb .content .product-action { padding: 4px 8px 8px; }
	.as-hp-grid .product-thumb .button-group button { font-size: .78rem; padding: .3rem .35rem; }
	.as-hp-grid .product-thumb .button-group button .fa-shopping-cart { display: none; }

	.as-brand-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
	.as-brand { padding: 6px 8px; }
}
