/* ==========================================================================
   PREMIUM SELLER DASHBOARD & PUBLIC SELLER SHOP - FACEBOOK-STYLE PROFILE LOOK
   ========================================================================== */

/* Make My Account page full-width by hiding the sidebar navigation/wrapper and extending the content pane */
.woocommerce-account .woocommerce-MyAccount-navigation,
.woocommerce-account .wd-my-account-sidebar,
.woocommerce-account .my-account-title,
.woocommerce-account h3.title.my-account-title {
    display: none !important;
}

/* Reset Bootstrap Column parameters & Margin Offsets to align perfectly center */
.woocommerce-account .woocommerce-MyAccount-content,
.woocommerce-account .col-lg-9.woocommerce-MyAccount-content,
.woocommerce-account .col-md-8.woocommerce-MyAccount-content {
    width: 100% !important;
    flex: 0 0 100% !important;
    max-width: 100% !important;
    padding: 0 !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    left: 0 !important;
    right: 0 !important;
    float: none !important;
}

/* Force parent container adjustments for full width styling */
.woocommerce-account .row.MyAccount-content-wrapper,
.woocommerce-account .woocommerce {
    display: block !important;
    width: 100% !important;
}

/* Fallback: Hide Woodmart default bottom links via CSS in case they bypass PHP actions */
.wd-my-account-links, 
.woodmart-my-account-links,
.woocommerce-account .woodmart-my-account-links {
    display: none !important;
}

.pm-seller-dashboard-wrapper,
.pm-public-profile-container {
    font-family: sans-serif;
    color: #333333;
    width: 100%;
    margin: 20px 0;
    box-sizing: border-box;
}

/* RTL Support */
.pm-seller-dashboard-wrapper.pm-rtl,
.pm-public-profile-container.pm-rtl {
    direction: rtl;
    text-align: right;
}

/* ==========================================
   1. FACEBOOK-STYLE COVER & AVATAR HEADER
   ========================================== */
.pm-dash-header-facebook-style,
.pm-public-header-wrapper {
    background: #ffffff;
    border: 1px solid #eaeaea;
    border-radius: 12px;
    margin-bottom: 30px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.03);
    overflow: hidden;
    position: relative;
    width: 100%;
}

.pm-dash-cover-photo-wrapper,
.pm-public-cover-photo {
    height: 250px;
    position: relative;
    background: linear-gradient(135deg, #a8e063 0%, #56ab2f 100%);
    width: 100%;
    overflow: hidden;
}

#pm-seller-cover-img,
.pm-cover-img-elem {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.pm-cover-placeholder,
.pm-public-cover-placeholder {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #a8e063 0%, #56ab2f 100%);
}

.pm-cover-upload-label {
    position: absolute;
    bottom: 12px;
    right: 12px;
    background: rgba(0, 0, 0, 0.65);
    color: #ffffff;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    backdrop-filter: blur(4px);
    transition: background 0.2s ease;
    z-index: 10;
}

.pm-cover-upload-label:hover {
    background: rgba(0, 0, 0, 0.85);
}

#pm-cover-upload-file {
    display: none !important;
}

/* Avatar and Info Container Row */
.pm-dash-profile-meta-row,
.pm-public-profile-meta-row {
    display: flex;
    align-items: flex-end;
    padding: 0 25px 25px 25px;
    margin-top: -55px; /* Overlap cover photo */
    position: relative;
    z-index: 5;
    gap: 20px;
}

.pm-dash-avatar-wrapper,
.pm-public-avatar-wrapper {
    position: relative;
    width: 120px;
    height: 120px;
    border-radius: 50%;
    border: 4px solid #ffffff;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    background-color: #f7f9fa;
    flex-shrink: 0;
    z-index: 10;
}

#pm-seller-avatar-img,
.pm-public-avatar-img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

.pm-dash-profile-info,
.pm-public-info-block {
    flex-grow: 1;
    margin-bottom: 5px;
}

.pm-dash-display-name,
.pm-public-display-name {
    margin: 0 0 6px 0 !important;
    font-size: 24px;
    font-weight: 800;
    color: #333333;
}

.pm-profile-meta-tags,
.pm-public-meta-tags-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 15px;
}

.pm-meta-tag,
.pm-pub-meta-tag {
    font-size: 13px;
    font-weight: 600;
    color: #666666;
}

.pm-meta-tag.whatsapp-tag {
    color: #28a745;
}


/* ==========================================
   2. STATISTICS CARDS
   ========================================== */
.pm-dash-stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 35px;
}

.pm-stat-card {
    background: #ffffff;
    border: 1px solid #eaeaea;
    border-radius: 12px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.02);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.pm-stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.06);
}

.pm-stat-icon {
    font-size: 28px;
    background: rgba(40, 167, 69, 0.08);
    color: #28a745;
    width: 54px;
    height: 54px;
    border-radius: 10px;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-shrink: 0;
}

.pm-stat-content h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 800;
    color: #333333;
}

.pm-stat-content p {
    margin: 3px 0 0 0;
    font-size: 12px;
    color: #777777;
    font-weight: 600;
}


/* ==========================================
   3. SPA NAVIGATION TABS
   ========================================== */
.pm-dash-tabs-nav {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-bottom: 25px;
    border-bottom: 2px solid #eaeaea;
    overflow-x: auto;
    white-space: nowrap;
    scrollbar-width: none;
}

.pm-dash-tabs-nav::-webkit-scrollbar {
    display: none;
}

.pm-tab-btn {
    background: none;
    border: none;
    padding: 12px 20px;
    font-size: 14px;
    font-weight: 700;
    color: #666666;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    transition: all 0.2s ease;
    outline: none !important;
}

.pm-tab-btn:hover {
    color: #28a745;
}

.pm-tab-btn.active {
    color: #28a745;
    border-bottom-color: #28a745;
}

/* Logout Tab link alignment */
.pm-logout-tab-btn {
    margin-left: auto;
    color: #dc3545 !important;
}

.pm-rtl .pm-logout-tab-btn {
    margin-left: 0;
    margin-right: auto;
}

.pm-logout-tab-btn:hover {
    color: #bd2130 !important;
    background: rgba(220, 53, 69, 0.04) !important;
    border-radius: 6px;
}

/* Tab Panes */
.pm-tab-pane {
    display: none;
}

.pm-tab-pane.active {
    display: block;
    animation: pmFadeIn 0.3s ease;
}

@keyframes pmFadeIn {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: translateY(0); }
}


/* ==========================================
   4. TABLES & LISTINGS
   ========================================== */
.pm-dash-table-responsive {
    width: 100%;
    overflow-x: auto;
    border: 1px solid #eaeaea;
    border-radius: 8px;
}

.pm-dash-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    background: #ffffff;
    font-size: 14px;
}

.pm-rtl .pm-dash-table {
    text-align: right;
}

.pm-dash-table th {
    background: #f7f9fa;
    color: #555555;
    font-weight: 700;
    padding: 14px 18px;
    border-bottom: 1px solid #eaeaea;
}

.pm-dash-table td {
    padding: 14px 18px;
    border-bottom: 1px solid #f2f2f2;
    vertical-align: middle;
}

.pm-dash-table tr:last-child td {
    border-bottom: none;
}

.pm-table-thumb {
    width: 48px;
    height: 48px;
    border-radius: 6px;
    object-fit: cover;
    border: 1px solid #ddd;
}


/* ==========================================
   5. STOCK SLIDER & BADGES
   ========================================== */
.pm-badge {
    display: inline-block;
    padding: 4px 8px;
    font-size: 11px;
    font-weight: 700;
    border-radius: 4px;
    text-transform: uppercase;
}

.pm-badge.status-active {
    background: #e2f0d9;
    color: #385723;
}

.pm-badge.status-pending {
    background: #fff2cc;
    color: #b2a100;
}

.pm-stock-switch {
    position: relative;
    display: inline-block;
    width: 46px;
    height: 24px;
}

.pm-stock-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.pm-stock-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .3s;
    border-radius: 24px;
}

.pm-stock-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .3s;
    border-radius: 50%;
}

.pm-stock-switch input:checked + .pm-stock-slider {
    background-color: #28a745;
}

.pm-stock-switch input:checked + .pm-stock-slider:before {
    transform: translateX(22px);
}

.pm-rtl .pm-stock-switch input:checked + .pm-stock-slider:before {
    transform: translateX(-22px);
}

.pm-table-actions {
    display: flex;
    gap: 12px;
}

.pm-action-link {
    text-decoration: none !important;
    font-size: 13px;
    font-weight: 700;
}

.pm-action-link.edit-link {
    color: #28a745;
}

.pm-action-link.delete-link {
    color: #dc3545;
}


/* ==========================================
   6. PUBLIC SELLER PROFILE COLUMNS & SHOP GRID
   ========================================== */
.pm-public-columns-grid {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 30px;
    align-items: flex-start;
}

.pm-public-col-sidebar {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.pm-public-card {
    background: #ffffff;
    border: 1px solid #eaeaea;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.02);
}

.pm-card-title {
    margin: 0 0 15px 0;
    font-size: 16px;
    font-weight: 700;
    color: #28a745;
    border-bottom: 2px solid #e2f0d9;
    padding-bottom: 8px;
}

.pm-public-col-content {
    background: #ffffff;
    border: 1px solid #eaeaea;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.02);
}

.pm-grid-main-title {
    margin: 0 0 25px 0;
    font-size: 20px;
    font-weight: 800;
    color: #333333;
}

/* Products Grid */
.pm-public-products-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.pm-pub-product-card {
    background: #ffffff;
    border: 1px solid #eaeaea;
    border-radius: 10px;
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.pm-pub-product-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.06);
}

.pm-pub-prod-img-link {
    display: block;
    height: 180px;
    overflow: hidden;
}

.pm-pub-prod-img-link img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.pm-pub-product-card:hover .pm-pub-prod-img-link img {
    transform: scale(1.05);
}

.pm-pub-prod-details {
    padding: 15px;
}

.pm-pub-prod-title {
    margin: 0 0 8px 0;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.4;
}

.pm-pub-prod-title a {
    color: #333333;
    text-decoration: none !important;
}

.pm-pub-prod-title a:hover {
    color: #28a745;
}

.pm-pub-prod-location {
    display: block;
    font-size: 11px;
    color: #777777;
    margin-bottom: 12px;
}

.pm-pub-prod-price-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.pm-pub-prod-price {
    font-weight: 800;
    color: #28a745;
    font-size: 15px;
}

.pm-pub-prod-wa-icon {
    font-size: 16px;
    text-decoration: none !important;
    background: #e2f0d9;
    color: #28a745;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: bold;
}


/* ==========================================
   7. SINGLE PRODUCT PAGE SELLER BOX
   ========================================== */
.pm-single-seller-box {
    background: #f7fbf8;
    border: 1px solid #c5e1b4;
    border-radius: 12px;
    padding: 20px;
    margin: 25px 0;
}

.pm-single-seller-box.pm-rtl {
    direction: rtl;
}

.pm-seller-box-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
}

.pm-seller-box-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #28a745;
    background-color: #f0f0f0;
}

.pm-seller-box-meta {
    display: flex;
    flex-direction: column;
}

.pm-seller-label {
    font-size: 11px;
    text-transform: uppercase;
    color: #666666;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.pm-seller-name {
    font-size: 16px;
    color: #333333;
    font-weight: 800;
    margin: 2px 0;
}

.pm-seller-loc {
    font-size: 12px;
    color: #555555;
    font-weight: 600;
}

.pm-seller-box-actions {
    display: flex;
    gap: 10px;
}

.pm-view-profile-btn {
    background: #28a745 !important;
    color: #ffffff !important;
    flex-grow: 1;
    text-align: center;
    font-weight: bold !important;
    border-radius: 6px !important;
    text-decoration: none !important;
    padding: 10px 15px !important;
    font-size: 13px !important;
}

.pm-view-profile-btn:hover {
    background: #218838 !important;
}

.pm-wa-btn {
    background: #ffffff !important;
    color: #28a745 !important;
    border: 1px solid #28a745 !important;
    font-weight: bold !important;
    border-radius: 6px !important;
    text-decoration: none !important;
    padding: 10px 15px !important;
    font-size: 13px !important;
}

.pm-wa-btn:hover {
    background: #e2f0d9 !important;
}


/* ==========================================
   8. MEDIA RESPONSIVE BREAKPOINTS
   ========================================== */
@media (max-width: 991px) {
    .pm-public-columns-grid {
        grid-template-columns: 1fr;
        gap: 25px;
    }
    
    .pm-public-products-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .pm-dash-stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .pm-dash-cover-photo-wrapper,
    .pm-public-cover-photo {
        height: 160px;
    }
    
    .pm-dash-profile-meta-row,
    .pm-public-profile-meta-row {
        flex-direction: column;
        align-items: center;
        text-align: center;
        margin-top: -50px;
        padding: 0 15px 15px 15px;
        gap: 12px;
    }
    
    .pm-dash-avatar-wrapper,
    .pm-public-avatar-wrapper {
        width: 100px;
        height: 100px;
    }
    
    .pm-profile-meta-tags,
    .pm-public-meta-tags-list {
        justify-content: center;
        gap: 8px 12px;
    }
    
    .pm-dash-stats-grid {
        grid-template-columns: 1fr;
    }
    
    .pm-public-products-grid {
        grid-template-columns: 1fr;
    }
    
    .pm-pub-prod-img-link {
        height: 200px;
    }
    
    .pm-dash-table th, 
    .pm-dash-table td {
        padding: 10px;
    }
    
    .pm-seller-box-actions {
        flex-direction: column;
        gap: 8px;
    }
    
    .pm-logout-tab-btn {
        margin-left: 0;
    }
}

/* ==========================================
   9. INTEREST-BASED FEED PRODUCT STYLING
   ========================================== */
.pm-interest-feed-wrapper {
    margin: 40px 0;
    width: 100%;
}

.pm-feed-title {
    font-size: 22px;
    font-weight: 800;
    color: #333333;
    margin-bottom: 20px;
    border-bottom: 2px solid #eaeaea;
    padding-bottom: 10px;
}

.pm-interest-products-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 25px;
}

@media (max-width: 991px) {
    .pm-interest-products-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 576px) {
    .pm-interest-products-grid {
        grid-template-columns: 1fr;
    }
}

/* ==========================================
   10. COLLAPSIBLE SIDEBAR CARDS ON MOBILE
   ========================================== */
.pm-collapsible-card .pm-card-toggle-icon {
    display: none;
}

@media (max-width: 768px) {
    .pm-collapsible-card .pm-card-title {
        cursor: pointer;
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 0 !important;
        border-bottom: none !important;
        padding-bottom: 0 !important;
        transition: all 0.2s ease;
    }
    
    .pm-collapsible-card .pm-card-toggle-icon {
        display: inline-block;
        font-size: 10px;
        color: #888888;
        transition: transform 0.2s ease;
    }
    
    .pm-collapsible-card .pm-card-content {
        display: none;
        margin-top: 15px;
        animation: pmSlideDown 0.25s ease-out;
    }
    
    .pm-collapsible-card.pm-active .pm-card-content {
        display: block;
    }
    
    .pm-collapsible-card.pm-active .pm-card-title {
        border-bottom: 2px solid #e2f0d9 !important;
        padding-bottom: 8px !important;
        margin-bottom: 15px !important;
    }
    
    .pm-collapsible-card.pm-active .pm-card-toggle-icon {
        transform: rotate(180deg);
    }
}

@keyframes pmSlideDown {
    from { opacity: 0; transform: translateY(-5px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ==========================================
   11. DYNAMIC DETAILS MODAL & TABLE RESPONSIVENESS
   ========================================== */
.pm-col-show-mobile {
    display: none !important;
}

.pm-mobile-only-meta {
    display: none;
}

@media (max-width: 768px) {
    .pm-col-hide-mobile {
        display: none !important;
    }
    .pm-col-show-mobile {
        display: table-cell !important;
    }
    th.pm-col-show-mobile {
        display: table-cell !important;
    }
    .pm-mobile-only-meta {
        display: block !important;
    }
}

/* Modal Overlay base layout */
.pm-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 99999;
    display: flex;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(4px);
}

.pm-modal-dialog {
    width: 90%;
    max-width: 440px;
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    overflow: hidden;
    animation: pmModalShow 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes pmModalShow {
    from { transform: scale(0.95); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.pm-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid #eaeaea;
}

.pm-modal-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 800;
    color: #333333;
}

.pm-modal-close {
    font-size: 24px;
    font-weight: 700;
    color: #999999;
    cursor: pointer;
    line-height: 1;
}

.pm-modal-close:hover {
    color: #333333;
}

.pm-modal-body {
    padding: 20px;
}

.pm-modal-img-wrapper {
    height: 180px;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 15px;
    background: #f7f9fa;
    border: 1px solid #eaeaea;
}

.pm-modal-img-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.pm-modal-meta-list {
    list-style: none !important;
    padding: 0 !important;
    margin: 0 0 20px 0 !important;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.pm-modal-meta-list li {
    display: flex;
    justify-content: space-between;
    font-size: 14px;
    padding-bottom: 10px;
    border-bottom: 1px solid #f2f2f2;
}

.pm-modal-meta-list li:last-child {
    border-bottom: none;
}

.pm-modal-meta-list strong {
    color: #333333;
}

.pm-modal-meta-list span {
    color: #666666;
    text-align: right;
}

.pm-modal-actions-row {
    display: flex;
    gap: 12px;
    margin-top: 15px;
}

.pm-modal-btn {
    flex-grow: 1;
    text-align: center;
    padding: 12px;
    font-size: 13px;
    font-weight: 700;
    border-radius: 8px;
    text-decoration: none !important;
}

.pm-modal-btn.btn-edit {
    background: #e2f0d9;
    color: #28a745;
}

.pm-modal-btn.btn-edit:hover {
    background: #d4ebd0;
}

.pm-modal-btn.btn-delete {
    background: #fce8e6;
    color: #dc3545;
}

.pm-modal-btn.btn-delete:hover {
    background: #fbd3d0;
}
