:root {
    --primary: #427588;       
    --primary-dark: #0f3260;  
    --text-dark: #2d3748;      
    --text-light: #6c757d;    
    --background: whitesmoke;     
    --card-bg: #ffffff;        
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.12),
                 0 1px 2px rgba(0, 0, 0, 0.24);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1),
                 0 1px 3px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.1),
                 0 5px 10px rgba(0, 0, 0, 0.05);
    --radius: 12px;
    --transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}


* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

.products-header {
    text-align: center;
    padding: 2rem 1rem;
    margin: 0 auto 2.5rem; 
    max-width: 1200px;
}

.products-header h1 {
    margin: 0 0 0.75rem;
    font-size: 2.2rem;
    font-weight: 700;
    color: var(--primary-dark);
}

.products-header a {
    font-size: 1.1rem;
    color: #64748b;
    max-width: 600px;
    margin: 0 auto;
    display: inline-block; 
    transition: all 0.3s ease; 
}

.products-header a:hover {
    color: #1e40af; 
    transform: scale(1.05); 
    text-decoration: underline; 
}

.products-header p {
    font-size: 1.1rem;
    color: #de1212;
    max-width: 700px;
    margin: 0 auto;
    display: inline-block; 
}

.products-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
}

.product-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    transition: var(--transition);
    position: relative;
    height: 100%;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.product-image-container {
    position: relative;
    overflow: hidden;
    height: 220px;
}

.product-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
}

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

.product-overlay {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.4) 0%, transparent 70%);
    opacity: 0;
    transition: var(--transition);
}

.product-card:hover .product-overlay {
    opacity: 1;
}

.product-content {
    padding: 1.5rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.product-name {
    font-size: 1.25rem;
    font-weight: 700;
    margin: 0 0 0.75rem;
    color: #2c3e50;
}

.product-footer {
    margin-top: auto;
    padding-top: 1rem;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
}

.btn-details {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    background: var(--primary);
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 500;
    transition: var(--transition);
    width: 100%;
    text-align: center;
}

.btn-details:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* Default state (desktop + mobile) */
.buy-btn {
    position: relative;
    transition: var(--transition);
}

/* Desktop hover → show phone number instead of text */
@media (hover:hover) and (pointer:fine) {
    .buy-btn::after {
        content: "تماس: 09122017439";
        position: absolute;
        inset: 0;
        display: flex;
        align-items: center;
        justify-content: center;
        opacity: 0;
        transition: var(--transition);
    }

    .buy-btn:hover {
        color: transparent; /* hide original text */
    }

    .buy-btn:hover::after {
        opacity: 1;
        color: #fff; /* white text */
    }
}

@media (max-width: 768px) {

    .products-header h1 { font-size: 1.8rem; }
    .products-header a, .products-header p { font-size: 1rem; }

    header {
    padding: 2rem 1rem;
    }
    
    header h1 {
    font-size: 1rem;
    }
    
    .products-grid {
        display: grid;
        grid-template-columns: repeat(3, 1fr); /* 3 cards in a row */
        gap: 1rem; /* space between cards */
    }

    .product-image-container {
        height: 160px; /* slightly smaller images */
    }

    .product-content {
        padding: 1rem;
    }

    .product-name {
        font-size: 1.1rem;
    }

    .btn-details {
        padding: 0.6rem 1rem;
        font-size: 0.9rem;
    }
}

@media (max-width: 576px) {

    .products-header h1 { font-size: 1.5rem; }
    .products-header a, .products-header p { font-size: 0.95rem; }
    
    .products-grid {
        grid-template-columns: repeat(2, 1fr); /* 2 cards in a row */
        gap: 0.8rem; /* smaller gap for tiny screens */
    }

    .product-image-container {
        height: 140px; /* smaller images */
    }

    .product-content {
        padding: 0.8rem;
    }

    .product-name {
        font-size: 1rem;
    }

    .btn-details {
        padding: 0.5rem 0.8rem;
        font-size: 0.85rem;
    }
}

.hero-section.products {
    background-image: linear-gradient(rgba(0,0,0,0.6), rgba(0,0,0,0.6)), url('../img/hero-product-bg.jpg');
}