/* ============================================================
   Bismon Product Card - v5 (Mockup Match + Stronger Colors)
   ============================================================ */

/* === Card Container === */
.bm-card {
    background: #ffffff;
    border: 1px solid #e8e8e8;
    border-radius: 16px;
    overflow: hidden;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    height: 100%;
    margin-bottom: 24px;
}

.bm-card:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.10);
    transform: translateY(-3px);
    border-color: #00a99d;
}

/* === Card Image === */
.bm-card-image {
    background: #fafafa;
    padding: 30px 20px;
    text-align: center;
    border-bottom: 1px solid #f0f0f0;
    min-height: 240px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.bm-card-image img {
    max-width: 100%;
    max-height: 200px;
    height: auto;
    object-fit: contain;
    transition: transform 0.3s ease;
}

.bm-card:hover .bm-card-image img {
    transform: scale(1.05);
}

/* === Card Body === */
.bm-card-body {
    padding: 20px 22px 0 22px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

/* === Card Title === */
.bm-card-title {
    font-size: 16px;
    font-weight: 600;
    line-height: 1.5;
    color: #2c3e50;
    margin: 0 0 18px 0;
    min-height: 72px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.bm-card-title a {
    color: inherit;
    text-decoration: none;
    transition: color 0.2s ease;
}

.bm-card-title a:hover {
    color: #00a99d;
}

/* === Details Box === */
.bm-card-details {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 14px 18px;
    margin-bottom: 16px;
    flex-grow: 1;
}

/* === Detail Row === */
.bm-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px dashed #d0d3d6;
    font-size: 14px;
    line-height: 1.4;
    gap: 8px;
}

.bm-row:first-child {
    padding-top: 2px;
}

.bm-row:last-child {
    border-bottom: none;
    padding-bottom: 2px;
}

/* === Label === */
.bm-label {
    color: #555;
    font-weight: 500;
    flex-shrink: 0;
}

/* === Part Number Badge - SOLID GREEN === */
.bm-pn-badge {
    color: #ffffff !important;
    font-weight: 700;
    font-family: 'Courier New', monospace;
    font-size: 13px;
    background: #00a99d !important;
    padding: 5px 14px;
    border-radius: 6px;
    letter-spacing: 0.5px;
    text-align: right;
    word-break: break-word;
}

/* === Brand === */
.bm-brand {
    color: #2c3e50;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 14px;
}

/* === Price - STRONG RED === */
.bm-price {
    color: #e74c3c !important;
    font-weight: 700;
    font-size: 14px;
}

/* === Dealer Note === */
.bm-dealer-note {
    text-align: right;
    font-size: 12px;
    color: #888;
    font-style: italic;
    padding: 6px 0 10px 0;
    margin: 0;
    border-bottom: 1px dashed #d0d3d6;
}

/* === Warranty - STRONG GREEN === */
.bm-warranty {
    color: #27ae60 !important;
    font-weight: 700;
    font-size: 14px;
}

/* === Card Button - SOLID GREEN === */
.bm-card-button {
    display: flex !important;
    justify-content: center;
    align-items: center;
    width: calc(100% - 44px);
    margin: 0 22px 22px 22px;
    padding: 14px 18px;
    background: #00a99d !important;
    color: #ffffff !important;
    text-decoration: none !important;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.3px;
    transition: all 0.2s ease;
    border: none;
    cursor: pointer;
}

.bm-card-button:hover {
    background: #008c80 !important;
    box-shadow: 0 4px 12px rgba(0, 169, 157, 0.4);
    transform: translateY(-1px);
    color: #ffffff !important;
    text-decoration: none !important;
}

.bm-card-button .arrow {
    margin-left: 8px;
    transition: transform 0.2s ease;
    font-size: 16px;
}

.bm-card-button:hover .arrow {
    transform: translateX(4px);
}

/* === Container Adjustment === */
.col-md-3.p-mobile.product-detail-card,
.col-md-4.p-mobile {
    padding: 0 12px !important;
}

.col-md-3.p-mobile.product-detail-card {
    background: transparent !important;
    border: none !important;
}

/* === Override old card styles to prevent conflicts === */
.product-detail-card .bm-card,
.p-mobile .bm-card {
    background: #ffffff !important;
}

/* === Responsive === */
@media (max-width: 768px) {
    .bm-card-title {
        font-size: 15px;
        min-height: auto;
    }
    
    .bm-card-image {
        min-height: 200px;
        padding: 24px 16px;
    }
    
    .bm-card-image img {
        max-height: 180px;
    }
    
    .bm-row {
        font-size: 13px;
    }
}

@media (max-width: 600px) {
    .bm-card-body {
        padding: 16px 16px 0 16px;
    }
    
    .bm-card-button {
        width: calc(100% - 32px);
        margin: 0 16px 16px 16px;
    }
    
    .bm-card-image {
        min-height: 160px;
        padding: 16px;
    }
    
    .bm-card-image img {
        max-height: 140px;
    }
}

/* ============================================================
   Patch v6 — Sidebar-Aware Adjustments
   ============================================================ */

.bm-pn-badge {
    word-break: break-all !important;
    overflow-wrap: anywhere !important;
    line-height: 1.4 !important;
    text-align: right !important;
    display: inline-block !important;
}

.bm-row {
    flex-wrap: wrap !important;
    gap: 6px 8px !important;
}

.bm-row > span:last-child {
    text-align: right !important;
    word-break: break-word !important;
    margin-left: auto !important;
}

.bm-card-button {
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
}

@media (min-width: 768px) {
    .col-md-6.bm-card-wrapper .bm-card-title {
        font-size: 14px !important;
        min-height: 60px !important;
        -webkit-line-clamp: 2 !important;
    }
    
    .col-md-6.bm-card-wrapper .bm-row {
        font-size: 13px !important;
        padding: 9px 0 !important;
    }
    
    .col-md-6.bm-card-wrapper .bm-pn-badge {
        font-size: 12px !important;
        padding: 4px 10px !important;
        max-width: 65% !important;
    }
    
    .col-md-6.bm-card-wrapper .bm-card-button {
        font-size: 13px !important;
        padding: 12px 14px !important;
    }
    
    .col-md-6.bm-card-wrapper .bm-card-image {
        min-height: 200px !important;
        padding: 24px 16px !important;
    }
    
    .col-md-6.bm-card-wrapper .bm-card-image img {
        max-height: 170px !important;
    }
    
    .col-md-6.bm-card-wrapper .bm-card-body {
        padding: 16px 18px 0 18px !important;
    }
    
    .col-md-6.bm-card-wrapper .bm-card-button {
        margin: 0 18px 18px 18px !important;
        width: calc(100% - 36px) !important;
    }
    
    .col-md-6.bm-card-wrapper .bm-card-details {
        padding: 12px 14px !important;
    }
    
    .col-md-6.bm-card-wrapper .bm-dealer-note {
        font-size: 11px !important;
        padding: 4px 0 8px 0 !important;
    }
}

@media (max-width: 600px) {
    .bm-card-wrapper {
        flex: 0 0 100% !important;
        max-width: 100% !important;
        padding: 0 8px !important;
    }
}

.bm-card-wrapper {
    padding: 0 12px !important;
    box-sizing: border-box !important;
    margin-bottom: 24px !important;
}

.bm-card-wrapper .bm-card {
    height: 100% !important;
    display: flex !important;
    flex-direction: column !important;
    margin-bottom: 0 !important;
}

/* ============================================================
   Patch v7 — Spacing Fix
   ============================================================
   ลดช่องว่างที่เหลือเยอะเกินไป:
   1. ระหว่าง Top menu → "Products Catalogue" banner
   2. ระหว่าง Banner → Card area
   3. ภายใน section-content-block (top padding)
   ============================================================ */

/* === Reduce page-header (PRODUCTS CATALOGUE banner) === */
.page-header {
    padding-top: 30px !important;
    padding-bottom: 30px !important;
    margin: 0 !important;
}

.page-header h3 {
    margin: 0 0 10px 0 !important;
    font-size: 28px !important;
}

.page-header .page-breadcrumb {
    margin: 0 !important;
    padding: 0 !important;
    font-size: 14px !important;
}

/* === Reduce section-content-block top padding === */
.section-content-block {
    padding-top: 30px !important;
    padding-bottom: 40px !important;
    margin-top: 0 !important;
}

/* === Mobile responsive === */
@media (max-width: 768px) {
    .page-header {
        padding-top: 20px !important;
        padding-bottom: 20px !important;
    }
    
    .page-header h3 {
        font-size: 22px !important;
    }
    
    .section-content-block {
        padding-top: 20px !important;
    }
}

/* ============================================================
   Patch v8 — Tighter Spacing
   ============================================================ */

/* Reduce page-header more */
.page-header {
    padding-top: 20px !important;
    padding-bottom: 20px !important;
}

.page-header h3 {
    font-size: 24px !important;
    margin: 0 0 8px 0 !important;
}

.page-header .page-breadcrumb {
    font-size: 13px !important;
}

/* Reduce section-content-block top */
.section-content-block {
    padding-top: 20px !important;
}

@media (max-width: 768px) {
    .page-header {
        padding-top: 14px !important;
        padding-bottom: 14px !important;
    }
    
    .page-header h3 {
        font-size: 20px !important;
    }
    
    .section-content-block {
        padding-top: 14px !important;
    }
}

/* ============================================================
   Patch v12 — Hide duplicate mobile category bar
   ============================================================
   ซ่อน .bm-mobile-cats (ชุดบน) เพราะซ้ำกับ navbar dropdown ด้านล่าง
   ============================================================ */
.bm-mobile-cats,
.bm-mobile-cats-inner {
    display: none !important;
}

/* ============================================================
   Patch v15 — Part Number + Button Height (5 May 2026)
   - Part Number: green solid → soft mint subtle
   - View More Button: ลดความสูง
   ============================================================ */

/* Part Number Badge - Soft Mint */
.bm-pn-badge {
    background: #e8f5f3 !important;
    color: #00715f !important;
    border: 0.5px solid rgba(0, 169, 157, 0.25) !important;
    font-weight: 600 !important;
    box-shadow: inset 0 1px 2px rgba(0, 169, 157, 0.05) !important;
}

/* View More Details Button - ลดความสูง ~30% */
.bm-card-button {
    padding: 10px 20px !important;
    font-size: 14px !important;
    line-height: 1.4 !important;
    min-height: auto !important;
}

/* Mobile responsive */
@media (max-width: 768px) {
    .bm-pn-badge {
        padding: 4px 12px !important;
    }
    .bm-card-button {
        padding: 9px 16px !important;
        font-size: 13px !important;
    }
}
