/* =========================================
   SINGLE COMPANY PROFILE - ASTRA FULL WIDTH
   ========================================= */

/* --- 1. GLOBAL LAYOUT --- */

/* Wrapper: Stretches full width of the screen */
.pharma-pro-wrapper {
    background-color: #f3f4f6; /* Slate-100 */
    min-height: 100vh;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    color: #1f2937;
    line-height: 1.6;
    padding-bottom: 80px;
    width: 100%;
    margin: 0;
    position: relative;
    z-index: 1;
}

/* Container: Centers content and sets max-width for readability */
.pharma-container {
    width: 100%;
    max-width: 1440px; /* Wide screen support */
    margin: 0 auto;
    padding: 30px 20px;
    box-sizing: border-box;
}

/* --- 2. HEADER CARD --- */
.header-card {
    background: #fff;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    margin-bottom: 30px;
    overflow: hidden; /* Ensures corners clip content */
}

.header-inner {
    padding: 30px;
    display: flex;
    align-items: flex-start;
    gap: 30px;
}

/* Logo Box */
.company-logo-box {
    width: 140px;
    height: 140px;
    border: 1px solid #f3f4f6;
    border-radius: 12px;
    padding: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    flex-shrink: 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.02);
}
.company-logo-box img { 
    max-width: 100%; 
    max-height: 100%; 
    object-fit: contain; 
}

/* Info Area */
.company-info-box { 
    flex-grow: 1; 
    min-width: 0; 
}

.company-title { 
    font-size: 2.2rem; 
    font-weight: 800; 
    color: #111827; 
    margin: 0 0 8px 0; 
    line-height: 1.2; 
}

.badge-exclusive { 
    background: #2563eb; 
    color: #fff; 
    font-size: 0.75rem; 
    padding: 4px 12px; 
    border-radius: 99px; 
    font-weight: 700; 
    margin-left: 10px; 
    vertical-align: middle; 
    display: inline-block;
    transform: translateY(-4px); 
}

.company-tagline { 
    font-size: 1.1rem; 
    color: #6b7280; 
    margin: 0 0 16px 0; 
}

.meta-row {
    display: flex; 
    gap: 10px; 
    flex-wrap: wrap; 
}

.meta-pill-wrap {
    display: flex;
    align-items: flex-start;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 8px;
    border: 1px solid #cbd5e1;
    background: #f8fafc;
}
.meta-pill-tags {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}
.type-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 4px 10px;
    border-radius: 999px;
    border: 1px solid rgba(59,130,246,0.3);
    background: rgba(59,130,246,0.1);
    color: #1d4ed8;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: capitalize;
}
.type-badge a { color: inherit; text-decoration: none; }
.type-badge a:hover { text-decoration: underline; }

.meta-pill {
    background: #f9fafb; 
    border: 1px solid #e5e7eb; 
    padding: 6px 12px; 
    border-radius: 6px; 
    font-size: 0.85rem; 
    font-weight: 600; 
    color: #4b5563; 
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

/* Header Actions */
.header-actions {
    flex-shrink: 0;
    width: 240px;
    text-align: right;
}

.btn-action-primary {
    background: #2563eb;
    color: #fff;
    border: none;
    width: 100%;
    padding: 16px 24px;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 6px -1px rgba(37, 99, 235, 0.3);
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}
.btn-action-primary:hover { 
    background: #1d4ed8; 
    transform: translateY(-2px); 
    box-shadow: 0 6px 10px -1px rgba(37, 99, 235, 0.4); 
}

.response-badge { 
    margin-top: 12px; 
    font-size: 0.8rem; 
    color: #059669; 
    font-weight: 600; 
    text-align: center; 
}

/* --- 3. NAVIGATION TABS --- */
.header-tabs {
    background: #f9fafb;
    border-top: 1px solid #e5e7eb;
    padding: 0 30px;
}

.tab-nav {
    display: flex;
    gap: 35px;
    align-items: center;
    flex-wrap: nowrap;
    overflow-x: auto; /* Allow scroll on small screens */
    scrollbar-width: none; /* Hide scrollbar Firefox */
}
.tab-nav::-webkit-scrollbar { display: none; /* Hide scrollbar Chrome/Safari */ }

.tab-link {
    display: block;
    padding: 18px 0;
    color: #6b7280;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
    white-space: nowrap;
    cursor: pointer;
}
.tab-link:hover { color: #111827; }
.tab-link.active { color: #2563eb; border-bottom-color: #2563eb; }

.download-link { 
    margin-left: auto; 
    color: #dc2626; 
    display: flex; 
    align-items: center; 
    gap: 6px; 
}

/* --- 4. FLUID GRID LAYOUT --- */
.pro-grid {
    display: grid;
    /* Main Content (Flexible) | Sidebar (Fixed 360px) */
    grid-template-columns: 1fr 360px;
    gap: 30px;
    align-items: start;
}

/* Content Cards */
.content-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    margin-bottom: 30px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.02);
    overflow: hidden;
}
.card-header { 
    padding: 20px 30px; 
    border-bottom: 1px solid #f3f4f6; 
    background: #fff; 
}
.card-header h2 { 
    margin: 0; 
    font-size: 1.25rem; 
    font-weight: 700; 
    color: #111827; 
}
.card-body { padding: 30px; }
.card-body.no-padding { padding: 0; }

.description-text p { margin-bottom: 1rem; color: #374151; }
.description-text h3 { margin-top: 1.5rem; margin-bottom: 0.5rem; font-size: 1.2rem; }

/* Sidebar */
.sidebar-column { height: 100%; }
.sticky-wrapper { 
    position: -webkit-sticky; /* Safari */
    position: sticky; 
    top: 100px; /* Adjust if you have a sticky header */
}

.sidebar-card { 
    background: #fff; 
    border: 1px solid #e5e7eb; 
    border-radius: 12px; 
    margin-bottom: 20px; 
    overflow: hidden;
    box-shadow: 0 1px 2px rgba(0,0,0,0.03); 
}
.highlight-card { 
    border: 2px solid #2563eb; 
    background: #eff6ff; 
}

.overview-list { list-style: none; padding: 0; margin: 0; }
.overview-list li { 
    display: flex; 
    justify-content: space-between; 
    padding: 14px 20px; 
    border-bottom: 1px solid #f3f4f6; 
}
.overview-list li:last-child { border-bottom: none; }
.label { color: #6b7280; font-size: 0.9rem; font-weight: 500; }
.value { font-weight: 600; color: #111827; text-align: right; font-size: 0.95rem; }

/* --- 5. CONTACT FORM --- */
.contact-section-card { border-top: 4px solid #2563eb; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.form-group { margin-bottom: 15px; }
.form-group label { display: block; margin-bottom: 6px; font-weight: 600; color: #374151; font-size: 0.9rem; }
.form-group input, .form-group textarea {
    width: 100%; 
    padding: 12px; 
    border: 1px solid #d1d5db; 
    border-radius: 6px; 
    font-size: 1rem; 
    box-sizing: border-box;
    transition: border 0.2s;
}
.form-group input:focus, .form-group textarea:focus { border-color: #2563eb; outline: none; box-shadow: 0 0 0 3px rgba(37,99,235,0.1); }

.btn-submit-form {
    background: #2563eb; 
    color: #fff; 
    width: 100%; 
    padding: 14px; 
    border: none; 
    border-radius: 6px; 
    font-weight: 600; 
    font-size: 1rem; 
    cursor: pointer; 
    transition: background 0.2s;
}
.btn-submit-form:hover { background: #1d4ed8; }

/* --- 6. PRODUCTS TABLE (COMPACT & CLEAN UI) --- */
.table-responsive { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.pharma-table { width: 100%; min-width: 800px; border-collapse: collapse; text-align: left; }

/* Compact, clean headers */
.thead-titles th { 
    background: #f8fafc; 
    padding: 14px 15px 8px 15px; /* Tighter padding */
    font-size: 0.8rem; /* Smaller font */
    font-weight: 700; 
    color: #64748b; 
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: none; 
}

/* Seamless filter row */
.thead-filters th { 
    background: #f8fafc; 
    padding: 0 15px 12px 15px; /* Tighter padding */
    border-bottom: 1px solid #e2e8f0; 
}
.filter-input { 
    width: 100%; 
    padding: 8px 10px; /* Slimmer inputs */
    border: 1px solid #cbd5e1; 
    border-radius: 4px; 
    font-size: 0.85rem; 
    box-sizing: border-box; 
    background: #fff;
    transition: all 0.2s;
}
.filter-input:focus {
    border-color: #3b82f6; 
    outline: none; 
}

/* Compact Table Cells */
.pharma-table td { 
    padding: 12px 15px; /* Significantly reduced padding for a tighter look */
    border-bottom: 1px solid #f1f5f9; 
    vertical-align: middle; 
    font-size: 0.9rem; /* Smaller, standard text size */
    color: #334155;
}
.pharma-table tbody tr { transition: background 0.2s; }
.pharma-table tbody tr:hover { background: #f8fafc; }

/* Simple Text Typography */
.cell-name { font-weight: 600; color: #0f172a; }
.cell-comp { color: #475569; }
.cell-form { color: #475569; text-transform: capitalize; } /* Simple text styling, no badge */
.cell-pack { font-weight: 500; color: #475569; white-space: nowrap; }

/* Footer & Load More */
.table-footer { padding: 15px; text-align: center; border-top: 1px solid #e2e8f0; background: #fff; }
.btn-load-more { 
    background: #fff; 
    border: 1px solid #cbd5e1; 
    color: #334155; 
    padding: 10px 24px; 
    border-radius: 6px; 
    cursor: pointer; 
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.2s;
}
.btn-load-more:hover { border-color: #94a3b8; background: #f8fafc; }

/* =========================================
   RESPONSIVE QUERIES
   ========================================= */

/* Tablet & Small Desktop (Max 1024px) */
@media (max-width: 1024px) {
    .pro-grid {
        grid-template-columns: 1fr; /* Stack Sidebar below content */
    }
    
    .sidebar-column {
        /* Optional: Change order to -1 if you want sidebar ON TOP on mobile */
        /* order: -1; */ 
    }
    
    .sticky-wrapper { position: static; }

    .header-inner {
        flex-direction: column;
        text-align: center;
        align-items: center;
        padding: 40px 20px;
    }
    
    .header-actions {
        width: 100%;
        text-align: center;
        margin-top: 25px;
    }
    
    .meta-row { justify-content: center; }
    
    .badge-exclusive { position: relative; top: -3px; }
}

/* Mobile Devices (Max 768px) */
@media (max-width: 768px) {
    .pharma-container { padding: 15px 10px; }
    
    .header-card { border-radius: 0; border-left: 0; border-right: 0; margin-bottom: 20px; }
    .header-inner { padding: 30px 15px; }

    .company-logo-box { width: 100px; height: 100px; padding: 10px; }
    .company-title { font-size: 1.6rem; }
    
    .tab-nav { 
        padding-bottom: 5px; 
        gap: 20px;
    }
    .header-tabs { padding: 0 15px; }

    /* Move Download Link to new line on mobile */
    .download-link { 
        margin-left: 0; 
        border-top: 1px solid #eee; 
        width: 100%; 
        margin-top: 5px; 
        padding-top: 15px;
        justify-content: center;
    }
    
    .form-grid { grid-template-columns: 1fr; }
    
    .card-body { padding: 20px; }
    .card-header { padding: 15px 20px; }
    .card-header h2 { font-size: 1.1rem; }
    
    /* Table specific mobile fixes */
    .pharma-table { min-width: 600px; font-size: 0.85rem; }
    .thead-filters th { padding: 8px 10px; }
    .filter-input { font-size: 0.8rem; padding: 6px; }
}

/* =========================================
   MOBILE OPTIMIZATIONS (Replaces previous mobile CSS)
   ========================================= */

@media (max-width: 768px) {
    /* 1. CONTAINER & PADDING FIXES */
    .pharma-container { padding: 15px; }
    .header-inner { padding: 25px 15px; }
    
    /* 2. TRANSFORM TABLE INTO CARDS (The Magic Fix) */
    .table-responsive { 
        overflow: visible; /* Disable scroll, we want stacking */
    }
    
    .pharma-table { 
        display: block; 
        min-width: 100%; 
        border: none;
    }
    
    /* Hide the desktop header row */
    .pharma-table thead { display: none; }
    
    .pharma-table tbody { display: block; }
    
    /* Turn each Row into a Card */
    .pharma-table tr {
        display: block;
        background: #fff;
        border: 1px solid #e5e7eb;
        border-radius: 12px;
        padding: 15px;
        margin-bottom: 15px; /* Space between cards */
        box-shadow: 0 2px 5px rgba(0,0,0,0.03);
    }
    
    /* Make Cells Full Width & Remove Borders */
    .pharma-table td {
        display: block;
        padding: 5px 0;
        border: none;
        text-align: left;
        width: 100%;
    }
    
    /* Style the Product Name (Top of Card) */
    .cell-name {
        font-size: 1.15rem;
        font-weight: 700;
        color: #2563eb; /* Blue Title */
        margin-bottom: 8px;
        padding-bottom: 10px !important;
        border-bottom: 1px solid #f3f4f6 !important;
    }
    
    /* Style Composition with a Label */
    .cell-comp {
        font-size: 0.95rem;
        color: #374151;
        margin-bottom: 8px;
        line-height: 1.5;
    }
    /* Add "Composition:" label dynamically via CSS */
    .cell-comp::before {
        content: "Composition";
        display: block;
        font-size: 0.75rem;
        color: #9ca3af;
        text-transform: uppercase;
        font-weight: 700;
        margin-bottom: 2px;
    }

    /* Style Form & Pack (Side by Side) */
    .cell-form, .cell-pack {
        display: inline-block !important;
        width: auto !important;
        vertical-align: middle;
    }
    
    .cell-form { margin-right: 15px; }
    
    /* Add "Pack:" label */
    .cell-pack::before {
        content: "Pack: ";
        font-size: 0.85rem;
        color: #6b7280;
        font-weight: 600;
    }
    .cell-pack { font-weight: 700; color: #1f2937; }

    /* 3. INQUIRY FORM IMPROVEMENTS */
    .form-grid { grid-template-columns: 1fr; gap: 15px; }
    
    .form-group input, .form-group textarea {
        font-size: 16px; /* Prevents iOS zoom on focus */
        padding: 14px; /* Larger touch target */
    }
    
    /* 4. HEADER ADJUSTMENTS */
    .company-logo-box { width: 80px; height: 80px; padding: 5px; margin-bottom: 15px; }
    .company-title { font-size: 1.5rem; text-align: center; }
    .badge-exclusive { display: inline-block; top: -2px; }
    
    .tab-nav { gap: 15px; justify-content: center; }
    .tab-link { font-size: 0.9rem; padding: 12px 0; }
    
    /* Move Download Link */
    .download-link { 
        margin-top: 10px; 
        border-top: 1px dashed #e5e7eb; 
        padding-top: 15px; 
        justify-content: center; 
        width: 100%;
    }
}
