/* RedHaze Mall storefront stylesheet. Pairs with apple.css for the
 * shared variables and glass nav, but the mall is its own visual
 * vertical: card-driven catalog, modal-style checkout flow, supplier
 * console layout.
 */

@import url("/static/css/apple.css");

.mall-shell {
    max-width: 1280px;
    margin: 0 auto;
    padding: 24px var(--pad-x) 80px;
}

.mall-hero {
    border-radius: 24px;
    overflow: hidden;
    background: linear-gradient(135deg, #1d1d1f 0%, #0071e3 70%, #dc1e34 130%);
    color: #fff;
    padding: 36px 40px;
    margin-top: 18px;
    position: relative;
}

.mall-hero h1 {
    margin: 0 0 8px;
    font-size: clamp(26px, 3.4vw, 40px);
    letter-spacing: -0.015em;
}

.mall-hero p {
    margin: 0;
    color: rgba(255, 255, 255, 0.86);
    font-size: 14px;
    max-width: 680px;
    line-height: 1.65;
}

/* Photo-driven hero (v0.6.0+). Splits the hero into a real Unsplash
 * photo on the left and the existing gradient copy panel on the right.
 * Falls back gracefully if the image fails to load (the cover panel
 * collapses but the gradient copy stays). */
.mall-hero-photo {
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    padding: 0;
    min-height: 320px;
}
.mall-hero-cover {
    position: relative;
    background: #14141c;
    overflow: hidden;
}
.mall-hero-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    filter: saturate(1.05);
}
.mall-hero-copy {
    padding: 36px 36px 32px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 10px;
}
@media (max-width: 760px) {
    .mall-hero-photo { grid-template-columns: 1fr; }
    .mall-hero-cover { min-height: 220px; }
}

.mall-cta-row {
    margin-top: 20px;
    display: inline-flex;
    flex-wrap: wrap;
    gap: 10px;
}

.mall-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
    margin-top: 26px;
}

.mall-card {
    background: #fff;
    border: 1px solid var(--hue-line);
    border-radius: 18px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform 0.16s ease, box-shadow 0.16s ease;
}

.mall-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--hue-shadow-soft);
}

.mall-card .thumb {
    aspect-ratio: 4 / 3;
    background: #f1f1f4;
    overflow: hidden;
}

.mall-card .thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.mall-card .body {
    padding: 14px 14px 18px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1;
}

.mall-card .badge {
    align-self: flex-start;
    padding: 2px 8px;
    border-radius: 999px;
    background: var(--hue-accent-soft);
    color: var(--hue-accent);
    font-size: 11.5px;
    letter-spacing: 0.4px;
    font-weight: 600;
    text-transform: uppercase;
}

.mall-card .badge.premium {
    background: rgba(94, 92, 230, 0.12);
    color: #5e5ce6;
}

.mall-card .name {
    font-size: 14.5px;
    font-weight: 600;
    color: var(--hue-ink);
    line-height: 1.35;
}

.mall-card .meta {
    color: var(--hue-ink-muted);
    font-size: 12px;
}

.mall-card .price {
    margin-top: auto;
    font-weight: 700;
    color: var(--hue-ink);
    font-size: 17px;
    letter-spacing: -0.01em;
}

.mall-card .price small {
    color: var(--hue-ink-muted);
    font-weight: 500;
    font-size: 12px;
}

.mall-section-title {
    margin: 32px 0 14px;
    font-size: clamp(20px, 2.4vw, 28px);
    letter-spacing: -0.01em;
    font-weight: 700;
}

.mall-section-sub {
    margin: 0 0 12px;
    color: var(--hue-ink-soft);
    font-size: 13px;
}

/* Forms (login / register / checkout) */

.mall-form-wrap {
    max-width: 480px;
    margin: 0 auto;
    background: #fff;
    border: 1px solid var(--hue-line);
    border-radius: 22px;
    padding: 32px 32px 28px;
    box-shadow: var(--hue-shadow-soft);
}

.mall-form-wrap h2 {
    margin: 0 0 16px;
    font-size: 24px;
    letter-spacing: -0.01em;
    font-weight: 700;
}

.mall-form-wrap p.hint {
    margin: 0 0 16px;
    color: var(--hue-ink-muted);
    font-size: 13px;
    line-height: 1.6;
}

.mall-form-row {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 14px;
}

.mall-form-row label {
    font-size: 12.5px;
    color: var(--hue-ink-soft);
    letter-spacing: 0.2px;
}

.mall-form-row input,
.mall-form-row select,
.mall-form-row textarea {
    padding: 11px 14px;
    border-radius: 12px;
    border: 1px solid var(--hue-line);
    font-size: 14px;
    font-family: inherit;
    background: #fafafa;
    transition: border-color 0.14s ease, background 0.14s ease;
}

.mall-form-row input:focus,
.mall-form-row select:focus,
.mall-form-row textarea:focus {
    outline: none;
    border-color: var(--hue-blue);
    background: #fff;
}

.mall-form-actions {
    display: flex;
    gap: 10px;
    margin-top: 14px;
}

.mall-form-actions .btn-pill {
    flex: 1;
    justify-content: center;
    padding: 11px 22px;
}

.mall-form-tabs {
    display: flex;
    gap: 6px;
    margin-bottom: 18px;
}

.mall-form-tabs button {
    flex: 1;
    padding: 9px 16px;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.05);
    color: var(--hue-ink);
    border: 0;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.14s ease, color 0.14s ease;
}

.mall-form-tabs button.is-active {
    background: var(--hue-ink);
    color: #fff;
}

/* Cart / checkout / orders tables */

.mall-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border: 1px solid var(--hue-line);
    border-radius: 18px;
    overflow: hidden;
}

.mall-table thead {
    background: rgba(0, 0, 0, 0.02);
}

.mall-table th, .mall-table td {
    text-align: left;
    padding: 12px 14px;
    border-bottom: 1px solid var(--hue-line);
    font-size: 13px;
    color: var(--hue-ink);
    vertical-align: middle;
}

.mall-table tbody tr:last-child td {
    border-bottom: 0;
}

.mall-table th {
    font-weight: 600;
    color: var(--hue-ink-soft);
    letter-spacing: 0.2px;
    font-size: 12px;
    text-transform: uppercase;
}

.mall-table td.num {
    font-variant-numeric: tabular-nums;
    font-weight: 600;
}

.mall-summary {
    margin-top: 18px;
    background: #fff;
    border: 1px solid var(--hue-line);
    border-radius: 18px;
    padding: 16px 18px;
}

.mall-summary .row {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
    font-size: 13.5px;
    color: var(--hue-ink-soft);
}

.mall-summary .row.total {
    border-top: 1px dashed var(--hue-line);
    margin-top: 6px;
    padding-top: 12px;
    color: var(--hue-ink);
    font-weight: 700;
    font-size: 17px;
}

/* Status pills */

.status-pill {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 999px;
    font-size: 11.5px;
    letter-spacing: 0.3px;
    font-weight: 600;
    text-transform: uppercase;
}

.status-pending  { background: rgba(255, 159, 10, 0.14); color: #b96900; }
.status-paying   { background: rgba(94, 92, 230, 0.14); color: #4945c2; }
.status-paid     { background: rgba(52, 199, 89, 0.16); color: #1f7a3a; }
.status-shipped  { background: rgba(0, 113, 227, 0.14); color: #0a4d99; }
.status-cancelled{ background: rgba(120, 120, 124, 0.16); color: #5b5b62; }
.status-refunded { background: rgba(220, 30, 52, 0.14); color: #b81a2c; }

/* Product detail */

.product-detail {
    display: grid;
    grid-template-columns: 1.05fr 1fr;
    gap: 28px;
    align-items: start;
}

.product-detail .visual {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.product-detail .visual-main {
    border-radius: 22px;
    overflow: hidden;
    background: #f3f3f6;
    aspect-ratio: 5 / 4;
}
.product-detail .visual-main img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.product-detail .visual-thumbs {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}
.product-detail .visual-thumbs img {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    border-radius: 12px;
    border: 1px solid var(--hue-line);
    background: #f3f3f6;
    display: block;
}
.product-detail .visual img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.product-detail .copy h1 {
    margin: 0 0 6px;
    font-size: clamp(24px, 3vw, 34px);
    letter-spacing: -0.01em;
    font-weight: 700;
}

.product-detail .copy .price {
    margin: 0 0 12px;
    font-size: 22px;
    font-weight: 700;
    color: var(--hue-accent);
}

.product-detail .copy .desc {
    color: var(--hue-ink-soft);
    font-size: 14px;
    line-height: 1.7;
}

.product-detail .actions {
    display: flex;
    gap: 10px;
    margin-top: 18px;
}

.review-list {
    margin-top: 30px;
}

.review {
    border: 1px solid var(--hue-line);
    border-radius: 16px;
    padding: 14px 16px;
    margin-bottom: 12px;
    background: #fff;
}

.review .review-header {
    display: flex;
    justify-content: space-between;
    color: var(--hue-ink-muted);
    font-size: 12px;
}

.review .review-body {
    margin-top: 8px;
    color: var(--hue-ink);
    font-size: 14px;
    line-height: 1.65;
}

.review-form {
    margin-top: 14px;
    background: #fff;
    border: 1px solid var(--hue-line);
    border-radius: 16px;
    padding: 14px 16px;
}

.review-form textarea {
    width: 100%;
    min-height: 80px;
    padding: 10px 12px;
    border: 1px solid var(--hue-line);
    border-radius: 12px;
    font-family: inherit;
    font-size: 13px;
}

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

/* Supplier / admin */

.console-grid {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 22px;
}

.console-side {
    background: #fff;
    border: 1px solid var(--hue-line);
    border-radius: 18px;
    padding: 18px;
}

.console-side h3 {
    margin: 0 0 8px;
    font-size: 14px;
    color: var(--hue-ink-muted);
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.console-side dl {
    margin: 0;
    font-size: 13px;
}

.console-side dl dt {
    color: var(--hue-ink-muted);
    margin-top: 8px;
    font-size: 11.5px;
}

.console-side dl dd {
    margin: 4px 0 0;
    color: var(--hue-ink);
    font-weight: 500;
}

.console-main {
    background: #fff;
    border: 1px solid var(--hue-line);
    border-radius: 18px;
    padding: 20px 22px;
    min-height: 320px;
}

@media (max-width: 760px) {
    .console-grid { grid-template-columns: 1fr; }
}

/* Notice banners */

.mall-notice {
    margin: 18px 0 0;
    padding: 12px 16px;
    border-radius: 14px;
    background: rgba(0, 113, 227, 0.08);
    color: #0b51a5;
    font-size: 13px;
    line-height: 1.6;
    border: 1px solid rgba(0, 113, 227, 0.18);
}

.mall-notice.warn {
    background: rgba(220, 30, 52, 0.08);
    color: #a4172a;
    border-color: rgba(220, 30, 52, 0.18);
}
