/**
 * HyperDAF Core — Homepage Sections Styles
 * Location: /wp-content/themes/hyperdaf-core/assets/css/home-sections.css
 *
 * Purpose:
 * - Styles homepage sections after the hero.
 * - Styles the official theme-owned product card loop.
 * - Keeps homepage layout compact, premium, and performance-safe.
 * - Matches the approved DAF Marketplace plugin card DNA while remaining theme-owned.
 */

/* Section shell */
.hdaf-homepage > .hdaf-home-section:first-of-type{margin-top:30px}
.hdaf-homepage > .hdaf-home-section + .hdaf-home-section{margin-top:30px}
.hdaf-home-section{padding:0}
.hdaf-home-section__head{display:flex;align-items:center;justify-content:space-between;gap:16px;margin:0 0 18px}

/* 🔥 UPDATED TITLE SCALE (22px system) */
.hdaf-home-section__title{
margin:0;
color:#0F172A;
font-size:22px;
font-weight:800;
line-height:1.25;
letter-spacing:-.01em;
}

.hdaf-home-section__link{display:inline-flex;align-items:center;gap:6px;color:#64748B;font-size:13px;font-weight:700;text-decoration:none;white-space:nowrap}
.hdaf-home-section__link:hover{color:#2563EB}
.hdaf-home-section__link::after{content:"›";font-size:16px;line-height:1}

/* Theme official product card */
.hdaf-product-card{
display:flex;
flex-direction:column;
background:#FFF;
border:1px solid #E2E8F0;
border-radius:4px;
overflow:hidden;
box-shadow:var(--dafmp-card-shadow,0 10px 30px rgba(15,23,42,.05));
transition:transform .2s ease,box-shadow .2s ease,border-color .2s ease;
}

.hdaf-product-card:hover{
transform:translateY(-2px);
border-color:#D6DEE8;
box-shadow:var(--dafmp-card-shadow-hover,0 16px 34px rgba(15,23,42,.08));
}

.hdaf-product-card__media{position:relative;background:#F8FAFC}
.hdaf-product-card__media-link{display:block;text-decoration:none}

.hdaf-product-card__image{
display:block;
width:100%;
aspect-ratio:16/10;
object-fit:cover;
background:#EEF3F8;
transition:transform .25s ease;
}

.hdaf-product-card:hover .hdaf-product-card__image{transform:scale(1.02)}

.hdaf-product-card__image--placeholder{
background:linear-gradient(135deg,rgba(37,99,235,.06),rgba(249,115,22,.06)),#EEF3F8;
}

.hdaf-product-card__badges{
position:absolute;
top:8px;
left:8px;
display:flex;
flex-wrap:wrap;
gap:6px;
}

.hdaf-product-card__type{
display:inline-flex;
align-items:center;
min-height:24px;
padding:3px 8px;
border-radius:4px;
background:#16A34A;
color:#FFF;
font-size:11px;
font-weight:700;
line-height:1.2;
}

.hdaf-product-card__body{
display:flex;
flex:1 1 auto;
flex-direction:column;
gap:6px;
padding:12px;
}

.hdaf-product-card__title{
margin:0;
color:#0F172A;
font-size:14px;
font-weight:700;
line-height:1.4;
white-space:nowrap;
overflow:hidden;
text-overflow:ellipsis;
}

.hdaf-product-card__title a{
color:inherit;
text-decoration:none;
}

.hdaf-product-card__title a:hover{color:#2563EB}

.hdaf-product-card__meta{
display:flex;
align-items:center;
justify-content:space-between;
gap:8px;
min-height:18px;
color:#64748B;
font-size:12px;
line-height:1.4;
}

.hdaf-product-card__author,
.hdaf-product-card__sales{
display:inline-flex;
align-items:center;
min-width:0;
}

.hdaf-product-card__author{
font-weight:500;
white-space:nowrap;
overflow:hidden;
text-overflow:ellipsis;
}

.hdaf-product-card__sales{
flex:0 0 auto;
font-size:12px;
font-weight:500;
white-space:nowrap;
}

.hdaf-product-card__footer{
display:flex;
align-items:center;
justify-content:space-between;
gap:8px;
margin-top:auto;
padding-top:12px;
}

.hdaf-product-card__left{
display:flex;
flex:1 1 auto;
flex-direction:column;
align-items:flex-start;
min-width:0;
}

.hdaf-product-card__price-wrap{
display:flex;
flex-wrap:wrap;
align-items:baseline;
gap:6px;
}

.hdaf-product-card__price{
color:#0F172A;
font-size:15px;
font-weight:800;
line-height:1;
}

.hdaf-product-card__old-price{
color:#94A3B8;
font-size:11px;
font-weight:700;
text-decoration:line-through;
}

.hdaf-product-card__stats{
display:flex;
flex-wrap:wrap;
align-items:center;
gap:4px;
margin-top:4px;
color:#64748B;
font-size:11px;
line-height:1.2;
}

.hdaf-product-card__rating{
display:inline-flex;
align-items:center;
gap:2px;
}

.hdaf-product-card__star{
color:#CBD5E1;
font-size:11px;
line-height:1;
}

.hdaf-product-card__star.is-filled{color:#F59E0B}

.hdaf-product-card__rating-count{
display:inline-flex;
align-items:center;
font-size:11px;
font-weight:500;
line-height:1;
}

.hdaf-product-card__actions{
display:flex;
flex:0 0 auto;
flex-wrap:nowrap;
align-items:center;
justify-content:flex-end;
gap:6px;
margin-left:auto;
}

.hdaf-product-card__cart{
width:32px;
height:32px;
display:flex;
align-items:center;
justify-content:center;
flex:0 0 32px;
border:1px solid #E2E8F0;
border-radius:4px;
background:#FFF;
color:#334155;
text-decoration:none;
overflow:hidden;
transition:.2s ease;
}

.hdaf-product-card__cart:hover{
background:#F8FAFC;
border-color:#CBD5F5;
}

.hdaf-product-card__cart svg{
width:12px;
height:12px;
display:block;
}

.hdaf-product-card__button{
display:inline-flex;
align-items:center;
justify-content:center;
min-height:32px;
padding:0 12px;
border:1px solid #16A34A;
border-radius:4px;
background:#16A34A;
color:#FFF;
font-size:12px;
font-weight:600;
text-decoration:none;
white-space:nowrap;
transition:.2s ease;
}

.hdaf-product-card__button:hover{
background:#15803D;
border-color:#15803D;
color:#FFF;
}

/* responsive */
@media (max-width:1024px){
.hdaf-home-section__title{font-size:20px}
}

@media (max-width:767px){
.hdaf-home-section__head{align-items:flex-start;flex-direction:column}
.hdaf-home-section__title{font-size:18px}
.hdaf-product-card__body{padding:12px}
.hdaf-product-card__footer{align-items:center;gap:8px}
.hdaf-product-card__actions{justify-content:flex-end;margin-left:auto}
}

@media (max-width:479px){
.hdaf-product-card__meta{
align-items:center;
flex-direction:row;
}

.hdaf-product-card__footer{
flex-direction:row;
align-items:center;
}

.hdaf-product-card__actions{width:auto}
.hdaf-product-card__button{flex:0 0 auto}
}