
/* =========================================================
   JPARTS MOBILE - PRODUCT DETAIL V2
   File: static/mobile_web/css/pages/detail.css

   Design tokens: tokens.css
   PC CSS / Django views / Database: unchanged
   ========================================================= */


/* 1. Detail navigation */

.detail-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
    margin: 3px 0 12px;
    color: var(--jp-muted);
    font-size: var(--jp-font-small);
    line-height: 1.5;
}

.detail-nav .back {
    color: var(--jp-primary);
    font-size: var(--jp-font-body);
    font-weight: 700;
    text-decoration: none;
}


/* 2. Common cards */

.detail-card,
.offer-card {
    width: 100%;
    min-width: 0;
    margin-bottom: 12px;
    padding: 16px;
    background: var(--jp-surface);
    border: 1px solid var(--jp-border);
    border-radius: var(--jp-radius-card);
    box-sizing: border-box;
}


/* 3. Product detail layout */

.detail-card {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 14px;
    overflow: hidden;
}


/* 4. Product image */

.detail-image {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;

    width: 100%;
    min-width: 0;
    height: auto;
    min-height: 180px;
    aspect-ratio: 4 / 3;

    margin: 0;
    padding: 12px;
    overflow: hidden;

    background: var(--jp-bg);
    border: 1px solid var(--jp-border);
    border-radius: var(--jp-radius-card);

    color: var(--jp-muted);
    font-size: 48px;
}

.detail-image img {
    display: block;
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 300px;
    object-fit: contain;
    object-position: center;
}

.detail-image > span {
    font-size: 48px;
    color: var(--jp-muted);
}


/* 5. Product information */

.detail-product-info {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;

    width: 100%;
    min-width: 0;
    overflow-wrap: anywhere;
}

.detail-card .maker {
    color: var(--jp-muted);
    font-size: var(--jp-font-small);
    line-height: 1.5;
}

.detail-card h1 {
    width: 100%;
    min-width: 0;
    margin: 0;

    color: var(--jp-text);
    font-size: var(--jp-font-page);
    font-weight: 700;
    line-height: 1.4;

    overflow-wrap: anywhere;
    word-break: normal;
}

.detail-card .meta {
    margin: 0;
    color: var(--jp-muted);
    font-size: var(--jp-font-small);
    line-height: 1.5;
    overflow-wrap: anywhere;
}


/* 6. MPN / Product specification badge */

.spec-pill {
    display: inline-block;
    max-width: 100%;
    padding: 8px 12px;

    background: #e5eff3;
    border: 1px solid var(--jp-border);
    border-radius: var(--jp-radius-small);

    color: var(--jp-primary-dark);
    font-size: var(--jp-font-body);
    line-height: 1.5;

    overflow-wrap: anywhere;
}


/* 7. Supplier price comparison */

.offer-card {
    display: block;
    overflow-wrap: anywhere;
}

.offer-top,
.offer-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
    min-width: 0;
}

.offer-top strong {
    min-width: 0;
    color: var(--jp-text);
    font-size: 16px;
    font-weight: 700;
    overflow-wrap: anywhere;
}

.offer-card .mpn {
    margin: 8px 0 0;
    color: var(--jp-muted);
    font-size: var(--jp-font-small);
    overflow-wrap: anywhere;
}

.offer-price {
    margin: 12px 0;
    color: var(--jp-primary);
    font-size: 19px;
    font-weight: 800;
    line-height: 1.4;
    overflow-wrap: anywhere;
}

.offer-meta {
    color: var(--jp-muted);
    font-size: var(--jp-font-small);
    line-height: 1.5;
}


/* 8. Price comparison badges */

.best-tag {
    display: inline-block;
    padding: 5px 8px;

    background: #e6f8ef;
    border-radius: var(--jp-radius-small);

    color: #06724b;
    font-size: 11px;
    font-weight: 700;
}

.stale {
    margin-top: 8px;
    color: #ad6500;
    font-size: 11px;
    line-height: 1.5;
}


/* 9. Supplier links */

.outbound {
    display: inline-flex;
    align-items: center;
    min-height: var(--jp-control-height);

    margin-top: 12px;
    padding: 9px 12px;

    border: 1px solid var(--jp-primary);
    border-radius: var(--jp-radius-small);

    color: var(--jp-primary);
    font-size: var(--jp-font-body);
    font-weight: 700;
    text-decoration: none;
}

.outbound:hover {
    background: #e5eff3;
}

.outbound:focus-visible {
    outline: 2px solid var(--jp-primary);
    outline-offset: 3px;
}


/* 10. Variant specifications */

.variant-heading {
    margin: 14px 0 8px;
    color: var(--jp-text);
    font-size: var(--jp-font-body);
    font-weight: 700;
    overflow-wrap: anywhere;
}

.spec-table {
    width: 100%;
    margin: 0;
    padding: 0;
}

.spec-table > div {
    display: grid;
    grid-template-columns: minmax(0, 40%) minmax(0, 60%);
    gap: 8px;

    width: 100%;
    padding: 11px;

    background: var(--jp-surface);
    border-bottom: 1px solid var(--jp-border);
}

.spec-table dt {
    min-width: 0;
    color: var(--jp-muted);
    font-size: var(--jp-font-small);
    overflow-wrap: anywhere;
}

.spec-table dd {
    min-width: 0;
    margin: 0;

    color: var(--jp-text);
    font-size: var(--jp-font-body);
    overflow-wrap: anywhere;
}


/* 11. Bottom action buttons */

.action-row {
    display: flex;
    align-items: stretch;
    gap: 8px;
    margin: 20px 0;
}

.action-row a {
    display: flex;
    flex: 1 1 0;
    align-items: center;
    justify-content: center;
    min-width: 0;
    min-height: var(--jp-control-height);

    padding: 12px 10px;
    border-radius: var(--jp-radius);

    font-size: var(--jp-font-body);
    font-weight: 700;
    line-height: 1.4;
    text-align: center;
    text-decoration: none;
}

.secondary-button {
    background: var(--jp-surface);
    border: 1px solid var(--jp-primary);
    color: var(--jp-primary);
}

.primary-button {
    background: var(--jp-button);
    border: 1px solid var(--jp-button);
    color: #ffffff;
}


/* 12. Responsive detail layout */

@media (max-width: 360px) {
    .detail-card,
    .offer-card {
        padding: 12px;
    }

    .detail-card h1 {
        font-size: 20px;
    }

    .detail-image {
        min-height: 160px;
    }

    .action-row a {
        padding: 10px 8px;
        font-size: 13px;
    }

    .spec-table > div {
        grid-template-columns: minmax(0, 38%) minmax(0, 62%);
    }
}

@media (min-width: 700px) {
    .detail-card,
    .offer-card {
        padding: 20px;
    }

    .detail-image {
        max-height: 360px;
    }
}
