/**
 * Structure Fixes for Naima Mining Supplies
 * This file fixes overlapping and text visibility issues
 */

/* ============================================
   GLOBAL FIXES
   ============================================ */

/* Ensure body has no margin/padding issues */
body {
    margin: 0;
    padding: 0;
    overflow-x: hidden;
}

/* Main wrapper */
#site-wrapper {
    position: relative;
    width: 100%;
    overflow: hidden;
}

/* Content wrapper */
#site-content {
    position: relative;
    width: 100%;
}

#page-body {
    position: relative;
    width: 100%;
}

/* Clear floats properly */
.clearfix::after,
.row::after {
    content: "";
    display: table;
    clear: both;
}

/* ============================================
   SECTION SPACING FIXES
   ============================================ */

/* Ensure sections don't overlap */
section {
    position: relative;
    width: 100%;
    clear: both;
    float: none;
    display: block;
}

/* Feature Box Section */
.feature_box {
    background: #f0f0f0;
    padding: 40px 0;
    margin: 0;
    clear: both;
}

.feature_box h3 {
    color: #2c3e50;
    margin-bottom: 15px;
}

.feature_box .text {
    color: #666;
}

/* Services Section */
.services {
    background: #fff;
    padding: 80px 0;
    clear: both;
}

.services h4 {
    color: #2c3e50;
    margin: 20px 0 15px;
}

.services .content {
    color: #666;
    line-height: 1.6;
}

.services-list {
    margin: 0;
    padding: 0;
}

.services-list li {
    color: #666;
    margin-bottom: 12px;
    line-height: 1.6;
}

/* Portfolio Section */
.portfolio {
    background: #f8f9fa;
    padding: 80px 0 60px;
    clear: both;
}

.portfolio .flat_title {
    color: #2c3e50;
    text-align: center;
    margin-bottom: 40px;
    font-size: 28px;
}

.portfolio-filters {
    background: transparent;
    margin-bottom: 40px;
}

.portfolio .title h2 {
    color: #2c3e50;
    font-size: 20px;
}

.portfolio .entry-meta {
    color: #999;
}

/* Counter Section - Fix text visibility */
.count_to {
    background-attachment: fixed;
    background-size: cover;
    background-position: center;
    padding: 80px 0;
    position: relative;
    clear: both;
}

.count_to .overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.75);
    z-index: 1;
}

.count_to .container {
    position: relative;
    z-index: 2;
}

.count_to h2 {
    color: #fff !important;
    font-size: 26px;
    line-height: 1.5;
    margin-bottom: 20px;
}

.count_to .counter {
    text-align: center;
}

.count_to .count-number,
.count_to .count_value {
    color: #fff !important;
    font-size: 42px;
    font-weight: bold;
    display: block;
}

.count_to .count_title {
    color: #fff !important;
    font-size: 16px;
    display: block;
    margin-top: 10px;
    text-transform: uppercase;
}

/* Why Choose Us Section */
.why_us {
    background: #fff;
    padding: 80px 0;
    clear: both;
}

.why_us .flat_title {
    color: #2c3e50;
    margin-bottom: 40px;
}

.why_us_wrap {
    width: 100%;
    margin: 0;
    padding: 0;
}

.why_us_wrap .col-md-6,
.why_us_wrap .col-sm-6 {
    margin-bottom: 30px;
}

/* Fix iconbox structure */
.iconbox {
    display: block;
    width: 100%;
    margin-bottom: 20px;
}

.iconbox.inline-left .box-header {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
}

.iconbox .box-icon {
    background: #e67e22;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 20px;
    flex-shrink: 0;
}

.iconbox .box-icon i {
    color: #fff;
    font-size: 24px;
}

.iconbox .box-title {
    color: #2c3e50;
    font-size: 18px;
    margin: 0;
}

.iconbox .box-content {
    color: #666;
    line-height: 1.7;
    padding-left: 0;
}

/* Who We Are Box */
.who_we_are {
    background: #f8f9fa;
    padding: 30px;
    border-radius: 5px;
}

.who_we_are .flat_title {
    color: #2c3e50;
    margin-bottom: 20px;
}

.who_we_are p {
    color: #666;
    line-height: 1.6;
}

/* Clients Section */
.clients {
    background: #f8f9fa;
    padding: 80px 0;
    clear: both;
}

.clients .flat_title {
    color: #2c3e50;
    text-align: center;
    margin-bottom: 40px;
}

.clients_logo {
    margin-bottom: 50px;
}

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

.testimonial blockquote {
    color: #666;
    font-style: italic;
    line-height: 1.7;
    border: none;
    margin: 0 0 20px;
}

.testimonial .author-name {
    color: #2c3e50;
}

.testimonial .author-info {
    color: #999;
    font-size: 14px;
}

/* ============================================
   FOOTER FIXES
   ============================================ */

#page-footer {
    background: #2c3e50;
    padding: 60px 0 40px;
    clear: both;
    color: #fff;
}

#page-footer h3,
#page-footer .widget-title {
    color: #fff;
    margin-bottom: 20px;
}

#page-footer p,
#page-footer .textwidget {
    color: #ccc;
}

#page-footer a {
    color: #e67e22;
}

#page-footer a:hover {
    color: #fff;
}

#page-footer input,
#page-footer textarea {
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    color: #fff;
}

#page-footer input::placeholder,
#page-footer textarea::placeholder {
    color: rgba(255,255,255,0.5);
}

#page-footer .button {
    background: #e67e22;
    color: #fff;
    border: none;
}

#page-footer .button:hover {
    background: #d35400;
}

.footer-logo img {
    max-width: 150px;
    margin-bottom: 20px;
}

/* Site Footer */
#site-footer {
    background: #1a252f;
    padding: 25px 0;
    color: #fff;
    clear: both;
}

#site-footer .copyright-content {
    color: #ccc;
}

#site-footer a {
    color: #e67e22;
}

#site-footer .social-links a {
    color: #fff;
    background: rgba(255,255,255,0.1);
}

#site-footer .social-links a:hover {
    background: #e67e22;
}

/* ============================================
   GRID FIXES
   ============================================ */

.row {
    margin-left: -15px;
    margin-right: -15px;
}

.col-sm-1, .col-sm-2, .col-sm-3, .col-sm-4, .col-sm-5, .col-sm-6, 
.col-sm-7, .col-sm-8, .col-sm-9, .col-sm-10, .col-sm-11, .col-sm-12,
.col-md-1, .col-md-2, .col-md-3, .col-md-4, .col-md-5, .col-md-6,
.col-md-7, .col-md-8, .col-md-9, .col-md-10, .col-md-11, .col-md-12 {
    padding-left: 15px;
    padding-right: 15px;
}

/* ============================================
   RESPONSIVE FIXES
   ============================================ */

@media (max-width: 768px) {
    .count_to h2 {
        font-size: 20px;
        margin-bottom: 30px;
    }
    
    .count_to .counter {
        margin-bottom: 30px;
    }
    
    .iconbox .box-header {
        flex-direction: column;
        text-align: center;
    }
    
    .iconbox .box-icon {
        margin: 0 0 15px 0;
    }
    
    .iconbox .box-content {
        text-align: center;
    }
    
    .who_we_are {
        margin-top: 40px;
    }
}

/* ============================================
   COLOR CONTRAST IMPROVEMENTS
   ============================================ */

/* Ensure all text has good contrast */
h1, h2, h3, h4, h5, h6 {
    color: #2c3e50;
}

p, li, span {
    color: #666;
}

a {
    color: #e67e22;
    text-decoration: none;
}

a:hover {
    color: #d35400;
    text-decoration: none;
}

/* Button color consistency */
.flat_btn01,
.button,
button[type="submit"] {
    background: #e67e22;
    color: #fff;
    border: none;
    padding: 12px 30px;
    border-radius: 3px;
    cursor: pointer;
    transition: all 0.3s;
    display: inline-block;
    text-decoration: none;
}

.flat_btn01:hover,
.button:hover,
button[type="submit"]:hover {
    background: #d35400;
    color: #fff;
    text-decoration: none;
}

/* Pagination Styles */
.product-pagination .pagination {
    margin-top: 30px;
    margin-bottom: 30px;
}

.product-pagination .page-item .page-link {
    color: #333;
    border: 1px solid #ddd;
    margin: 0 3px;
    padding: 8px 15px;
    border-radius: 4px;
}

.product-pagination .page-item.active .page-link {
    background-color: #007bff;
    border-color: #007bff;
    color: white;
}

.product-pagination .page-item:hover .page-link {
    background-color: #f8f9fa;
    border-color: #ddd;
}

.product-pagination .page-item.active:hover .page-link {
    background-color: #007bff;
    border-color: #007bff;
    color: white;
}

.product-pagination .page-item.disabled .page-link {
    color: #6c757d;
    background-color: #fff;
    border-color: #ddd;
}

/* Search Form Styles */
.product-search-form {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 30px;
}

.product-search-form .input-group {
    max-width: 500px;
    margin: 0 auto;
}

.product-search-form .form-control {
    height: 45px;
    border-radius: 4px 0 0 4px;
}

.product-search-form .btn {
    height: 45px;
    border-radius: 0 4px 4px 0;
}

.product-search-form .btn-secondary {
    margin-left: 10px;
    border-radius: 4px;
}

/* Page Info */
.page-info {
    margin-top: 20px;
    color: #666;
    font-size: 14px;
}

/* Search Results Info */
.search-results-info {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.search-results-info p {
    margin-bottom: 5px;
}

/* Service placeholder images fix */
.service-placeholder {
    opacity: 0.8;
    filter: grayscale(30%);
}

/* Placeholder notification */
.services03 article .media:after {
    content: "Image coming soon";
    position: absolute;
    bottom: 10px;
    right: 10px;
    background: rgba(0,0,0,0.7);
    color: white;
    padding: 3px 8px;
    font-size: 11px;
    border-radius: 3px;
    display: none;
}

.services03 article .media:hover:after {
    display: block;
}