@import url('https://fonts.googleapis.com/css2?family=Birthstone&family=Dancing+Script&display=swap');

/* --- RESET & GLOBAL STYLES --- */
:root {
    --color-background-dark: #1a1d2c;
    --color-background-light: #f4f1eb;
    --color-background-medium: #e8e6e1;
    --color-text-light: #ffffff;
    --color-text-dark: #2c2a2a;
    --color-primary-accent: #ff6b00;
    --color-secondary-accent: #6c9a9d;
    --color-subtle-border: rgba(44, 42, 42, 0.15);
    --font-main: 'Poppins', sans-serif;
    --space-unit: 1rem; 
    --space-s: calc(var(--space-unit) * 0.85);
    --space-m: calc(var(--space-unit) * 1.75);
    --space-l: calc(var(--space-unit) * 3.1);
    --space-xl: calc(var(--space-unit) * 5.5);
    --border-radius-subtle: 6px;
    --border-radius-card: 12px;
    --transition-organic: all 0.4s cubic-bezier(0.25, 1, 0.5, 1);
    --box-shadow-deep: 0px 10px 30px -5px rgba(26, 29, 44, 0.15), 0px 5px 15px -5px rgba(26, 29, 44, 0.1);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 100%; scroll-behavior: smooth; }
body {
    background-color: var(--color-background-light);
    color: var(--color-text-dark);
    font-family: var(--font-main);
    font-weight: 400;
    line-height: 1.65;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* --- UTILITIES --- */
.container { width: 90%; max-width: 1280px; margin-left: auto; margin-right: auto; }
.section { padding-top: var(--space-m); padding-bottom: var(--space-m); position: relative; }

.tool-hero + .section { /* Target section directly after tool-hero */
    padding-top: var(--space-s); /* Reduced padding */
}

@media (max-width: 768px) { .section { padding-top: var(--space-m); padding-bottom: var(--space-m); } }

/* --- TYPOGRAPHY --- */
h1, h2, h3, h4 { font-weight: 700; line-height: 1.2; color: var(--color-text-dark); }
h1 { font-size: clamp(2.2rem, 5vw, 3.2rem); font-weight: 800; }
h2 { font-size: clamp(2rem, 5vw, 3rem); margin-bottom: var(--space-m); }
h3 { font-size: clamp(1.4rem, 4vw, 1.8rem); }
p { max-width: 65ch; margin-bottom: var(--space-s); }
.section-header { max-width: 800px; margin: 0 auto var(--space-m) auto; text-align: center; }
.section-header p { margin-left: auto; margin-right: auto; }
strong { font-weight: 700; }

/* --- BUTTONS & LINKS --- */
.btn {
    display: inline-block;
    font-weight: 700;
    font-size: 1rem;
    text-decoration: none;
    padding: 0.8rem 1.8rem;
    border-radius: var(--border-radius-subtle);
    border: 2px solid transparent;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease; /* Consistent transition */
    z-index: 1;
    white-space: nowrap;
    text-align: center;
}

/* Primary Button */
.btn-primary {
    background-color: var(--color-primary-accent);
    color: white;
}
.btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--color-text-dark);
    transform: translateY(101%);
    transition: transform 0.3s cubic-bezier(0.7, 0, 0.2, 1);
    z-index: -1;
}
.btn-primary:hover::before {
    transform: translateY(0);
}

/* Secondary Button (Outline Style) */
.btn-secondary {
    background: transparent;
    border-color: var(--color-background-dark);
    color: var(--color-background-dark);
}
.btn-secondary:hover {
    background: var(--color-background-dark);
    color: white;
}

/* New Light Filled Button Style */
.btn-light-filled {
    background-color: white; /* Light background */
    color: var(--color-text-dark); /* Dark text */
    border-color: var(--color-primary-accent); /* Subtle border */
}
.btn-light-filled:hover {
    background-color: var(--color-background-medium); /* Slightly darker on hover */
    border-color: var(--color-text-dark); /* Darker border on hover */
}
.btn-outline-dark {
    background: transparent;
    border: 2px solid var(--color-background-dark);
    color: var(--color-background-dark);
    font-weight: 700;
}
.btn-outline-dark:hover {
    background: var(--color-background-dark);
    color: white;
}

.btn-small {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
}

/* --- HERO SECTION --- */
.hero {
    background-color: var(--color-background-dark);
    color: var(--color-text-light);
    height: auto;
    padding-top: 1.5rem;
    padding-bottom: 1.5rem;
    box-sizing: border-box;
}
.hero-content {
    text-align: center;
    margin: 0;
    padding: 0 var(--space-s);
}
.hero-content h1 { color: var(--color-text-light); margin-bottom: var(--space-s);}
.hero-content p { font-size: 1.2rem; max-width: 60ch; margin: 0 auto; }


.hero .container { display: flex; flex-wrap: wrap; gap: var(--space-s); justify-content: center; flex-direction: column;}
.filter-controls-wrapper { display: flex; flex-wrap: wrap; gap: var(--space-s); justify-content: center; max-width: none; width: 100%; margin: 0 auto; }
.filter-group { display: flex; flex-wrap: wrap; justify-content: center; }
.filter-group h3 { font-size: 1.2rem; margin: 0; padding-right: var(--space-s); }
.filter-group label { display: inline-flex; align-items: center; gap: 0.5rem; background: var(--color-background-medium); padding: 0.5rem 1rem; border-radius: var(--border-radius-subtle); box-shadow: 0 2px 5px rgba(0,0,0,0.05); cursor: pointer; color: var(--color-text-dark); white-space: nowrap; margin: 5px; }
.filter-group label:has(input[type="checkbox"]:checked) {
    background: white;
}
.sorting-group { display: flex; gap: 0.5rem; align-items: center; }
#sort-select { padding: 0.5rem; border-radius: var(--border-radius-subtle); border: 1px solid var(--color-subtle-border); font-family: var(--font-main); }
#reset-filters { background: transparent; border: none; color: var(--color-primary-accent); cursor: pointer; text-decoration: underline; font-weight: 700; }

/* --- GRID CONTROLS --- */
.grid-controls { display: flex; justify-content: space-between; align-items: center; margin-bottom: var(--space-m); }


/* --- PRODUCT GRID --- */
.comparison-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: var(--space-m); justify-items: center; }
.comparison-grid.two-items {
    justify-content: center;
}

@media (min-width: 650px) { /* Apply two-column layout only on wider screens */
    .comparison-grid.two-items {
        grid-template-columns: repeat(2, minmax(300px, max-content));
    }
}
.product-card { background: white; border-radius: var(--border-radius-card); box-shadow: var(--box-shadow-deep); display: flex; flex-direction: column; overflow: hidden; transition: var(--transition-organic); border: 2px solid transparent; height: 100%; max-width: 420px; width: 100%; }
.product-card:hover { transform: translateY(-5px); box-shadow: 0 15px 40px -10px rgba(26,29,44,0.2); border-color: var(--color-background-dark); }
.product-card-header { padding: var(--space-s); text-align: center; border-bottom: 1px solid var(--color-subtle-border); }
.product-card-header img { max-width: 120px; height: 40px; object-fit: contain; margin-bottom: var(--space-s); }
.product-card-header h3 { font-size: 1.4rem; margin: 0; }
.product-card-body { padding: var(--space-s); }
.product-card-body .short-desc { font-size: 1rem; text-align: center; margin-bottom: var(--space-s); overflow-wrap: break-word; min-height: 55px; }
.product-rating { display: flex; justify-content: center; align-items: center; gap: 0.5rem; font-weight: 700; margin-bottom: var(--space-s); }
.product-rating .star { color: #f39c12; }
.product-features-list { list-style: none; margin-bottom: var(--space-s); }
.product-features-list li {
    display: flex;
    align-items: center; /* Ensure vertical alignment */
    margin-bottom: 0.3rem;
    font-size: 0.9rem;
}
.product-features-list li:not(.review-item) {
    gap: 0.2rem; /* Apply gap only to non-review items */
	font-size:14px;
}
.product-features-list li.review-item {
    display: block;
    margin-bottom: 1rem; /* Add some space below the review item */
}
.product-features-list li.review-item strong {
    display: inline-block;
    margin-right: 0.25rem;
}
.product-features-list li.review-item span {
    display: inline;
    font-weight: 400; /* Make fragment not bold */
}
.product-features-list li.review-item p {
    margin-bottom: 0.5rem; /* Space between paragraphs in review */
}
.product-features-list .icon-check { color: #27ae60; }
.product-features-list .icon-cross { color: #c0392b; }
.product-card-footer { padding: var(--space-s); display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-s); border-top: 1px solid var(--color-subtle-border); margin-top: auto; }

/* --- NO RESULTS MESSAGE --- */
.no-results-message {
    text-align: center;
    padding: var(--space-l);
    grid-column: 1 / -1; /* Make it span all grid columns */
}
.no-results-message p {
    margin-bottom: var(--space-m);
    font-size: 1.2rem;
}

/* --- AFFILIATE DISCLOSURE --- */
.affiliate-disclosure { text-align: center; padding: var(--space-s) 0; background: var(--color-background-light); }
.affiliate-disclosure p { font-size: 0.9rem; opacity: 0.8; margin: 0; display: inline-block; text-align: center; max-width: 60%;}

/* --- FAQ SECTION --- */
.faq-section { background: var(--color-background-light); }
.faq-container { max-width: 800px; margin: 0 auto; }
.faq-item { border-bottom: 1px solid var(--color-subtle-border); }
.faq-question { display: flex; justify-content: space-between; align-items: center; padding: 1.5rem 0; font-size: 1.2rem; font-weight: 700; cursor: pointer; list-style: none; }
.faq-question::-webkit-details-marker { display: none; }
.faq-question::after { content: '+'; font-size: 2rem; font-weight: 400; color: var(--color-primary-accent); transition: transform 0.3s ease; }
.faq-item[open] > .faq-question::after { transform: rotate(45deg); }
.faq-answer { padding: 0 1rem 1.5rem 1rem; }

/* --- CONTACT SECTION --- */
.contact-section {
    background-color: var(--color-background-medium);
}
.contact-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-m);
    justify-items: center;
    max-width: 1100px;
    margin: 0 auto;
}
.form-wrapper, .contact-cta {
    background: white;
    padding: var(--space-m);
    border-radius: var(--border-radius-card);
    box-shadow: var(--box-shadow-deep);
    width: 100%;
    max-width: 600px;
}
.contact-cta {
    text-align: center;
}
.contact-cta h3 {
    margin-bottom: var(--space-s);
}
.contact-cta .btn {
    margin-top: var(--space-m);
}
.form-group {
    margin-bottom: var(--space-s);
}
.form-group label {
    display: block;
    font-weight: 700;
    margin-bottom: 0.5rem;
}
.form-group input[type="text"],
.form-group input[type="email"],
.form-group textarea {
    width: 100%;
    padding: 0.8rem;
    border: 1px solid var(--color-subtle-border);
    border-radius: var(--border-radius-subtle);
    font-family: var(--font-main);
    font-size: 1rem;
}
.form-group-checkbox {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}
.form-group-checkbox input[type="checkbox"] {
    margin-top: 5px;
}
.form-group-checkbox label {
    font-weight: 400;
    font-size: 0.9rem;
}

/* --- FOOTER --- */
.main-footer { background-color: var(--color-background-dark); color: var(--color-text-light); padding: var(--space-l) 0; }
.footer-container {
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: flex-start;
    gap: 2rem;
}
.footer-column-left {
    flex: 1;
    display: flex;
    justify-content: flex-end;
}
.footer-column-left .header-logo img {
    height: 100px; /* Larger logo */
    width: auto;
}

.footer-column-right {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: flex-start; /* Align content to the left within the column */
    text-align: left; /* For text blocks like copyright */
    gap: 0.5rem; /* Space between copyright, links, and date */
}
#last-updated { /* Specific styling for the moved date */
    opacity: 0.7;
}
.footer-details p { margin: 0; opacity: 0.8; font-size: 1rem; }
.footer-links {
    display: flex;
    gap: 2rem;
    justify-content: flex-start;
}
.footer-links a { color: var(--color-text-light); text-decoration: none; opacity: 0.8; transition: opacity 0.3s ease; }
.footer-links a:hover { opacity: 1; text-decoration: underline; }

/* RESPONSIVE STYLES */
@media (max-width: 1024px) {
    .controls-container {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--space-m);
    }
    .filter-controls-wrapper {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--space-m);
    }

}

@media (max-width: 768px) {
    .mobile-filter-trigger {
        display: block !important;
        width: 80%;
    }
    #open-drawer-btn {
        width: 100%;
        display: block;
    }
    .tool-hero-content {
        flex-direction: column;
        text-align: center;
    }
    .tool-hero-cta { /* Not defined in index.html, potentially a typo or from another file */
        justify-content: center;
    }

    .tool-details-grid {
        display: block !important; /* Overriding all other display properties */
    }

    .tool-details-grid > .tool-main-content,
    .tool-details-grid > .tool-sidebar {
        width: 100% !important;
        max-width: 100% !important;
        float: none !important; /* Clear any potential floats */
    }

    .tool-details-grid .tool-sidebar {
        position: static !important; /* Disable sticky positioning on mobile */
        margin-top: var(--space-m) !important; /* Add space between stacked sections */
    }

    /* Adjustments for tool detail page responsiveness */
    .tool-hero-logo {
        width: 100%; /* Make it flexible */
        max-width: 150px; /* Set a reasonable max-width */
        height: auto; /* Maintain aspect ratio */
    }

    .tool-hero-title-group {
        flex-direction: column; /* Stack logo and title */
        gap: 0.5rem; /* Smaller gap */
        order: 2 !important; /* Set order for title group */
    }

    .tool-hero-title-group h1 {
        font-size: clamp(1.8rem, 6vw, 2.5rem); /* Slightly smaller on mobile */
        word-break: break-word; /* Allow long words to break */
    }

    .tool-hero-back-button {
        margin-top: 0.5rem; /* Small top margin */
        align-self: center; /* Center the button */
        order: 1 !important; /* Set order for back button */
    }

    .pros-cons-lists {
        grid-template-columns: none !important; /* Disable columns for vertical stacking */
        gap: var(--space-m); /* Use a larger gap for vertical stacking */
    }

    .video-wrapper iframe {
        max-width: 100%;
        display: block; /* Ensure it behaves as a block element */
    }

    .card img {
        max-width: 100%;
        height: auto;
    }

    .card .btn {
        white-space: normal; /* Allow text to wrap in buttons inside cards */
        height: auto; /* Let the button height adjust */
    }

    /* Footer adjustments for mobile */
    .footer-container {
        flex-direction: column; /* Stack columns vertically */
        align-items: center;   /* Center items horizontally */
        gap: 1.5rem; /* Adjust gap for stacked elements */
    }

    .footer-column-left {
        justify-content: center; /* Center the logo horizontally */
        flex: none; /* Remove flex sizing */
    }

    .footer-column-right {
        align-items: center; /* Center content horizontally */
        text-align: center; /* Center text within the column */
        flex: none; /* Remove flex sizing */
    }

    .footer-column-left .header-logo img {
        height: 80px; /* Adjust logo size for mobile */
    }

    .footer-links {
        justify-content: center; /* Center the links */
    }
}

/* --- MOBILE FILTER DRAWER --- */
.mobile-filter-trigger {
    display: none; /* Hidden by default */
    position: fixed;
    bottom: 1rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 998;
    animation: slideInUp 0.5s ease-out;
}
#filter-count {
    display: inline-block;
    background: var(--color-secondary-accent);
    color: white;
    font-size: 0.8rem;
    padding: 0.1rem 0.5rem;
    border-radius: 1rem;
    margin-left: 0.5rem;
    min-width: 20px;
    text-align: center;
}
#filter-count:empty {
    display: none;
}

.mobile-filter-drawer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    max-width: 400px;
    height: 100%;
    background: var(--color-background-light);
    z-index: 1001;
    transform: translateX(-105%);
    transition: transform 0.4s cubic-bezier(0.7, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    box-shadow: 5px 0 25px rgba(0,0,0,0.1);
}
.mobile-filter-drawer.is-open {
    transform: translateX(0);
}
.drawer-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--color-subtle-border);
    flex-shrink: 0;
}
.drawer-header h3 {
    margin: 0;
}
#close-drawer-btn {
    background: none;
    border: none;
    font-size: 2rem;
    line-height: 1;
    cursor: pointer;
}
.drawer-content {
    padding: 1.5rem;
    overflow-y: auto;
    flex-grow: 1;
}
.drawer-content .filter-group {
    flex-direction: column;
    align-items: flex-start;
    margin-bottom: var(--space-m);
}
.drawer-content .filter-group h3 {
    margin-bottom: var(--space-s);
}
.drawer-content label {
    width: 100%;
    margin-bottom: 0.5rem;
}
.drawer-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--color-subtle-border);
    flex-shrink: 0;
}
.drawer-footer #apply-filters-btn {
    width: 100%;
}

@keyframes slideInUp {
    from { transform: translate(-50%, 150%); }
    to { transform: translate(-50%, 0); }
}


/* --- TOOL DETAIL PAGE --- */
.tool-hero {
    background-color: var(--color-background-light);
    color: var(--color-text-dark);
    padding: 0 0 0 0; /* Reduced padding-bottom */
}
.tool-hero-content {
    display: flex;
    flex-wrap: wrap;
    align-items: center; /* Vertically align items */
    justify-content: space-between; /* Space out items */
    padding-top: var(--space-s); /* Small top padding */
    gap: var(--space-s); /* Gap between flex items */
}

.tool-hero-title-group {
    display: flex;
    align-items: center; /* Align logo and h1 vertically */
    gap: var(--space-s); /* Small gap between logo and name */
}

.tool-hero-logo {
    flex-shrink: 0;
    width: 200px;
    height: 100px;
    object-fit: contain;
}

.tool-hero-title-group h1 {
    margin: 0; /* Remove default h1 margin */
    font-size: clamp(2rem, 5vw, 3rem); /* Adjust font size as needed */
}

.tool-hero-back-button {
    margin-top: 0.5rem; /* Small top margin */
    align-self: flex-start; /* Align to the top */
}

    .tool-hero-details {
        flex-basis: 100%; /* Takes full width below previous elements */
        margin-top: 0.5rem; /* Reduced space from logo/h1 */
        order: 3 !important; /* Set order for details */
    }
.tool-hero-details .short-desc {
    font-size: 1.2rem;
    width: 100%;
    max-width: unset;
}

.tool-details-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: var(--space-l);
    align-items: start;
}

.tool-main-content {
    display: flex;
    flex-direction: column;
    gap: var(--space-m);
}

.tool-sidebar {
    background: white;
    padding: var(--space-m);
    border-radius: var(--border-radius-card);
    box-shadow: var(--box-shadow-deep);
    position: sticky;
    top: 2rem;
}

.card {
    background: white;
    padding: var(--space-m);
    border-radius: var(--border-radius-card);
    box-shadow: var(--box-shadow-deep);
}
.card h2 {
    font-size: 1.8rem;
    margin-bottom: var(--space-m);
    padding-bottom: var(--space-s);
    border-bottom: 2px solid var(--color-primary-accent);
    display: inline-block;
}
.card p { /* New rule */
    max-width: 75ch;
}
.features-heading {
    font-size: 1.2rem;
    margin-bottom: var(--space-s);
}

.pros-cons-lists {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-m);
}
.pros-cons-lists h3 {
    margin-bottom: var(--space-s);
}
.pros-cons-lists ul {
    list-style: none;
    padding: 0;
}
.pros-cons-lists li {
    position: relative;
    padding-left: 1.5rem;
    margin-bottom: 0.5rem;
}
.pros-cons-lists li::before {
    position: absolute;
    left: 0;
    font-weight: bold;
}
.pros-list li::before {
    content: '✓';
    color: #27ae60;
}
.cons-list li::before {
    content: '✗';
    color: #c0392b;
}

.video-wrapper {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 */
    height: 0;
    overflow: hidden;
    border-radius: var(--border-radius-card);
}
.video-wrapper iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.signature {
    display: flex;
    gap: 1rem;
    align-items: center;
    margin-top: 2rem;
}

.handwritten {
    font-family: 'Birthstone', cursive;
    font-size: 2.5rem;
    color: #333;
    margin-bottom: 0; /* Remove bottom margin */
    line-height: 1; /* Adjust line height to reduce space */
}

.star-rating {
    display: inline-flex;
    font-size: 1.5rem; /* Increased font size for stars */
    vertical-align: middle;
}

.star {
    background: linear-gradient(to right, #f39c12 var(--percent), #ccc var(--percent));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

#pm-review p {
	font-style: italic;
}
