/* Responsive Styling for Diamond Listings (Black, Certified, Fancy, Matching Pair) */

/* ===== Topbar Fix for Tablet (768px - 991px) ===== */
@media (max-width: 991px) {
    .header-three .header-top .container > .row {
        display: flex !important;
        flex-wrap: nowrap !important;
        align-items: center !important;
        justify-content: space-between !important;
    }

    .header-three .header-top .container > .row > .col-lg-6 {
        width: auto !important;
        flex: 1 1 auto !important;
        max-width: none !important;
        float: none !important;
    }

    .header-three .header-top .container > .row > .col-lg-2 {
        display: none !important;
    }

    .header-three .header-top .container > .row > [class*="col-sm-6"][class*="col-lg-4"] {
        width: auto !important;
        flex: 0 0 auto !important;
        max-width: none !important;
        float: none !important;
        text-align: right !important;
    }

    .header-three .header-top .header-cta {
        margin-top: 0 !important;
    }

    .header-three .header-top .header-cta ul {
        margin: 0 !important;
        padding: 0 !important;
    }

    .header-three .header-top .header-social {
        margin: 0 !important;
    }

    .header-three .header-top .header-social span {
        display: flex !important;
        align-items: center !important;
        gap: 10px;
    }

    .header-three .header-top .header-social a {
        margin-left: 10px !important;
        font-size: 16px !important;
    }
}

@media (min-width: 992px) and (max-width: 1199px) {
    .certified-theme-natural > .col-md-4:nth-of-type(1),
    .certified-theme-labgrown > .col-md-4:nth-of-type(1) {
        width: 25% !important;
    }
    .certified-theme-natural > .col-md-4:nth-of-type(2),
    .certified-theme-labgrown > .col-md-4:nth-of-type(2) {
        width: 50% !important;
    }
    .certified-theme-natural > .col-md-4:nth-of-type(3),
    .certified-theme-labgrown > .col-md-4:nth-of-type(3) {
        width: 25% !important;
    }
}

.mobile-cards-container {
    display: none;
    margin-top: 15px;
}

@media (max-width: 1024px) {
    .tab-pane.table-responsive {
        overflow-x: visible !important;
        border: none !important;
    }
    .tab-pane.table-responsive table.table-list {
        display: none !important;
    }
    .mobile-cards-container {
        display: grid !important;
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
}

@media (max-width: 767px) {
    .mobile-cards-container {
        grid-template-columns: 1fr !important;
    }
}

.mobile-card {
    border: 1px solid #144e4e;
    border-radius: 8px;
    margin-bottom: 5px;
    padding: 12px;
    color: #fff;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.15);
    transition: all 0.2s ease-in-out;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.mobile-card:hover {
    border-color: #039e9a;
}

.mobile-card.checked {
    background: #0c3e3e;
    border-color: #5BC3C3;
    box-shadow: 0 0 10px rgba(91, 195, 195, 0.2);
}

.mobile-card .card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #144e4e;
    padding-bottom: 8px;
    margin-bottom: 10px;
}

.mobile-card .card-header .header-left {
    display: flex;
    align-items: center;
    gap: 8px;
}

.mobile-card .card-header .header-left input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin: 0 !important;
    cursor: pointer;
}

.mobile-card .card-header .header-left .lot-no {
    font-weight: 700;
    font-size: 14px;
    color: #5BC3C3;
}

.mobile-card .card-header .header-right {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
}

.mobile-card .card-header .header-right .cert-link {
    color: #5BC3C3;
    text-decoration: underline;
}

.mobile-card .card-header .header-right .status-badge {
    background: #d9534f;
    color: #fff;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: bold;
}

.mobile-card .card-header .header-right .status-new-arrival {
    background: #5cb85c;
}

.mobile-card .card-header .header-right .status-upcoming {
    background: #f0ad4e;
}

.mobile-card .card-header .header-right .status-available {
    background: #47a93f;
}

.mobile-card .card-header .header-right .status-hold {
    background: #d9534f;
}

.mobile-card .card-header .header-right .status-transit {
    background: #337ab7;
}

.mobile-card .card-body {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex-grow: 1;
}

.mobile-card .card-body .body-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
}

.mobile-card .card-body .body-top .shape-info {
    display: flex;
    align-items: center;
    gap: 6px;
}

.mobile-card .shape-name {
    font-weight: bold;
    font-size: 12px;
    color: #5BC3C3;
}

.mobile-card .carat-info {
    font-weight: bold;
    font-size: 12px;
    background: rgba(91, 195, 195, 0.1);
    padding: 2px 8px;
    border-radius: 4px;
    color: #5BC3C3;
}

.mobile-card .card-body .body-top .carat-info {
    font-weight: 700;
    color: #5BC3C3;
}

.mobile-card .details-grid {
    display: grid;
    gap: 4px;
    background: rgba(0, 0, 0, 0.2);
    padding: 6px;
    border-radius: 4px;
}

.mobile-card .details-grid.grid-6 {
    grid-template-columns: repeat(6, 1fr);
}

.mobile-card .details-grid.grid-5 {
    grid-template-columns: repeat(5, 1fr);
}

.mobile-card .details-grid .grid-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    font-size: 11px;
}

.mobile-card .details-grid .grid-item .grid-label {
    color: #88a8a8;
    font-size: 9px;
    margin-bottom: 2px;
}

.mobile-card .details-grid .grid-item .grid-val {
    font-weight: 600;
}

.mobile-card .extra-details {
    font-size: 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    border-top: 1px solid rgba(20, 78, 78, 0.5);
    padding-top: 6px;
    margin-top: 4px;
}

.mobile-card .extra-details .detail-row {
    display: flex;
    justify-content: space-between;
    color: #c4d7d7;
}

.mobile-card .extra-details .detail-row strong {
    color: #fff;
}

.mobile-card .card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid #144e4e;
    padding-top: 8px;
    margin-top: 10px;
}

.mobile-card .card-footer .footer-left {
    display: flex;
    gap: 8px;
}

.mobile-card .card-footer .footer-left .media-btn {
    background: #144e4e;
    color: #fff !important;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    border: none;
}

.mobile-card .card-footer .footer-left .media-btn:hover {
    background: #039e9a;
}

.mobile-card .card-footer .footer-right .price-val {
    font-weight: 700;
    font-size: 15px;
    color: #5BC3C3;
}

.mobile-card .card-footer .footer-right .view-price-link {
    color: #5BC3C3;
    font-size: 13px;
    font-weight: 600;
}

/* Shape Tabs & Action Buttons Responsive Styling */
@media (max-width: 1024px) {
    ul#myTab.bar_tabs:not(.front-inv-tab-row-mobile) {
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        width: 100% !important;
        border-bottom: none !important;
    }

    .front-inv-tab-row {
        flex-wrap: wrap !important;
        justify-content: center !important;
        gap: 8px !important;
        margin-bottom: 10px !important;
    }
    
    .front-inv-tab-row .dia_tab {
        width: auto !important;
        flex: 0 0 calc(50% - 8px) !important;
        max-width: 220px !important;
        min-width: 140px !important;
        margin: 0 !important;
        text-align: center !important;
        white-space: nowrap !important;
        font-size: 10px !important;
        padding: 8px 4px !important;
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        gap: 4px !important;
        border-radius: 4px !important;
    }

    .action-buttons-row {
        display: flex !important;
        flex-wrap: wrap !important;
        flex-direction: row !important;
        justify-content: center !important;
        gap: 8px !important;
        /* margin-top: 15px !important;
        margin-bottom: 15px !important; */
        float: none !important;
    }

    .action-wishlist { order: 1; }
    .action-compare { order: 2; }
    .action-enquire { order: 3; }
    .action-memo { order: 4; }
    .action-order { order: 5; }
    .action-share { order: 6; }

    .action-buttons-row::before {
        content: "";
        display: block;
        width: 100%;
        height: 1px;
        background: rgba(3, 158, 154, 0.3);
        margin-bottom: 15px;
    }

    .action-buttons-row .front_custom_button {
        float: none !important;
        margin: 0 !important;
        flex: 1 1 auto !important;
        text-align: center !important;
        min-width: 120px !important;
        max-width: 180px !important;
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        padding: 8px 12px !important;
        font-size: 11px !important;
    }

    .mobile-section-header {
        display: block !important;
    }

    /* Secondary mobile tab styling overrides to wrap instead of scrolling */
    .front-inv-tab-row-mobile {
        display: flex !important;
        flex-wrap: wrap !important;
        justify-content: center !important;
        gap: 8px !important;
        overflow-x: visible !important;
        border-bottom: none !important;
        margin-bottom: 10px !important;
        padding-left: 0 !important;
    }

    .front-inv-tab-row-mobile li {
        float: none !important;
        display: inline-block !important;
        margin: 0 !important;
        flex: 0 0 calc(50% - 8px) !important;
        max-width: 220px !important;
        min-width: 140px !important;
    }

    .front-inv-tab-row-mobile li a.resp_tabs {
        width: 100% !important;
        margin: 0 !important;
        padding: 8px 4px !important;
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        gap: 4px !important;
        box-sizing: border-box !important;
        white-space: nowrap !important;
        font-size: 10px !important;
    }
}

.front-inv-tab-row-mobile {
    display: none !important;
}
.front-inv-tabs {
    display: block !important;
}
