/*
Theme Name: Al-Bidaya Theme
Theme URI: http://example.com/albidaya-theme
Author: WP Developer
Description: Custom theme for Al-Bidaya Al-Libiya Plastics Company.
Version: 1.1
Text Domain: albidaya
*/

/* ------------------------- */
/* --- Variables and Colors --- */
/* ------------------------- */
:root {
    --primary-blue: #334664;
    --primary-orange: #f68631;
    --light-gray: #f8f8f8;
    --text-color: #333;
    --text-light: #555;
    --white: #FFFFFF;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Cairo', sans-serif;
    direction: rtl;
    line-height: 1.8; /* Increased line-height for better readability */
    color: var(--text-color);
    background-color: var(--white);
    -webkit-font-smoothing: antialiased; /* Makes fonts look sharper */
}

.container {
    width: 90%;
    max-width: 1100px;
    margin: 0 auto;
}

section {
    padding: 80px 0;
}

/* ------------------------- */
/* --- Typography System --- */
/* ------------------------- */

/* Headings */
h1, h2, h3, h4, h5, h6 {
    color: var(--primary-blue);
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 20px; /* Adds space below all headings */
}

h1 { font-size: 2.2rem; }
h2 { font-size: 2.25rem; }
h3 { font-size: 1.75rem; }
h4 { font-size: 1.5rem; }

/* Paragraphs & Text */
p {
    margin-bottom: 1.6rem; /* CRITICAL: Adds space between paragraphs */
    font-size: 1.05rem; /* Slightly larger than default for modern feel */
    color: var(--text-light);
}

/* Lists inside content */
.page-content ul, 
.about-text ul, 
.product-description ul,
.product-details ul {
    list-style-type: disc;
    list-style-position: outside;
    margin-bottom: 1.5rem;
    padding-right: 25px;
    padding-left: 0;
}

.page-content ol, 
.about-text ol, 
.product-description ol,
.product-details ol {
    list-style-type: decimal;
    list-style-position: outside;
    margin-bottom: 1.5rem;
    padding-right: 25px;
    padding-left: 0;
}

/* Prevent list styles from breaking WP Gallery blocks if they use ul/li */
.product-details .wp-block-gallery ul {
    list-style: none;
    padding-right: 0;
}

.page-content li, 
.about-text li,
.product-details li {
    margin-bottom: 0.8rem;
}

/* Links */
a {
    text-decoration: none;
    color: var(--primary-orange);
    transition: color 0.2s ease;
}

a:hover {
    color: #d66a1a;
}

/* Section Titles */
.section-title {
    text-align: center;
    font-size: 2.5rem;
    color: var(--primary-blue);
    margin-bottom: 60px; /* More space between title and content */
    position: relative;
}

.section-title::after {
    content: '';
    width: 80px;
    height: 4px;
    background: var(--primary-orange);
    position: absolute;
    bottom: -15px;
    right: 50%;
    transform: translateX(50%);
}

/* Buttons */
.cta-button {
    background: var(--primary-orange);
    color: var(--white) !important; /* Force white text */
    padding: 14px 32px;
    font-size: 1.1rem;
    font-weight: 700;
    border-radius: 5px;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    display: inline-block;
    margin-top: 10px;
}

.cta-button:hover {
    background: #e0701a;
    transform: translateY(-2px); /* Slight lift effect */
    box-shadow: 0 4px 12px rgba(246, 134, 49, 0.3);
}

/* ------------------------- */
/* --- Header & Nav --- */
/* ------------------------- */
header {
    background: var(--white);
    padding: 15px 0;
    border-bottom: 1px solid #eee;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
}

.logo img {
    height: 50px;
    margin-left: 15px;
}

.logo span {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-blue);
}

/* WP Nav Menu Styling */
.main-navigation ul {
    display: flex;
    margin: 0;
    padding: 0;
}

.main-navigation li {
    margin-right: 30px; /* Increased spacing between menu items */
    list-style: none;
}

.main-navigation a {
    color: var(--primary-blue);
    font-weight: 700;
    font-size: 1.05rem;
    position: relative;
}

/* Add an underline effect on hover for menu */
.main-navigation a::after {
    content: '';
    display: block;
    width: 0;
    height: 2px;
    background: var(--primary-orange);
    transition: width 0.3s;
    position: absolute;
    bottom: -5px;
    right: 0;
}

.main-navigation a:hover::after,
.main-navigation .current-menu-item > a::after {
    width: 100%;
}

.main-navigation a:hover,
.main-navigation .current-menu-item > a {
    color: var(--primary-orange);
}

/* ------------------------- */
/* --- Hero --- */
/* ------------------------- */
#hero {
    height: 85vh;
    background-color: var(--primary-blue); 
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: var(--white);
    padding: 0;
    position: relative;
}

/* Dark overlay to make text readable on any image */
#hero::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(51, 70, 100, 0.6);
    z-index: 1;
}

.hero-content {
    position: relative;
    z-index: 2;
    padding: 20px;
}

#hero h1 {
    color: var(--white);
    font-size: 3.5rem; /* Larger hero title */
    font-weight: 800;
    margin-bottom: 25px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

#hero p {
    font-size: 1.4rem;
    margin-bottom: 40px;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
    color: #f0f0f0;
}

/* ------------------------- */
/* --- About & General Page --- */
/* ------------------------- */
.about-content {
    display: flex;
    align-items: center;
    gap: 60px; /* Increased gap between image and text */
}

.about-text {
    flex: 1;
    /* Removed padding-left, gap handles it now */
}

/* Specific styling for the About text to make it stand out */
.about-text h3 {
    font-size: 1.8rem;
    margin-bottom: 25px;
    color: var(--primary-blue);
}

.about-text p {
    font-size: 1.15rem; /* Larger text for about section */
    line-height: 2; /* looser line height for easy reading */
    margin-bottom: 25px;
}

.about-image {
    flex: 1;
}

.about-image img {
    width: 100%;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    height: auto;
}

/* Content Images & Gallery - Generic Responsive Rule */
.product-details img,
.page-content img,
.wp-block-image img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
}

/* ------------------------- */
/* --- Products Grid --- */
/* ------------------------- */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 40px;
}

.product-card {
    border: 1px solid #eee;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
    transition: all 0.3s ease;
    background: #fff;
    display: flex;
    flex-direction: column;
}

.product-card:hover {
    box-shadow: 0 15px 30px rgba(0,0,0,0.1);
    transform: translateY(-5px);
}

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

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

.product-info {
    padding: 25px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.product-info h3 {
    color: var(--primary-orange);
    font-size: 1.4rem;
    margin-bottom: 15px;
}

.product-description {
    flex-grow: 1;
}

/* ------------------------- */
/* --- News / Blog --- */
/* ------------------------- */
.news-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 30px;
}

.news-item {
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    transition: transform 0.3s;
}

.news-item:hover {
    transform: translateY(-3px);
}

.news-content {
    padding: 25px;
}

.news-date {
    font-size: 0.9rem;
    color: #999;
    margin-bottom: 10px;
    font-weight: 700;
}

.news-content h3 {
    font-size: 1.3rem;
    margin-bottom: 15px;
}

/* ------------------------- */
/* --- Contact Page --- */
/* ------------------------- */
.contact-content {
    display: flex;
    gap: 40px;
    background: var(--white);
    padding: 50px;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.05);
}

.contact-info {
    flex: 1;
    background: var(--primary-blue);
    color: var(--white);
    padding: 40px;
    border-radius: 8px;
}

.contact-info h3 {
    color: var(--white);
    border-bottom: 2px solid var(--primary-orange);
    padding-bottom: 15px;
    display: inline-block;
    margin-bottom: 30px;
}

.contact-info p {
    color: #e0e0e0;
    margin-bottom: 30px;
}

.contact-info-item {
    display: flex;
    align-items: center;
    margin-bottom: 25px;
    font-size: 1.1rem;
}

.contact-info-item svg {
    width: 24px;
    height: 24px;
    margin-left: 15px;
    fill: var(--primary-orange);
    flex-shrink: 0;
}

.contact-info-item a {
    color: var(--white);
}

.contact-info-item a:hover {
    color: var(--primary-orange);
}

.contact-form-wrapper {
    flex: 2;
}

/* WP Contact Form 7 Styling */
.wpcf7 input[type="text"],
.wpcf7 input[type="email"],
.wpcf7 input[type="tel"],
.wpcf7 textarea {
    width: 100%;
    padding: 15px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-family: 'Cairo', sans-serif;
    font-size: 1rem;
    margin-bottom: 20px;
    background: #fcfcfc;
    transition: border 0.3s;
}

.wpcf7 input:focus,
.wpcf7 textarea:focus {
    border-color: var(--primary-orange);
    outline: none;
    background: #fff;
}

.wpcf7 input[type="submit"] {
    background: var(--primary-orange);
    color: var(--white);
    padding: 15px 40px;
    font-size: 1.1rem;
    font-weight: 700;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    transition: background 0.3s;
}

.wpcf7 input[type="submit"]:hover {
    background: #e0701a;
}

/* ------------------------- */
/* --- Footer --- */
/* ------------------------- */
footer {
    background: var(--primary-blue);
    color: var(--white);
    text-align: center;
    padding: 40px 0;
    margin-top: 80px;
}

footer p {
    color: #ccc;
    font-size: 0.95rem;
    margin-bottom: 0;
}

/* ------------------------- */
/* --- Responsive --- */
/* ------------------------- */
@media (max-width: 992px) {
    .about-content, .contact-content {
        flex-direction: column;
    }
    .about-text { padding-left: 0; }
    .contact-content { padding: 30px; }
}

@media (max-width: 768px) {
    header .container {
        flex-direction: column;
        gap: 15px;
    }
    .main-navigation ul {
        justify-content: center;
        flex-wrap: wrap;
    }
    #hero h1 { font-size: 2.5rem; }
    .product-grid { grid-template-columns: 1fr; }
    
    .section-title {
        font-size: 2rem;
        margin-bottom: 40px;
    }
}

/* ------------------------- */
/* --- Partners Marquee --- */
/* ------------------------- */
.partner-marquee-container {
    overflow: hidden;
    width: 100%;
    position: relative;
    padding: 30px 0;
    direction: ltr; /* Force LTR for consistent horizontal scroll translation */
    background: transparent;
}

.partner-marquee-container::before,
.partner-marquee-container::after {
    content: "";
    height: 100%;
    position: absolute;
    width: 150px;
    z-index: 2;
    pointer-events: none;
}

.partner-marquee-container::before {
    left: 0;
    top: 0;
    background: linear-gradient(to right, var(--white) 0%, rgba(255,255,255,0) 100%);
}

.partner-marquee-container::after {
    right: 0;
    top: 0;
    background: linear-gradient(to left, var(--white) 0%, rgba(255,255,255,0) 100%);
}

.partner-marquee-track {
    display: flex;
    width: max-content;
    animation: marquee-scroll 25s linear infinite;
}

.partner-marquee-track:hover {
    animation-play-state: paused;
}

.partner-marquee-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 180px;
    margin: 0 25px;
    flex-shrink: 0;
    transition: transform 0.3s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.partner-marquee-item:hover {
    transform: translateY(-5px);
}

.partner-logo-wrapper {
    height: 90px;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--white);
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.03);
    border: 1px solid #f0f0f0;
    padding: 15px;
    margin-bottom: 12px;
    transition: all 0.3s ease;
}

.partner-marquee-item:hover .partner-logo-wrapper {
    box-shadow: 0 10px 30px rgba(51, 70, 100, 0.08);
    border-color: var(--primary-orange);
}

.partner-logo-wrapper img {
    max-height: 100%;
    max-width: 100%;
    object-fit: contain;
    filter: grayscale(100%);
    opacity: 0.6;
    transition: all 0.3s ease;
}

.partner-marquee-item:hover .partner-logo-wrapper img {
    filter: grayscale(0%);
    opacity: 1;
}

.partner-name {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-light);
    text-align: center;
    transition: color 0.3s ease;
    direction: rtl; /* Retain RTL text flow for the name */
}

.partner-marquee-item:hover .partner-name {
    color: var(--primary-orange);
}

@keyframes marquee-scroll {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(-50%);
    }
}