/**
 * Template: Home Page (Lean & Focused - Correct Structure)
 * Website: repcave.com
 */

/* ==========================================================================
   1. Design System & General Styling
   ========================================================================== */

:root {
    --font-primary: 'Poppins', sans-serif;
    --font-secondary: 'Inter', sans-serif;
    --color-primary: #E53935;
    --color-primary-dark: #C62828;
    --color-secondary: #1E88E5;
    --color-text-dark: #2c3e50;
    --color-text-light: #5a6a7a;
    --color-bg-light: #FFFFFF;
    --color-bg-alt: #F9FAFB;
    --color-border: #EAECEF;
    --section-padding: 6rem;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* Ensure body styles from template are respected */
body {
    font-family: var(--font-secondary);
    line-height: 1.6;
    color: var(--color-text-dark);
    background-color: var(--color-bg-light);
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; width: 100%; }
h1, h2, h3 { font-family: var(--font-primary); font-weight: 700; line-height: 1.2; margin: 0; color: var(--color-text-dark); }
h1 span, h2 span, h3 span { color: var(--color-primary); }
.section-title { font-size: 2.8rem; text-align: center; margin-bottom: 1.25rem; }
.section-subtitle { font-size: 1.1rem; text-align: center; color: var(--color-text-light); margin-bottom: 3.5rem; max-width: 700px; margin-left: auto; margin-right: auto; }
.button { display: inline-block; padding: 14px 32px; font-size: 1rem; font-family: var(--font-secondary); text-decoration: none; border-radius: 8px; transition: all 0.3s ease; font-weight: 600; cursor: pointer; letter-spacing: 0.5px; text-align: center; border: 2px solid transparent; }
.primary-button { background-color: var(--color-primary); color: #fff; border: 2px solid var(--color-primary); box-shadow: var(--shadow-sm); }
.primary-button:hover { background-color: var(--color-primary-dark); border-color: var(--color-primary-dark); transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.secondary-button { background-color: #fff; color: var(--color-text-dark); border: 2px solid var(--color-border); }
/* UPDATED: secondary-button:hover now matches the style from the workout page for consistency */
.secondary-button:hover { background-color: var(--color-text-dark); color: #fff; border-color: var(--color-text-dark); transform: translateY(-3px); box-shadow: var(--shadow-md); }
img { max-width: 100%; height: auto; transition: transform 0.3s ease; }
.section-cta { text-align: center; margin-top: 3rem; }

.full-width-background {
    width: 100vw;
    position: relative;
    left: 50%;
    right: 50%;
    margin-left: -50vw;
    margin-right: -50vw;
}

/* ==========================================================================
   2. Hero Section & Timer
   ========================================================================== */
.hero-section {
    background-color: var(--color-bg-alt);
    padding: var(--section-padding) 0;
    text-align: center;
}
.hero-content { display: flex; flex-direction: row; justify-content: space-between; align-items: center; gap: 50px; }
.hero-text-container { text-align: left; flex: 1; max-width: 620px; }
.hero-title { font-size: 3.8rem; font-weight: 700; margin-bottom: 1.5rem; }
.hero-description { font-size: 1.25rem; margin-bottom: 2.5rem; color: var(--color-text-light); line-height: 1.7; }
.hero-buttons { display: flex; gap: 1rem; }
.hero-timer-container { width: 100%; max-width: 360px; margin: 0 auto; }
.workout-timer { background-color: var(--color-bg-light); text-align: center; display: flex; flex-direction: column; align-items: center; padding: 30px 25px; border-radius: 16px; box-shadow: var(--shadow-xl); width: 100%; box-sizing: border-box; border: 1px solid var(--color-border); }
.timer-title { font-size: 1.1rem; font-weight: 600; color: var(--color-text-light); margin-bottom: 25px; text-transform: uppercase; letter-spacing: 2px; }
.timer-display-container { background-color: #f0f2f5; border-radius: 12px; margin-bottom: 25px; width: 100%; position: relative; overflow: hidden; height: 90px; display: flex; align-items: center; justify-content: center; }
.timer-progress-bar { position: absolute; top: 0; left: 0; height: 100%; width: 100%; background-color: var(--color-primary); border-radius: 12px; transition: width 0.5s linear, background-color 0.3s ease; z-index: 1; }
.workout-timer.rest-mode .timer-progress-bar { background-color: var(--color-secondary); }
.timer-display { font-size: 4.5rem; font-weight: 700; font-family: var(--font-primary); color: #fff; line-height: 1; text-align: center; position: relative; z-index: 2; text-shadow: 1px 1px 3px rgba(0,0,0,0.2); }
.timer-controls { display: flex; justify-content: center; align-items: center; width: 100%; gap: 20px; margin-bottom: 25px; }
.icon-button { background-color: #fff; color: var(--color-text-dark); width: 65px; height: 65px; border-radius: 50%; border: 1px solid var(--color-border); display: flex; align-items: center; justify-content: center; font-size: 1.4rem; cursor: pointer; transition: all 0.2s ease; box-shadow: var(--shadow-md); outline: none; }
.icon-button:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.timer-status { font-size: 0.9rem; padding: 8px 15px; border-radius: 20px; min-width: 250px; text-align: center; transition: all 0.3s ease; font-weight: 500; }
.timer-status p { margin: 0; } .timer-status #timer-mode { font-weight: 600; }
.workout-timer.workout-mode .timer-status { background-color: #FEECEB; color: var(--color-primary-dark); }
.workout-timer.rest-mode .timer-status { background-color: #E9F3FE; color: #1565C0; }

/* ==========================================================================
   3. Section & Card System (UPDATED)
   ========================================================================== */

/* --- Section Backgrounds --- */
.features-section, .newsletter-section { 
    padding: var(--section-padding) 0; 
    background-color: var(--color-bg-light); 
}
.home-gym-equipment-section, .faq-section { 
    padding: var(--section-padding) 0; 
    background-color: var(--color-bg-alt); 
}

/* --- Card Grids --- */
/* Increased minmax for the new card design which works better slightly wider */
.features-grid, .equipment-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

/* --- Base Card Styles (Adopted from Workout Page) --- */
.feature,
.equipment-item {
    background-color: var(--color-bg-light);
    border: 1px solid var(--color-border);
    border-radius: 12px;
    box-shadow: var(--shadow-md);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
}

.feature:hover,
.equipment-item:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-xl);
}

/* --- .feature Card (Icon-based) --- */
.feature {
    padding: 30px;
    text-align: left; /* Changed from center for consistency */
}

.feature .feature-icon {
    font-size: 2.5rem;
    color: var(--color-primary);
    margin: 0 0 1.25rem 0; /* Aligned left */
}

.feature h3 {
    font-size: 1.5rem; /* Standardized size */
    margin-bottom: 0.75rem;
}

.feature p {
    font-size: 1rem;
    color: var(--color-text-light);
    line-height: 1.6;
    margin-bottom: 0;
    flex-grow: 1; /* Ensures cards in the same row have equal height */
}

/* --- .equipment-item Card (Image-based, style from Workout Page) --- */
.equipment-item {
    overflow: hidden; /* Crucial for the image-flush-to-top effect */
}

.equipment-item .equipment-image {
    width: 100%;
    height: 220px; /* Standardized height from workout card */
    object-fit: cover;
    /* No margin or border-radius needed, it now fills the top of the card */
}

/* Content within the equipment card is now padded via margins */
.equipment-item h3,
.equipment-item p,
.equipment-item .button {
    margin-left: 30px;
    margin-right: 30px;
    text-align: left; /* Ensure text is left-aligned */
}

.equipment-item h3 {
    font-size: 1.5rem; /* Standardized size */
    margin-top: 1.5rem; /* Top space for the title */
    margin-bottom: 0.75rem;
}

.equipment-item p {
    font-size: 1rem;
    color: var(--color-text-light);
    margin-bottom: 1.5rem;
    flex-grow: 1; /* Pushes the button to the bottom */
}

.equipment-item .button {
    margin-top: auto; /* Aligns button to the bottom */
    margin-bottom: 30px; /* Bottom space for the button */
    /* The global .secondary-button class handles the rest of the styling */
}

/* ==========================================================================
   4. Newsletter Form & FAQ
   ========================================================================== */
.newsletter-form-wrapper { margin-top: 2.5rem; }
.newsletter-form { display: flex; max-width: 500px; margin: 0 auto; gap: 10px; align-items: center; }
.newsletter-input { flex-grow: 1; padding: 14px 20px; border-radius: 8px; border: 1px solid var(--color-border); font-family: var(--font-secondary); font-size: 1rem; }
.newsletter-submit { 
    padding-left: 24px; 
    padding-right: 24px; 
    white-space: nowrap;
}
.faq-section .faq-accordion { max-width: 800px; margin: 0 auto; }
.faq-item { margin-bottom: 1rem; border-radius: 12px; border: 1px solid var(--color-border); box-shadow: var(--shadow-sm); transition: all 0.3s ease; background-color: var(--color-bg-light); overflow: hidden; }
.faq-item:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.faq-question { font-size: 1.1rem; font-weight: 600; padding: 1.25rem 1.5rem; cursor: pointer; display: flex; justify-content: space-between; align-items: center; color: var(--color-text-dark); }
.faq-question i { transition: transform 0.3s ease; color: var(--color-primary); font-size: 1.2rem; }
.faq-item.active .faq-question i { transform: rotate(180deg); }
.faq-answer { padding: 0 1.5rem 1.5rem 1.5rem; display: none; color: var(--color-text-light); }
.faq-answer p { margin: 0; line-height: 1.7; }

/* ==========================================================================
   5. Final Call to Action Section
   ========================================================================== */
.call-to-action-section { background-color: var(--color-text-dark); padding: var(--section-padding) 0; text-align: center; }
.call-to-action-section .section-title, .call-to-action-section .section-subtitle { color: #fff; }
.call-to-action-section .primary-button { background-color: var(--color-primary); color: #fff; border-color: var(--color-primary); font-size: 1.1rem; padding: 16px 36px; box-shadow: var(--shadow-lg); }
.call-to-action-section .primary-button:hover { background-color: var(--color-primary-dark); border-color: var(--color-primary-dark); transform: translateY(-3px); box-shadow: var(--shadow-xl); }

/* ==========================================================================
   6. Responsive Styles
   ========================================================================== */
@media (max-width: 992px) {
    :root { --section-padding: 4.5rem; }
    .hero-content { flex-direction: column; text-align: center; }
    .hero-text-container { text-align: center; max-width: 100%; margin-bottom: 3rem; }
    .hero-buttons { justify-content: center; }
    .hero-title { font-size: 3rem; }
}
@media (max-width: 768px) {
    :root { --section-padding: 3.5rem; }
    .section-title { font-size: 2.2rem; }
    .section-subtitle { font-size: 1rem; }
    .hero-title { font-size: 2.5rem; }
    .features-grid, .equipment-grid { grid-template-columns: 1fr; }
}
@media (max-width: 540px) {
    .hero-title { font-size: 2.1rem; }
    .hero-buttons { flex-direction: column; align-items: center; gap: 1rem; }
    .button.primary-button, .button.secondary-button { width: 100%; max-width: 320px; }
}

/* General Styling - Fix Overflow */
body {
    font-family: 'Arial', sans-serif;
    line-height: 1.6;
    margin: 0;
    padding: 0;
    color: #333;
    background-color: #fff;
    overflow-x: hidden; /* Ensure no horizontal overflow */
    width: 100%; /* Explicitly set body width */
}

/* Full-Width Background Fix */
.full-width-background {
    width: 100vw;
    position: relative;
    left: 50%;
    right: 50%;
    margin-left: -50vw;
    margin-right: -50vw;
    /* Add this to handle scrollbar width on desktop */
    margin-right: calc(-50vw + 8px); /* Adjust for scrollbar width (typically 8px on desktop) */
}

/* Container Adjustment */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    width: 100%; /* Ensure container doesn’t exceed viewport */
}

/* Specific Section Adjustments (Apply to Both Pages) */
.plans-hero-section.full-width-background,
.plans-starters-section.full-width-background,
.plans-equipment-section.full-width-background,
.plans-quiz-section.full-width-background,
.plans-newsletter-section.full-width-background,
.plans-cta-section.full-width-background,
.contact-hero-section.full-width-background,
.contact-newsletter-section.full-width-background,
.contact-cta-section.full-width-background {
    overflow-x: hidden; /* Prevent horizontal overflow in these sections */
    padding: 80px 0; /* Maintain existing padding */
}

@media (max-width: 768px) {
    .full-width-background {
        margin-right: -50vw; /* Reset margin on mobile to avoid unnecessary adjustment */
    }
}

/* Ensure No Unintended Widths or Margins */
.site-main {
    width: 100%;
    margin: 0;
    padding: 0;
}

/* Additional Debugging - Remove if Not Needed */
* {
    box-sizing: border-box;
    /* Uncomment to debug and identify overflow elements */
    /* outline: 1px solid red; */
}