/**
 * Single Company Template Styles
 */

/* Main Wrapper */
.pcd-single-company-wrapper {
    background: #f5f5f5;
    padding: 0;
}

/* Container */
.pcd-company-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px;
}

/* Banner Section */
.pcd-company-banner {
    margin-bottom: 40px;
}

/* Company Header */
.pcd-company-header {
    background: #fff;
    border-radius: 12px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.pcd-company-main-info {
    display: flex;
    gap: 30px;
    align-items: flex-start;
    margin-bottom: 30px;
    padding-bottom: 30px;
    border-bottom: 1px solid #e5e5e5;
}

.pcd-company-logo img {
    max-width: 150px;
    max-height: 150px;
    object-fit: contain;
    border-radius: 8px;
}

.pcd-company-title-block {
    flex: 1;
}

.pcd-company-name {
    font-size: 36px;
    font-weight: 700;
    margin: 0 0 15px 0;
    color: #1a1a1a;
}

.pcd-company-meta {
    display: flex;
    gap: 25px;
    flex-wrap: wrap;
}

.pcd-meta-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 15px;
}

.pcd-meta-item .dashicons {
    color: #2271b1;
    font-size: 20px;
    width: 20px;
    height: 20px;
}

/* Contact Grid */
.pcd-contact-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.pcd-contact-card {
    background: #f9f9f9;
    padding: 20px;
    border-radius: 8px;
}

.pcd-contact-card h3 {
    font-size: 14px;
    text-transform: uppercase;
    color: #2271b1;
    margin: 0 0 12px 0;
    font-weight: 600;
}

.pcd-contact-name {
    font-size: 16px;
    font-weight: 600;
    margin: 0 0 8px 0;
}

.pcd-contact-position {
    font-size: 14px;
    color: #666;
    margin: 0;
}

.pcd-contact-phones {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.pcd-phone-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #2271b1;
    text-decoration: none;
    font-size: 14px;
    transition: color 0.3s;
}

.pcd-phone-link:hover {
    color: #135e96;
}

.pcd-phone-link .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
}

.pcd-social-links {
    display: flex;
    gap: 10px;
}

.pcd-social-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: #fff;
    border-radius: 50%;
    color: #333;
    transition: all 0.3s;
}

.pcd-social-link:hover {
    background: #2271b1;
    color: #fff;
}

/* About Section */
.pcd-company-about {
    background: #fff;
    border-radius: 12px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.pcd-company-content {
    line-height: 1.8;
    color: #333;
}

/* Tabs Section */
.pcd-tabs-section {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    overflow: hidden;
}

.pcd-tabs-header {
    display: flex;
    border-bottom: 2px solid #f0f0f1;
    background: #f8f9fa;
}

.pcd-tab-button {
    flex: 1;
    padding: 18px 30px;
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    color: #666;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.3s;
    position: relative;
}

.pcd-tab-button .dashicons {
    font-size: 22px;
    width: 22px;
    height: 22px;
}

.pcd-tab-button:hover {
    background: #fff;
    color: #2271b1;
}

.pcd-tab-button.active {
    background: #fff;
    color: #2271b1;
}

.pcd-tab-button.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 3px;
    background: #2271b1;
}

.pcd-tab-count {
    background: #2271b1;
    color: #fff;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 600;
}

.pcd-tab-button.active .pcd-tab-count {
    background: #135e96;
}

.pcd-tab-content {
    display: none;
    padding: 30px;
}

.pcd-tab-content.active {
    display: block;
}

/* Section Title */
.pcd-section-title {
    font-size: 28px;
    font-weight: 700;
    margin: 0 0 20px 0;
    color: #1a1a1a;
    display: flex;
    align-items: center;
    gap: 10px;
}

.pcd-section-title .dashicons {
    color: #2271b1;
    font-size: 32px;
    width: 32px;
    height: 32px;
}

/* Pricing Section */
.pcd-pricing-section {
    background: #fff;
    border-radius: 12px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.pcd-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
}

.pcd-product-count {
    background: #2271b1;
    color: #fff;
    padding: 8px 20px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
}

/* Search Box */
.pcd-search-wrapper {
    margin-bottom: 25px;
}

.pcd-search-box {
    display: flex;
    gap: 10px;
    max-width: 600px;
}

#pcd-product-search {
    flex: 1;
    padding: 12px 18px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 15px;
    transition: border-color 0.3s;
}

#pcd-product-search:focus {
    outline: none;
    border-color: #2271b1;
}

.pcd-search-button,
.pcd-clear-button {
    background: #2271b1;
    color: #fff;
    border: none;
    padding: 0 25px;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s;
    display: flex;
    align-items: center;
    gap: 6px;
}

.pcd-search-button:hover {
    background: #135e96;
}

.pcd-clear-button {
    background: #dc3232;
}

.pcd-clear-button:hover {
    background: #a00;
}

/* Table Wrapper */
.pcd-table-wrapper {
    overflow-x: auto;
    margin-bottom: 25px;
}

/* Products Table */
.pcd-products-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
}

.pcd-products-table thead {
    background: #f8f9fa;
}

.pcd-products-table th {
    padding: 15px;
    text-align: right;
    font-weight: 600;
    color: #1a1a1a;
    border-bottom: 2px solid #2271b1;
    white-space: nowrap;
}

.pcd-products-table td {
    padding: 14px 15px;
    text-align: right;
    border-bottom: 1px solid #f0f0f1;
    color: #333;
}

.pcd-products-table tbody tr:hover {
    background: #f8f9fa;
}

.pcd-products-table td:last-child {
    font-weight: 700;
    color: #2271b1;
    font-size: 16px;
}

.pcd-loading-cell {
    text-align: center !important;
    padding: 50px !important;
    color: #666;
}

/* Spinner */
.pcd-spinner {
    display: inline-block;
    width: 24px;
    height: 24px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #2271b1;
    border-radius: 50%;
    animation: pcd-spin 1s linear infinite;
    margin-left: 10px;
}

@keyframes pcd-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Pagination */
.pcd-pagination-wrapper {
    text-align: center;
    padding-top: 20px;
}

.pcd-pagination-info {
    font-size: 14px;
    color: #666;
    margin-bottom: 15px;
}

.pcd-load-more-btn {
    background: #2271b1;
    color: #fff;
    border: none;
    padding: 14px 40px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.pcd-load-more-btn:hover {
    background: #135e96;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(34,113,177,0.4);
}

.pcd-load-more-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
}

/* Distributors Section */
.pcd-distributors-section {
    background: #fff;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.pcd-distributors-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
}

.pcd-distributors-table thead {
    background: #f8f9fa;
}

.pcd-distributors-table th {
    padding: 15px;
    text-align: right;
    font-weight: 600;
    color: #1a1a1a;
    border-bottom: 2px solid #2271b1;
}

.pcd-distributors-table td {
    padding: 14px 15px;
    text-align: right;
    border-bottom: 1px solid #f0f0f1;
    color: #333;
}

.pcd-distributors-table tbody tr:hover {
    background: #f8f9fa;
}

/* Responsive */
@media (max-width: 1024px) {
    .pcd-company-main-info {
        flex-direction: column;
        text-align: center;
    }
    
    .pcd-company-logo {
        margin: 0 auto;
    }
    
    .pcd-company-meta {
        justify-content: center;
    }
}

@media (max-width: 768px) {
    .pcd-company-container {
        padding: 20px 15px;
    }
    
    .pcd-company-header,
    .pcd-company-about,
    .pcd-pricing-section,
    .pcd-distributors-section {
        padding: 20px;
    }
    
    .pcd-company-name {
        font-size: 24px;
    }
    
    .pcd-section-title {
        font-size: 22px;
    }
    
    .pcd-section-header {
        flex-direction: column;
        gap: 15px;
        align-items: flex-start;
    }
    
    .pcd-search-box {
        max-width: 100%;
        flex-wrap: wrap;
    }
    
    .pcd-products-table th,
    .pcd-products-table td,
    .pcd-distributors-table th,
    .pcd-distributors-table td {
        padding: 10px;
        font-size: 14px;
    }
    
    .pcd-contact-grid {
        grid-template-columns: 1fr;
    }
}

/* RTL Support */
[dir="rtl"] .pcd-products-table th,
[dir="rtl"] .pcd-products-table td,
[dir="rtl"] .pcd-distributors-table th,
[dir="rtl"] .pcd-distributors-table td {
    text-align: right;
}

[dir="rtl"] .dashicons {
    margin-right: 0;
    margin-left: 8px;
}

/* No Data State */
.pcd-no-data {
    text-align: center;
    padding: 60px 20px;
    color: #999;
    font-size: 16px;
}

/* ========================================
   Search Forms & Results Pages Styles
   ======================================== */

/* Product Search Form */
.pcd-search-form-wrapper,
.pcd-distributor-search-wrapper {
    max-width: 800px;
    margin: 40px auto;
    padding: 30px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.pcd-product-search-form .pcd-search-input-group,
.pcd-search-box-section .pcd-search-input-group {
    display: flex;
    gap: 10px;
}

.pcd-search-input {
    flex: 1;
    padding: 14px 20px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s;
}

.pcd-search-input:focus {
    outline: none;
    border-color: #2271b1;
}

.pcd-search-submit {
    background: #2271b1;
    color: #fff;
    border: none;
    padding: 14px 30px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.pcd-search-submit:hover {
    background: #135e96;
}

/* Distributor Search Form */
.pcd-search-fields {
    display: grid;
    grid-template-columns: 1fr 1fr auto;
    gap: 15px;
    align-items: end;
}

.pcd-search-field label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
}

.pcd-company-select,
.pcd-city-select {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 15px;
    transition: border-color 0.3s;
}

.pcd-company-select:focus,
.pcd-city-select:focus {
    outline: none;
    border-color: #2271b1;
}

/* Multi-Select Dropdown */
.pcd-multiselect-wrapper {
    position: relative;
    width: 100%;
}

.pcd-multiselect-display {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    border: 2px solid #ddd;
    border-radius: 8px;
    background: #fff;
    cursor: pointer;
    transition: border-color 0.3s;
}

.pcd-multiselect-display:hover {
    border-color: #2271b1;
}

.pcd-multiselect-placeholder {
    color: #666;
    flex: 1;
}

.pcd-multiselect-arrow {
    color: #999;
    margin-left: 10px;
}

.pcd-multiselect-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    margin-top: 5px;
    background: #fff;
    border: 2px solid #2271b1;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    z-index: 1000;
    max-height: 350px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.pcd-multiselect-search {
    padding: 10px;
    border-bottom: 1px solid #e5e5e5;
}

.pcd-multiselect-search input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
}

.pcd-multiselect-search input:focus {
    outline: none;
    border-color: #2271b1;
}

.pcd-multiselect-options {
    overflow-y: auto;
    max-height: 280px;
}

.pcd-multiselect-option {
    display: flex;
    align-items: center;
    padding: 10px 15px;
    cursor: pointer;
    transition: background 0.2s;
    margin: 0;
}

.pcd-multiselect-option:hover {
    background: #f0f8ff;
}

.pcd-multiselect-option input[type="checkbox"] {
    margin: 0 10px 0 0;
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.pcd-multiselect-option span {
    flex: 1;
    font-size: 15px;
    color: #333;
}

/* Search Results Pages */
.pcd-search-results-wrapper {
    background: #f5f5f5;
    padding: 40px 0;
    min-height: 60vh;
}

.pcd-search-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

.pcd-search-header {
    background: #fff;
    padding: 30px;
    border-radius: 12px;
    margin-bottom: 30px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.pcd-search-title {
    font-size: 32px;
    font-weight: 700;
    margin: 0 0 15px 0;
    color: #1a1a1a;
}

.pcd-search-query {
    font-size: 16px;
    color: #666;
    margin: 0;
}

.pcd-search-filters-display p {
    font-size: 16px;
    color: #666;
    margin: 5px 0;
}

.pcd-search-box-section {
    background: #fff;
    padding: 25px;
    border-radius: 12px;
    margin-bottom: 30px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.pcd-results-section {
    background: #fff;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.pcd-results-info {
    margin-bottom: 20px;
    font-size: 15px;
    color: #666;
}

.pcd-results-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
}

.pcd-results-table thead {
    background: #f8f9fa;
}

.pcd-results-table th {
    padding: 15px;
    text-align: right;
    font-weight: 600;
    color: #1a1a1a;
    border-bottom: 2px solid #2271b1;
    white-space: nowrap;
}

.pcd-results-table td {
    padding: 14px 15px;
    text-align: right;
    border-bottom: 1px solid #f0f0f1;
    color: #333;
}

.pcd-results-table tbody tr:hover {
    background: #f8f9fa;
}

.pcd-results-table td:nth-last-child(1) {
    font-weight: 700;
    color: #2271b1;
    font-size: 16px;
}

/* Responsive for Search Forms */
@media (max-width: 768px) {
    .pcd-search-fields {
        grid-template-columns: 1fr;
    }
    
    .pcd-search-form-wrapper,
    .pcd-distributor-search-wrapper {
        padding: 20px;
    }
    
    .pcd-product-search-form .pcd-search-input-group {
        flex-direction: column;
    }
    
    .pcd-results-table th,
    .pcd-results-table td {
        padding: 10px;
        font-size: 14px;
    }
    
    .pcd-multiselect-dropdown {
        max-height: 300px;
    }
    
    .pcd-multiselect-options {
        max-height: 230px;
    }
}
