/* ------- COLOR PALETTE ------- */
:root {
    --primary: #0A0B23; /* Main dark color */
    --accent: #06c371; /* Accent / highlight color */
    --bg: #FFFFFF; /* Background color */
    --text: #0A0B23; /* Default text color */
    --card: #FFFFFF; /* Card background color */
    --border: #E5E5E5; /* Default border color */
}

/* ------- RESET ------- */
* {
    box-sizing: border-box; /* Include padding/border in element size */
    margin: 0; /* Remove default margin */
    padding: 0; /* Remove default padding */
    direction: rtl; /* Right-to-left layout */
    font-family: Open Sans, Heebo, Alef; /* Default font stack */
}

/* ------- GLOBAL ------- */
html, body {
    height: 100%; /* Full viewport height */
    margin: 0;
}

body {
    background: var(--bg); /* Page background */
    color: var(--text); /* Default text color */
    line-height: 1.6; /* Line height for readability */
    display: flex; /* Flex container for vertical layout */
    flex-direction: column; /* Stack children vertically */
    min-height: 100vh; /* Ensure full height */
    padding-top: 65px; /* Space for fixed header */
}

/* ------- HERO SECTION ------- */
.hero {
    padding: 70px 30px; /* Top/bottom and side padding */
    text-align: center; /* Center text and buttons */
    display: flex; /* Flex layout for children */
    flex-direction: column; /* Stack children vertically */
    justify-content: flex-start; /* Push content to top */
    gap: 20px; /* Space between h1, p, and buttons */
}

.hero h1 {
    font-size: 48px; /* Large main heading */
    font-weight: 700; /* Bold */
    margin: 0; /* Remove default margin */
}

.hero p {
    font-size: 24px; /* Subheading size */
    font-weight: 400;
    color: #444; /* Subtle text color */
    margin: 0;
}

/* ------- FILTER BUTTONS ------- */
.filter-buttons {
    display: flex; /* Flex layout */
    gap: 10px; /* Space between buttons */
    justify-content: center; /* Center horizontally */
    margin-bottom: 20px; /* Space below buttons */
    flex-wrap: wrap; /* Wrap buttons on smaller screens */
}

.filter-buttons .filter-btn {
    background-color: var(--primary); /* Default button color */
    color: var(--bg); /* Text color */
    border: 2px solid var(--primary); /* Button border */
    padding: 8px 20px; /* Padding */
    border-radius: 8px; /* Rounded corners */
    cursor: pointer; /* Pointer on hover */
    font-weight: 600;
    font-size: 16px;
    transition: all 0.3s ease; /* Smooth hover transition */
}

.filter-buttons .filter-btn:hover {
    background-color: var(--bg); /* Swap background on hover */
    color: var(--accent); /* Change text color */
    border-color: var(--accent); /* Border color change */
}

/* Active filter button */
.filter-buttons .filter-btn.active {
    background-color: var(--bg); 
    color: var(--accent); 
    border-color: var(--accent);
}

/* ------- CARD DESIGN ------- */
.products-wrapper {
    display: flex; 
    justify-content: center;
    flex-direction: column;
    width: 100%;
}

.products-grid {
    display: flex;
    justify-content: right; /* Align cards to the right for RTL */
    flex-wrap: wrap; /* Wrap cards to new lines */
    gap: 15px; /* Space between cards */
    max-width: 1200px; /* Limit max width */
    width: 100%; 
    padding: 20px 5px;
    padding-bottom: 50px;
    margin: 0 auto; /* Center grid */
}

.product-card {
    background: var(--primary); /* Card background */
    border-radius: 12px; /* Rounded corners */
    text-align: center;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1); /* Soft shadow */
    width: 280px; 
    min-width: 230px;
    height: 400px;
    flex: 0 0 auto; /* Prevent shrinking */
    overflow: hidden; /* Hide overflow */
    display: flex; 
    flex-direction: column; /* Stack content vertically */
    transition: transform 0.3s, background-color 0.3s; /* Smooth hover effects */
}

/* Hover text color changes */
.product-card:hover .card-content h3,
.product-card:hover .card-content p,
.product-card:hover .info-scroll p {
    color: var(--bg);
    transition: color 0.3s ease;
}

.program-img {
    width: 100%;
    height: 140px;
    object-fit: cover; /* Crop image */
    flex-shrink: 0;
}

.card-content {
    padding: 15px;
    display: flex;
    flex-direction: column;
    flex-grow: 1; /* Fill remaining height */
    overflow: hidden;
}

.card-content h3 { 
    margin-top: 15px;
    margin-bottom: 8px; 
    color: var(--bg); 
    font-size: 18px;
    line-height: 1.2;
}

.card-content p { 
    font-size: 14px; 
    color: var(--bg); 
    line-height: 1.4;
    margin-bottom: 10px;
    flex-grow: 1; /* Push buttons to bottom */
}

.card-content .initial-text {
    font-size: 18px;
    line-height: 2;
    margin-top: 24px; /* Spacing for initial description */
}

/* Scrollable area inside expanded card */
.info-scroll {
    flex-grow: 1; 
    overflow-y: auto; /* Scrollable content */
    text-align: right;
    padding: 5px;
    font-size: 14px;
    line-height: 1.4;
    margin-bottom: 10px;
}

/* Scrollbar styling */
.info-scroll::-webkit-scrollbar {
    width: 4px;
}
.info-scroll::-webkit-scrollbar-thumb {
    background: var(--bg);
    border-radius: 10px;
}

/* ------- CARD BUTTONS ------- */
.card-actions {
    margin-top: auto; /* Push to bottom */
    display: flex;
    gap: 5px; /* Space between buttons */
    justify-content: center;
    padding: 0 5px 15px 5px;
    flex-shrink: 0;
}

.more-info-btn {
    background: var(--accent);
    color: var(--primary);
    border: none;
    padding: 8px 15px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
}

/* כפתור הוסף לעגלה מבוטל כרגע

.add-to-cart-btn {
    width: 150px;
}

.more-info-btn:hover, .add-to-cart-btn:hover {
    background: var(--bg);
    color: var(--accent);
}

*/

/* ------- SLIDER ARROWS ------- */
.slider-arrow {
    background: var(--primary);
    color: white;
    border: none;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 22px;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: 0.3s;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    flex-shrink: 0;
}

.slider-arrow:hover {
    background: var(--accent);
    color: var(--primary);
    transform: scale(1.1);
}

/* ------- HIGH CONTRAST MODE (ACCESSIBILITY) ------- */
body.high-contrast {
    background-color: #000 !important;
    color: #fff !important;
}

body.high-contrast header, 
body.high-contrast footer,
body.high-contrast .product-card {
    background-color: #000 !important;
    border: 2px solid #fff !important;
    color: #fff !important;
}

body.high-contrast a, 
body.high-contrast button {
    color: #ffff00 !important; /* Yellow text for high contrast */
}

/* --- RESPONSIVE --- */

/* Tablets: up to 1024px */
@media (max-width: 1024px) {
    .hero h1 { font-size: 36px; }
    .hero p { font-size: 20px; }
    .products-grid { justify-content: center; gap: 20px; }
    .product-card { width: 250px; height: auto; }
    .card-content .initial-text { font-size: 16px; }
    .filter-buttons .filter-btn { font-size: 14px; padding: 6px 16px; }
}

/* Large mobile: up to 768px */
@media (max-width: 768px) {
    header { flex-direction: column; align-items: center; height: auto; padding: 10px 20px; }
    .header-right { flex-direction: column; gap: 15px; }
    nav { display: none; } /* Hide navigation */
    .profile-btn, .cart-btn { font-size: 14px; padding: 4px 8px; }
    .hero h1 { font-size: 28px; }
    .hero p { font-size: 16px; }
    .products-grid { flex-direction: column; align-items: center; }
    .product-card { width: 90%; max-width: 300px; margin-bottom: 20px; }
    .card-content h3 { font-size: 16px; }
    .card-content p { font-size: 14px; }
}

/* Small mobile: up to 480px */
@media (max-width: 480px) {
    .hero { padding: 60px 10px; }
    .hero h1 { font-size: 24px; }
    .hero p { font-size: 14px; }
    .filter-buttons { flex-direction: column; gap: 10px; }
    .filter-buttons .filter-btn { width: 100%; padding: 8px 0; font-size: 14px; }
    .product-card { width: 100%; max-width: 100%; height: auto; }
    .program-img { height: 120px; }
    .card-content .initial-text { font-size: 14px; }
}
