@import url("./default.css");

.dhmall-product-grid {
    --dhmall-card-min: 300px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, var(--dhmall-card-min)), 1fr));
    gap: 24px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.dhmall-product-card {
    min-width: 0;
    overflow: hidden;
    border: 1px solid rgba(148, 163, 184, 0.22);
    border-radius: 6px;
    background: rgba(15, 23, 42, 0.78);
    box-shadow: 0 10px 26px rgba(0, 0, 0, 0.18);
}

.dhmall-product-link {
    display: flex;
    min-height: 100%;
    flex-direction: column;
    color: inherit;
    text-decoration: none;
}

.dhmall-product-image {
    position: relative;
    display: flex;
    height: clamp(190px, 20vw, 268px);
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: #fff;
}

.dhmall-product-image img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.dhmall-product-soldout {
    position: absolute;
    inset: auto 12px 12px auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 28px;
    padding: 0 10px;
    border-radius: 4px;
    background: rgba(17, 24, 39, 0.86);
    color: #fff;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0;
}

.dhmall-product-body {
    display: flex;
    min-width: 0;
    flex: 1 1 auto;
    flex-direction: column;
    padding: 18px 20px 16px;
}

.dhmall-product-name,
.dhmall-product-basic {
    display: -webkit-box;
    overflow: hidden;
    -webkit-box-orient: vertical;
    word-break: keep-all;
    overflow-wrap: anywhere;
}

.dhmall-product-name {
    min-height: 44px;
    color: #f8fafc;
    font-size: 15px;
    font-weight: 700;
    line-height: 1.45;
    -webkit-line-clamp: 2;
}

.dhmall-product-basic {
    margin-top: 4px;
    color: #a7b0c0;
    font-size: 13px;
    line-height: 1.4;
    -webkit-line-clamp: 1;
}

.dhmall-product-price {
    display: flex;
    min-width: 0;
    align-items: baseline;
    gap: 7px;
    margin-top: 9px;
}

.dhmall-product-price strong {
    min-width: 0;
    color: #fff;
    font-size: clamp(23px, 2.2vw, 30px);
    font-weight: 900;
    line-height: 1.08;
    letter-spacing: 0;
    overflow-wrap: anywhere;
}

.dhmall-product-price strong span,
.dhmall-product-price strong em {
    font-size: 0.66em;
    font-style: normal;
    font-weight: 800;
}

.dhmall-product-deal {
    flex: 0 0 auto;
    color: #ff3b53;
    font-size: 18px;
    font-weight: 900;
    line-height: 1;
}

.dhmall-product-rating {
    display: flex;
    align-items: center;
    gap: 7px;
    margin-top: 10px;
}

.dhmall-product-stars {
    color: #ff9f0a;
    font-size: 14px;
    line-height: 1;
    letter-spacing: 0;
    white-space: nowrap;
}

.dhmall-product-review {
    color: #9ca3af;
    font-size: 12px;
    line-height: 1;
}

.dhmall-product-point {
    margin-top: 8px;
    color: #a7b0c0;
    font-size: 13px;
    line-height: 1.3;
}

.dhmall-product-point strong {
    color: #1b8cff;
    font-weight: 900;
}

.dhmall-product-meta {
    display: flex;
    min-height: 36px;
    align-items: center;
    gap: 6px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid rgba(148, 163, 184, 0.16);
    color: #a7b0c0;
    font-size: 12px;
}

.dhmall-product-coupon {
    position: relative;
    display: inline-flex;
    height: 21px;
    align-items: center;
    padding: 0 7px 0 8px;
    border: 1px solid rgba(148, 163, 184, 0.28);
    border-radius: 2px;
    background: rgba(15, 23, 42, 0.42);
    color: #f8fafc;
    font-weight: 800;
}

.dhmall-product-coupon::after {
    content: "";
    display: block;
    width: 4px;
    height: 100%;
    margin-left: 7px;
    background: #ff2f73;
}

.dhmall-product-seller {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dhmall-product-footer {
    display: flex;
    min-height: 32px;
    align-items: flex-end;
    justify-content: space-between;
    gap: 12px;
    margin-top: auto;
    padding-top: 14px;
    border-top: 1px solid rgba(148, 163, 184, 0.16);
    color: #a7b0c0;
    font-size: 13px;
    line-height: 1.2;
}

.dhmall-product-footer span:last-child {
    min-width: 0;
    overflow: hidden;
    text-align: right;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dhmall-product-empty {
    padding: 36px 0;
    color: #9ca3af;
    text-align: center;
}

html[data-theme="light"] .dhmall-product-card {
    border-color: #e5e7eb;
    background: #fff;
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.06);
}

html[data-theme="light"] .dhmall-product-name,
html[data-theme="light"] .dhmall-product-price strong {
    color: #111827;
}

html[data-theme="light"] .dhmall-product-basic,
html[data-theme="light"] .dhmall-product-review,
html[data-theme="light"] .dhmall-product-point,
html[data-theme="light"] .dhmall-product-meta,
html[data-theme="light"] .dhmall-product-footer {
    color: #5f6673;
}

html[data-theme="light"] .dhmall-product-meta,
html[data-theme="light"] .dhmall-product-footer {
    border-top-color: #edf0f4;
}

html[data-theme="light"] .dhmall-product-coupon {
    border-color: #e2e6ee;
    background: #fff;
    color: #111827;
}

@media (max-width: 900px) {
    .dhmall-product-grid {
        --dhmall-card-min: 240px;
        gap: 16px;
    }

    .dhmall-product-body {
        padding: 15px 15px 14px;
    }

    .dhmall-product-deal {
        font-size: 16px;
    }
}

@media (max-width: 560px) {
    .dhmall-product-grid {
        grid-template-columns: 1fr;
    }

    .dhmall-product-image {
        height: 230px;
    }
}
