/* ============================================
   Construction Materials - Main Stylesheet
   ============================================ */

/* Root Variables */
:root {
    --primary: #1a3a6e;
    --primary-dark: #0f2444;
    --secondary: #d4a017;
    --accent: #e63946;
    --light: #f8f9fa;
    --dark: #1a1a2e;
    --success: #28a745;
    --info: #17a2b8;
    --warning: #ffc107;
    --danger: #dc3545;
}

/* Base Styles */
body {
    font-family: 'Poppins', sans-serif;
    background-color: #f4f6f9;
    overflow-x: hidden;
    overflow-y: auto;;
}

/* Image Handling - Fix Blinking */
img {
    max-width: 100%;
    height: auto;
    transition: opacity 0.3s ease;
}

img[src=""], img:not([src]) {
    opacity: 0;
    min-height: 200px;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.object-fit-cover {
    object-fit: cover;
    width: 100%;
}

/* Product Cards */
.product-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: none;
    background: white;
    border-radius: 12px;
    overflow: hidden;
}

.product-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(0,0,0,0.12) !important;
}

.product-card img {
    width: 100%;
    height: 220px;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.product-card:hover img {
    transform: scale(1.05);
}

/* Category Cards */
.category-card {
    transition: all 0.3s ease;
    border: none;
    border-radius: 16px;
    overflow: hidden;
    background: white;
    text-decoration: none !important;
    display: block;
}

.category-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(26, 58, 110, 0.15) !important;
}

.category-card .icon-box {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    background: rgba(26, 58, 110, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 15px;
    transition: all 0.3s ease;
}

.category-card:hover .icon-box {
    background: var(--primary);
}

.category-card:hover .icon-box i {
    color: white !important;
}

/* Hero Section */
.hero-section {
    position: relative;
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('../images/hero-pattern.png');
    opacity: 0.05;
    pointer-events: none;
}

/* Section Titles */
.section-title {
    position: relative;
    padding-bottom: 20px;
    margin-bottom: 40px;
    text-align: center;
    font-weight: 700;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 4px;
    background: var(--secondary);
    border-radius: 2px;
}

.section-title.text-start::after {
    left: 0;
    transform: none;
}

/* Blog Cards */
.blog-card {
    border: none;
    border-radius: 16px;
    overflow: hidden;
    background: white;
    transition: all 0.3s ease;
    height: 100%;
}

.blog-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(0,0,0,0.1) !important;
}

.blog-card img {
    width: 100%;
    height: 240px;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.blog-card:hover img {
    transform: scale(1.08);
}

.blog-card .card-img-wrapper {
    overflow: hidden;
}

/* Gallery Items */
.gallery-item {
    border-radius: 12px;
    overflow: hidden;
    position: relative;
}

.gallery-item img {
    width: 100%;
    height: 250px;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.gallery-item:hover img {
    transform: scale(1.1);
}

/* Project Cards */
.project-card {
    border: none;
    border-radius: 16px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.project-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgba(0,0,0,0.12) !important;
}

.project-card .img-wrapper {
    overflow: hidden;
    height: 260px;
}

.project-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s ease;
}

.project-card:hover img {
    transform: scale(1.1);
}

/* Testimonial Cards */
.testimonial-card {
    border: none;
    border-radius: 16px;
    padding: 30px;
    background: white;
    height: 100%;
    transition: all 0.3s ease;
}

.testimonial-card:hover {
    box-shadow: 0 15px 35px rgba(0,0,0,0.08) !important;
}

/* Navbar */
.navbar {
    transition: all 0.3s ease;
}

.navbar.scrolled {
    box-shadow: 0 2px 20px rgba(0,0,0,0.1) !important;
}

/* Buttons */
.btn {
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn-primary {
    background: var(--primary);
    border-color: var(--primary);
}

.btn-primary:hover {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(26, 58, 110, 0.3);
}

.btn-secondary {
    background: var(--secondary);
    border-color: var(--secondary);
    color: white;
}

.btn-secondary:hover {
    background: #b88a14;
    border-color: #b88a14;
    color: white;
    transform: translateY(-2px);
}

/* Cart Badge */
.cart-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    font-size: 0.65rem;
    padding: 0.25em 0.5em;
}

/* Breadcrumb */
.breadcrumb {
    background: transparent;
    padding: 0;
}

.breadcrumb-item a {
    color: var(--primary);
    text-decoration: none;
}

/* Footer */
.footer {
    background: var(--dark);
}

.footer a:hover {
    color: var(--secondary) !important;
}

/* Forms */
.form-control, .form-select {
    border-radius: 8px;
    border: 1px solid #dee2e6;
    transition: all 0.3s ease;
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 0.2rem rgba(26, 58, 110, 0.15);
}

/* Pagination */
.pagination .page-link {
    border-radius: 8px;
    margin: 0 3px;
    color: var(--primary);
    border: none;
    transition: all 0.3s ease;
}

.pagination .page-item.active .page-link {
    background: var(--primary);
    color: white;
}

.pagination .page-link:hover {
    background: rgba(26, 58, 110, 0.1);
}

/* Alerts */
.alert {
    border-radius: 12px;
    border: none;
}

/* Tables */
.table {
    border-radius: 12px;
    overflow: hidden;
}

/* Modal */
.modal-content {
    border-radius: 16px;
    border: none;
}

/* Print Styles */
@media print {
    .sidebar, .navbar, .btn, .top-bar {
        display: none !important;
    }
    .main-content {
        margin-left: 0 !important;
    }
}

/* Responsive */
@media (max-width: 768px) {
    .hero-section h1 {
        font-size: 2rem !important;
    }
    .section-title {
        font-size: 1.5rem;
    }
}

/* Loading Animation for Images */
.img-loading {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

/* Smooth Scroll */
html {
    scroll-behavior: smooth;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-dark);
}
