/* ========== PMA Products Page — restored original layout ========== */

/* Hero (dark navy, full bleed, accommodates title + search card + empty state) */
.pma-hero {
    background: linear-gradient(135deg, #0a2540 0%, #0d3461 100%);
    color: #fff;
    text-align: center;
    padding: 80px 24px 0;
    position: relative;
}
.pma-hero-inner {
    max-width: 960px;
    margin: 0 auto;
    padding: 40px 16px 60px;
}
.pma-hero-title {
    font-size: 56px;
    font-weight: 800;
    color: #fff;
    margin: 0 0 18px;
    letter-spacing: 2px;
    font-family: 'Montserrat', 'Libre Franklin', sans-serif;
}
.pma-hero-sub {
    font-size: 16px;
    color: rgba(255, 255, 255, 0.92);
    margin: 0 auto;
    max-width: 720px;
    line-height: 1.6;
}

/* Search card overlapping the hero / empty-state boundary */
.search-card-wrap {
    position: relative;
    max-width: 920px;
    margin: 0 auto;
    padding: 0 24px;
    margin-top: -40px;
    margin-bottom: 60px;   /* 拉开搜索框与下方结果区的距离，确保圆角阴影完整显示 */
    z-index: 10;
}
.search-card {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.18);
    padding: 18px 20px;
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
}
.search-card input[type="text"] {
    flex: 1.5 1 260px;
    min-width: 200px;
    padding: 14px 18px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 15px;
    color: #1a202c;
    outline: none;
    transition: border-color .15s;
}
.search-card input[type="text"]:focus {
    border-color: #0056b3;
}
.search-card select {
    flex: 1 1 180px;
    min-width: 160px;
    padding: 14px 18px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #fff;
    font-size: 15px;
    color: #1a202c;
    cursor: pointer;
    outline: none;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'><path d='M2 4l4 4 4-4' stroke='%234a5568' stroke-width='1.6' fill='none' stroke-linecap='round' stroke-linejoin='round'/></svg>");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 38px;
}
.btn-search {
    flex: 0 0 auto;
    padding: 14px 36px;
    background: var(--primary-blue, #0056b3);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background .15s;
    font-family: 'Montserrat', sans-serif;
}
.btn-search:hover { background: #003d82; }

/* Empty state (on dark navy, below search card) */
.empty-state {
    background: linear-gradient(135deg, #0a2540 0%, #0d3461 100%);
    color: #fff;
    text-align: center;
    padding: 70px 24px 110px;
    margin-top: -1px;
}
.empty-icon {
    display: inline-block;
    margin-bottom: 18px;
}
.empty-title {
    font-size: 30px;
    font-weight: 700;
    margin: 0 0 14px;
    color: #fff;
}
.empty-hint {
    font-size: 16px;
    margin: 0 0 8px;
    color: rgba(255, 255, 255, 0.85);
}
.empty-tag {
    font-size: 14px;
    margin: 0;
    color: rgba(135, 180, 230, 0.95);
}

/* Result stage (white) */
.result-stage {
    background: #fff;
    min-height: 240px;
    padding-bottom: 60px;
}
.result-meta {
    max-width: 1200px;
    margin: 4px auto 18px;     /* 搜索框已自带下边距，此处仅需 4px 顶距承接 */
    padding: 0 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}
.result-count {
    color: #4a5568;
    font-size: 15px;
}
.btn-clear {
    padding: 8px 18px;
    background: transparent;
    border: 1px solid #cbd5e0;
    border-radius: 6px;
    color: #4a5568;
    cursor: pointer;
    font-size: 14px;
    transition: all .15s;
}
.btn-clear:hover {
    border-color: #0056b3;
    color: #0056b3;
}

/* Result grid: 3 columns by default */
.result-grid {
    max-width: 1200px;
    margin: 0 auto;
    padding: 12px 24px 40px;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

/* Single result: center it */
.result-grid.single {
    grid-template-columns: 1fr;
    max-width: 800px;
}
.result-grid.single .product-card {
    margin: 0 auto;
    width: 100%;
    max-width: 700px;
}

/* Product card: vertical layout for grid (photo on top, info below) */
.product-card {
    background: #fff;
    border: 1px solid #edf2f7;
    border-radius: 12px;
    overflow: hidden;
    transition: transform .15s, box-shadow .15s, border-color .15s;
    display: flex;
    flex-direction: column;
}
.product-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.10);
    border-color: #cbd5e0;
}

/* Product photo: top for grid mode */
.product-photo-wrap {
    width: 100%;
    min-height: 200px;
    max-height: 480px;          /* 限制极大照片的高度，避免撑爆卡片 */
    background: #f8fafc;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-radius: 12px 12px 0 0;
}
.product-photo {
    width: 100%;
    height: auto;               /* 自适应原始纵横比，纵向照片不再两侧留白 */
    max-height: 480px;
    object-fit: contain;
    background: #f8fafc;
    display: block;
}
.product-photo-placeholder {
    width: 100%;
    height: 100%;
    background: #f1f5f9;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #a0aec0;
    font-size: 15px;
}

/* Product info: below photo - ensure consistent height */
.product-body {
    flex: 1;
    padding: 16px 18px;
    display: flex;
    flex-direction: column;
    min-height: 180px;
}

/* Header: partno + name */
.product-header {
    margin-bottom: 10px;
}
.product-partno {
    font-size: 18px;
    font-weight: 700;
    color: #0056b3;
    margin: 0 0 4px;
    word-break: break-all;
    line-height: 1.3;
}
.product-name {
    font-size: 14px;
    color: #2d3748;
    margin: 0;
    line-height: 1.4;
    font-weight: 500;
}

/* Tags row */
.product-tags {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}
.product-tag {
    font-size: 13px;
    padding: 4px 10px;
    background: #e8f4fd;
    color: #0056b3;
    border-radius: 5px;
    font-weight: 600;
}

/* Specs grid: 2 columns for narrower cards - fixed height for alignment */
.product-specs {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px 16px;
    font-size: 13px;
    color: #4a5568;
    line-height: 1.4;
    border-top: 1px solid #edf2f7;
    padding-top: 12px;
    margin: 0;
    min-height: 70px;
    align-content: start;
}
.product-specs dt {
    font-weight: 700;
    color: #1a202c;
    font-size: 13px;
    margin-bottom: 2px;
}
.product-specs dd {
    margin: 0;
    word-break: break-word;
    color: #4a5568;
    font-size: 14px;
}

/* Actions - fixed at bottom for alignment */
.product-actions {
    display: flex;
    gap: 10px;
    margin-top: auto;
    padding-top: 12px;
}
.product-actions a {
    flex: 1;
    padding: 10px 16px;
    font-size: 13px;
    border-radius: 6px;
    text-decoration: none;
    border: 1px solid #0056b3;
    color: #0056b3;
    background: #fff;
    transition: all .15s;
    font-weight: 600;
    text-align: center;
    white-space: nowrap;
}
.product-actions a.primary {
    background: #0056b3;
    color: #fff;
}
.product-actions a:hover {
    background: #003d82;
    color: #fff;
}

/* No result */
.no-result {
    max-width: 560px;
    margin: 60px auto;
    padding: 44px 32px;
    text-align: center;
    background: #f8fafc;
    border-radius: 14px;
    border: 1px solid #e2e8f0;
}
.no-result h2 {
    margin: 12px 0 8px;
    color: #2d3748;
    font-size: 22px;
}
.no-result p {
    color: #4a5568;
    margin-bottom: 20px;
    line-height: 1.7;
}
.no-result strong { color: #0056b3; }

/* Pagination */
.pagination {
    max-width: 1200px;
    margin: 0 auto;
    padding: 16px 24px 0;
    display: flex;
    justify-content: center;
    gap: 6px;
    flex-wrap: wrap;
}
.pagination button,
.pagination span {
    padding: 8px 14px;
    border: 1px solid #e2e8f0;
    background: #fff;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    color: #4a5568;
    min-width: 38px;
}
.pagination button.active {
    background: #0056b3;
    color: #fff;
    border-color: #0056b3;
}
.pagination button:hover:not(.active):not(:disabled) {
    border-color: #0056b3;
    color: #0056b3;
}
.pagination button:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}
.pagination span { border: none; background: transparent; cursor: default; }

/* Utilities */
.hidden { display: none !important; }

/* Header tweaks to match screenshot (small X mark + PRODUCTS active underline) */
header .logo {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
}
header .logo-mark {\n    color: #0056b3;\n    font-size: 20px;\n    margin-right: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
header nav a {
    position: relative;
}
header nav a.active {
    color: #0056b3;
}
header nav a.active::after {
    content: '';
    position: absolute;
    left: 50%;
    bottom: -8px;
    transform: translateX(-50%);
    width: 24px;
    height: 2px;
    background: #0056b3;
    border-radius: 1px;
}

/* Mobile: stack vertically */
@media (max-width: 768px) {
    .pma-hero { padding: 48px 16px 0; }
    .pma-hero-title { font-size: 36px; letter-spacing: 1px; }
    .pma-hero-sub { font-size: 14px; }
    .search-card-wrap { margin-top: -20px; padding: 0 12px; }
    .search-card { padding: 14px; gap: 10px; }
    .search-card input[type="text"],
    .search-card select,
    .btn-search { flex: 1 1 100%; width: 100%; }
    .empty-state { padding: 50px 16px 80px; }
    .empty-title { font-size: 24px; }
    .result-grid { padding: 12px 14px 30px; gap: 14px; }
    .product-card { flex-direction: column; min-height: auto; }
    .product-photo-wrap { width: 100%; flex: none; }
    .product-photo { height: auto; max-height: 320px; }
    .product-photo-placeholder { height: 180px; }
    .product-body { padding: 16px; }
    .product-partno { font-size: 19px; }
    .product-name { font-size: 15px; }
    .product-specs { grid-template-columns: 1fr 1fr; font-size: 14px; }
    .product-actions a { padding: 10px 8px; font-size: 13px; }
}
