/* Medplan Theme - Main Styles */

/* Prose paragraph spacing */
.prose p { margin-bottom: 1em; }
.prose p:last-child { margin-bottom: 0; }
.prose ul { list-style: disc; padding-left: 1.5em; margin-bottom: 1em; }
.prose ol { list-style: decimal; padding-left: 1.5em; margin-bottom: 1em; }
.prose li { margin-bottom: 0.25em; }

/* Fluent Forms checkbox/radio links */
.ff-el-form-check a { color: #1e40af; }
.ff-el-form-check a:hover { color: #1e3a8a; }

/* WooCommerce ordering reset */
.woocommerce .woocommerce-ordering { float: none; margin: 0; }

/* Prevent horizontal overflow from slide animations */
main, footer { overflow-x: hidden; }
footer a, footer p, footer li { overflow-wrap: break-word; word-break: break-word; }

/* Responsive embed (YouTube, etc.) */
.product-video { position: relative; padding-bottom: 56.25%; height: 0; overflow: hidden; margin: 1em 0; border-radius: 0.75rem; }
.product-video iframe { position: absolute; top: 0; left: 0; width: 100%; height: 100%; }

/* Animation classes */
.fade-in {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s ease-out;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

.slide-in-left {
    opacity: 0;
    transform: translateX(-50px);
    transition: all 0.8s ease-out;
}

.slide-in-left.visible {
    opacity: 1;
    transform: translateX(0);
}

.slide-in-right {
    opacity: 0;
    transform: translateX(50px);
    transition: all 0.8s ease-out;
}

.slide-in-right.visible {
    opacity: 1;
    transform: translateX(0);
}

.scale-in {
    opacity: 0;
    transform: scale(0.8);
    transition: all 0.6s ease-out;
}

.scale-in.visible {
    opacity: 1;
    transform: scale(1);
}

/* Gradient backgrounds */
.gradient-bg {
    background: linear-gradient(135deg, #1e40af 0%, #3b82f6 100%);
}

.hero-gradient {
    background: linear-gradient(135deg, rgba(30, 64, 175, 0.9) 0%, rgba(59, 130, 246, 0.8) 100%);
}

/* Card hover effect */
.card-hover {
    transition: all 0.3s ease;
}

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

/* Language switcher styles */
.lang-btn.active {
    color: #1e40af;
    font-weight: 700;
}

.lang-btn:not(.active):hover {
    color: #3b82f6;
}

.lang-btn-mobile.active {
    color: #1e40af;
    font-weight: 700;
    transform: scale(1.1);
}

.lang-btn-mobile:not(.active):hover {
    color: #3b82f6;
}

/* Logo hover effect */
.logo-hover {
    transition: all 0.3s ease;
    filter: grayscale(100%);
}

.logo-hover:hover {
    filter: grayscale(0%);
    transform: scale(1.05);
}

/* Page content styles */
#page-content {
    color: #4b5563;
    line-height: 1.75;
}

#page-content h2 {
    font-size: 1.75rem;
    font-weight: 700;
    color: #111827;
    margin-top: 2rem;
    margin-bottom: 1rem;
}

#page-content h3 {
    font-size: 1.375rem;
    font-weight: 700;
    color: #111827;
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
}

#page-content h4 {
    font-size: 1.125rem;
    font-weight: 600;
    color: #111827;
    margin-top: 1.25rem;
    margin-bottom: 0.5rem;
}

#page-content p {
    margin-bottom: 1rem;
}

#page-content a {
    color: #1e40af;
}

#page-content a:hover {
    text-decoration: underline;
}

#page-content ul,
#page-content ol {
    margin: 1rem 0;
    padding-left: 1.5rem;
}

#page-content li {
    margin-bottom: 0.5rem;
}

#page-content img {
    border-radius: 0.75rem;
    margin: 1.5rem 0;
    max-width: 100%;
    height: auto;
}

#page-content blockquote {
    border-left: 4px solid #1e40af;
    padding-left: 1rem;
    font-style: italic;
    color: #6b7280;
    margin: 1.5rem 0;
}

#page-content strong {
    color: #111827;
}

/* Single post content styles */
#single-content {
    line-height: 1.7;
    color: #4b5563;
}

#single-content h2 {
    margin-top: 2rem;
    margin-bottom: 1rem;
    font-size: 1.5rem;
    font-weight: 700;
    color: #1f2937;
}

#single-content h3 {
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
    font-size: 1.25rem;
    font-weight: 600;
    color: #374151;
}

#single-content p {
    margin-bottom: 1.5rem;
}

#single-content ul {
    margin-bottom: 1.5rem;
    padding-left: 1.5rem;
    list-style-type: disc;
}

#single-content ol {
    margin-bottom: 1.5rem;
    padding-left: 1.5rem;
    list-style-type: decimal;
}

#single-content li {
    margin-bottom: 0.5rem;
}

#single-content a {
    color: #1e40af;
}

#single-content a:hover {
    text-decoration: underline;
}

#single-content blockquote {
    border-left: 4px solid #1e40af;
    padding: 1.5rem;
    margin: 2rem 0;
    font-style: italic;
    color: #6b7280;
    background-color: #f9fafb;
    border-radius: 0.5rem;
}

#single-content img {
    border-radius: 0.75rem;
    margin: 1.5rem 0;
    max-width: 100%;
    height: auto;
}

#single-content strong {
    color: #1f2937;
}

/* WooCommerce filter button */
.filter-button {
    transition: all 0.2s ease;
    background-color: #fff;
    color: #374151;
    border-color: #d1d5db;
}

.filter-button:hover {
    background-color: #f3f4f6;
    border-color: #9ca3af;
}

.filter-button.active {
    background-color: #1e40af;
    color: #fff;
    border-color: #1e40af;
}

.filter-button.active:hover {
    background-color: #1e3a8a;
    border-color: #1e3a8a;
}

/* ── Sidebar category tree ── */
.sidebar-group {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 0.75rem;
    overflow: hidden;
    margin-bottom: 1rem;
}
.sidebar-group-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    font-size: 0.9rem;
    font-weight: 700;
    color: #1e40af;
    background: #eff6ff;
    cursor: default;
    border-bottom: 1px solid #dbeafe;
}

.tree-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.45rem 1rem;
    font-size: 0.85rem;
    color: #374151;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
    border-bottom: 1px solid #f9fafb;
}
.tree-item:hover { background: #f3f4f6; color: #1e40af; }
.tree-item.active { background: #eff6ff; color: #1e40af; font-weight: 600; }
.tree-item .tree-arrow {
    font-size: 0.6rem;
    color: #9ca3af;
    transition: transform 0.2s;
    flex-shrink: 0;
    width: 1rem;
    text-align: center;
}
.tree-item.open .tree-arrow { transform: rotate(90deg); color: #1e40af; }

.tree-children {
    display: none;
    padding-left: 0.75rem;
    border-left: 2px solid #e5e7eb;
    margin-left: 1rem;
}
.tree-children.open { display: block; }

/* Mobile sidebar */
@media (max-width: 1023px) {
    .sidebar-overlay {
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,0.4);
        z-index: 40;
        display: none;
    }
    .sidebar-overlay.open { display: block; }
    .sidebar-panel {
        position: fixed;
        top: 0;
        left: -320px;
        width: 300px;
        height: 100%;
        background: #f9fafb;
        z-index: 50;
        overflow-y: auto;
        transition: left 0.3s ease;
        padding: 1rem;
        padding-top: 4.5rem;
    }
    .sidebar-panel.open { left: 0; }
}

/* WooCommerce single product - Image gallery */
.image-gallery {
    display: grid;
    grid-template-columns: 1fr 120px;
    gap: 1rem;
}

.thumbnail {
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.thumbnail.active {
    border-color: #1e40af;
}

.thumbnail:hover {
    border-color: #3b82f6;
}

/* Line clamp utility */
.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* WooCommerce product card fixes */
.product-card h3 a {
    color: inherit;
    text-decoration: none;
}

.product-card h3 a:hover {
    color: #1e40af;
}

/* Search modal */
#search-input::placeholder {
    color: #9ca3af;
}

/* Quote system buttons */
.medplan-quote-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 2rem;
    border-radius: 0.5rem;
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.5;
    border: 2px solid transparent;
    cursor: pointer;
    transition: background-color 0.2s, color 0.2s, border-color 0.2s;
    text-decoration: none;
}

.medplan-quote-btn--primary {
    background-color: #1e40af;
    color: #fff;
}
.medplan-quote-btn--primary:hover { background-color: #1e3a8a; color: #fff; }

.medplan-quote-btn--light {
    background-color: #fff;
    color: #1e40af;
}
.medplan-quote-btn--light:hover { background-color: #f3f4f6; }

.medplan-quote-btn--outline {
    background-color: transparent;
    color: #1e40af;
    border-color: #1e40af;
}
.medplan-quote-btn--outline:hover { background-color: #1e40af; color: #fff; }

.medplan-quote-btn--outline-light {
    background-color: transparent;
    color: #fff;
    border-color: #fff;
}
.medplan-quote-btn--outline-light:hover { background-color: #fff; color: #1e40af; }

.medplan-quote-btn--added {
    background-color: #059669;
    color: #fff;
}

.medplan-quote-btn:disabled,
.medplan-quote-btn[disabled] {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Quote count badge pulse */
@keyframes badge-pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.3); }
}
#quote-count-badge.pulse { animation: badge-pulse 0.3s ease; }
