/* Additional Styles for TIBI Pet Universe Theme */

/* Mobile search */
.mobile-search {
    display: none;
    position: relative;
}

.mobile-search input {
    padding-right: 3rem;
}

.mobile-search button {
    position: absolute;
    right: 0;
    top: 0;
    height: 100%;
    background: none;
    border: none;
    padding: 0 1rem;
    color: var(--muted-foreground);
}

/* Notifications */
.tibi-notification {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    padding: 1rem 1.5rem;
    background-color: var(--card);
    border-radius: var(--radius);
    box-shadow: var(--shadow-soft);
    z-index: 10000;
    transform: translateY(100px);
    opacity: 0;
    transition: var(--transition-smooth);
}

.tibi-notification.is-visible {
    transform: translateY(0);
    opacity: 1;
}

.tibi-notification-success {
    border-left: 4px solid var(--primary);
}

.tibi-notification-error {
    border-left: 4px solid var(--secondary);
}

/* Header states */
.site-header.is-scrolled {
    box-shadow: var(--shadow-card);
}

.site-header.is-hidden {
    transform: translateY(-100%);
}

/* Shop layout */
.shop-layout {
    display: grid;
    gap: 2rem;
}

.shop-layout.has-sidebar {
    grid-template-columns: 280px 1fr;
}

.shop-layout.no-sidebar {
    grid-template-columns: 1fr;
}

.shop-layout .shop-sidebar {
    position: sticky;
    top: calc(var(--header-height, 150px) + 2rem);
    height: fit-content;
}

.shop-layout .shop-content {
    min-width: 0; /* Prevent grid blowout */
}

/* Shop controls */
.woocommerce-shop-page .woocommerce-result-count,
.woocommerce-shop-page .woocommerce-ordering {
    margin-bottom: 1rem;
}

.woocommerce .woocommerce-result-count {
    margin: 0;
}

/* Automatic shop filters */
.shop-filters-toggle {
    display: none;
    width: 100%;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.875rem 1rem;
    margin-bottom: 0.75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--card);
    color: var(--foreground);
    font-weight: 600;
    cursor: pointer;
}

.tibi-shop-filters {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    margin-bottom: 1.5rem;
}

.tibi-shop-filters__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--primary);
}

.tibi-shop-filters__title {
    margin: 0;
    font-size: 1.125rem;
    font-weight: 700;
    line-height: 1.3;
}

.tibi-shop-filters__clear {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--primary);
    text-decoration: none;
    white-space: nowrap;
}

.tibi-shop-filters__clear:hover {
    text-decoration: underline;
}

.tibi-shop-filters__active {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.tibi-shop-filters__chip {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    max-width: 100%;
    padding: 0.35rem 0.6rem;
    border-radius: 999px;
    background: rgba(18, 157, 171, 0.1);
    border: 1px solid rgba(18, 157, 171, 0.25);
    color: var(--tibi-teal, #129dab);
    font-size: 0.75rem;
    font-weight: 600;
    text-decoration: none;
    line-height: 1.2;
}

.tibi-shop-filters__chip:hover {
    background: rgba(18, 157, 171, 0.16);
}

.tibi-shop-filters__chip-remove {
    font-size: 1rem;
    line-height: 1;
}

.tibi-shop-filters__group {
    border-bottom: 1px solid var(--border);
    padding: 0.75rem 0;
}

.tibi-shop-filters__group:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.tibi-shop-filters__group--current {
    padding-top: 0;
}

.tibi-shop-filters__current {
    margin: 0 0 0.5rem;
    font-size: 0.875rem;
    color: var(--muted-foreground);
}

.tibi-shop-filters__current strong {
    color: var(--foreground);
}

.tibi-shop-filters__back {
    display: inline-block;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--primary);
    text-decoration: none;
    margin-bottom: 0.25rem;
}

.tibi-shop-filters__back:hover {
    text-decoration: underline;
}

.tibi-shop-filters__summary {
    list-style: none;
    cursor: pointer;
    font-size: 0.9375rem;
    font-weight: 700;
    color: var(--foreground);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    user-select: none;
}

.tibi-shop-filters__summary::-webkit-details-marker {
    display: none;
}

.tibi-shop-filters__summary::after {
    content: '';
    width: 0.5rem;
    height: 0.5rem;
    border-right: 2px solid var(--muted-foreground);
    border-bottom: 2px solid var(--muted-foreground);
    transform: rotate(45deg);
    transition: transform 0.2s ease;
    flex-shrink: 0;
    margin-top: -0.2rem;
}

.tibi-shop-filters__group[open] > .tibi-shop-filters__summary::after {
    transform: rotate(225deg);
    margin-top: 0.2rem;
}

.tibi-shop-filters__list {
    list-style: none;
    margin: 0.75rem 0 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    max-height: 260px;
    overflow: auto;
}

.tibi-shop-filters__list li a {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.45rem 0.35rem;
    border-radius: calc(var(--radius) - 2px);
    color: var(--foreground);
    text-decoration: none;
    font-size: 0.875rem;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.tibi-shop-filters__list li a:hover {
    background: var(--muted);
    color: var(--primary);
}

.tibi-shop-filters__list li.is-current a,
.tibi-shop-filters__list li.is-selected a {
    background: rgba(250, 35, 43, 0.06);
    color: var(--primary);
    font-weight: 600;
}

.tibi-shop-filters__label {
    flex: 1;
    min-width: 0;
}

.tibi-shop-filters__count {
    color: var(--muted-foreground);
    font-size: 0.75rem;
    font-weight: 600;
}

.tibi-shop-filters__check {
    width: 1rem;
    height: 1rem;
    border: 1.5px solid var(--border);
    border-radius: 0.25rem;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--card);
}

.tibi-shop-filters__list li.is-selected .tibi-shop-filters__check {
    background: var(--primary);
    border-color: var(--primary);
}

.tibi-shop-filters__list li.is-selected .tibi-shop-filters__check::after {
    content: '';
    width: 0.28rem;
    height: 0.5rem;
    border-right: 2px solid #fff;
    border-bottom: 2px solid #fff;
    transform: rotate(45deg);
    margin-top: -1px;
}

@media (max-width: 992px) {
    .shop-layout,
    .shop-layout.has-sidebar {
        grid-template-columns: 1fr;
    }
    
    .shop-layout .shop-sidebar {
        position: static;
        order: -1;
    }

    .shop-filters-toggle {
        display: inline-flex;
    }

    .shop-filters-panel {
        display: none;
    }

    .shop-filters-panel.is-open {
        display: block;
    }
}

/* WooCommerce page wrapper */
.woocommerce-shop-page {
    padding: 2rem 0;
}

.woocommerce-shop-page .page-title {
    margin-bottom: 1rem;
}

/* Author box */
.author-box {
    display: flex;
    gap: 1.5rem;
    padding: 2rem;
    background-color: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin: 2rem 0;
}

.author-avatar img {
    border-radius: 9999px;
}

.author-name {
    margin: 0 0 0.5rem;
    font-size: 1.25rem;
}

.author-bio {
    color: var(--muted-foreground);
    margin-bottom: 0.5rem;
}

.author-link {
    font-weight: 500;
    font-size: 0.875rem;
}

/* Post navigation */
.post-navigation {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin: 2rem 0;
}

.nav-previous,
.nav-next {
    padding: 1.5rem;
    background-color: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.nav-next {
    text-align: right;
}

.nav-label {
    display: block;
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--muted-foreground);
    margin-bottom: 0.5rem;
}

.post-navigation a {
    font-weight: 600;
    color: var(--foreground);
}

.post-navigation a:hover {
    color: var(--primary);
}

/* Entry share */
.entry-share {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding-top: 1.5rem;
    margin-top: 1.5rem;
    border-top: 1px solid var(--border);
}

.share-label {
    font-weight: 500;
}

.share-links {
    display: flex;
    gap: 0.5rem;
}

.share-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 9999px;
    background-color: var(--muted);
    color: var(--foreground);
    transition: var(--transition-smooth);
}

.share-link:hover {
    background-color: var(--primary);
    color: var(--primary-foreground);
}

.share-link svg {
    width: 1rem;
    height: 1rem;
}

/* Single post styles */
.single-post .entry-thumbnail {
    margin: 2rem 0;
    border-radius: var(--radius);
    overflow: hidden;
}

.single-post .entry-thumbnail img {
    width: 100%;
    height: auto;
}

.single-post .entry-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.single-post .entry-meta .separator {
    color: var(--muted-foreground);
}

/* Comments styles */
.comments-area {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border);
}

.comments-title {
    margin-bottom: 2rem;
}

.comment-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.comment-list .comment {
    padding: 1.5rem 0;
    border-bottom: 1px solid var(--border);
}

.comment-list .comment .children {
    list-style: none;
    padding-left: 2rem;
    margin-top: 1rem;
}

.comment-author {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.5rem;
}

.comment-author img {
    border-radius: 9999px;
}

.comment-author .fn {
    font-weight: 600;
}

.comment-metadata {
    font-size: 0.75rem;
    color: var(--muted-foreground);
    margin-bottom: 0.75rem;
}

.comment-content p {
    margin: 0;
}

.reply {
    margin-top: 0.5rem;
}

.reply a {
    font-size: 0.875rem;
    font-weight: 500;
}

/* Comment form */
.comment-respond {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border);
}

.comment-form {
    display: grid;
    gap: 1rem;
}

.comment-form p {
    margin: 0;
}

.comment-form label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.comment-form input,
.comment-form textarea {
    width: 100%;
}

.comment-form .form-submit {
    margin-top: 0.5rem;
}

/* Checkout trust badges */
.checkout-trust-badges {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
}

.trust-badge {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    text-align: center;
}

.trust-badge svg {
    width: 1.5rem;
    height: 1.5rem;
    color: var(--primary);
}

.trust-badge span {
    font-size: 0.75rem;
    color: var(--muted-foreground);
}

/* Sold out badge */
.sold-out {
    position: absolute;
    top: 0.75rem;
    left: 0.75rem;
    padding: 0.25rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: #fff;
    background-color: var(--muted-foreground);
    border-radius: var(--radius);
    z-index: 1;
}

/* Shop controls */
.shop-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

/* Breadcrumbs */
.woocommerce-breadcrumb,
.breadcrumbs {
    font-size: 0.875rem;
    color: var(--muted-foreground);
    margin-bottom: 1.5rem;
}

/* Booking form */
.tpu-booking-form-wrapper {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

.tpu-booking-form-header {
    background: linear-gradient(135deg, var(--primary), var(--primary-hover));
    color: var(--primary-foreground);
    padding: 1.5rem;
    text-align: center;
}

.tpu-booking-form-header h3 {
    margin: 0 0 0.5rem;
    font-size: 1.5rem;
    font-weight: 600;
}

.tpu-booking-form-header p {
    margin: 0;
    opacity: 0.9;
    font-size: 0.95rem;
}

.tpu-booking-form {
    padding: 1.5rem;
}

.tpu-form-section {
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border);
}

.tpu-form-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.tpu-form-section h4 {
    margin: 0 0 1rem;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--foreground);
}

.tpu-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1rem;
}

.tpu-form-col-full {
    grid-column: 1 / -1;
}

.tpu-form-col label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--foreground);
}

.tpu-booking-form input[type="text"],
.tpu-booking-form input[type="email"],
.tpu-booking-form input[type="tel"],
.tpu-booking-form input[type="date"],
.tpu-booking-form select,
.tpu-booking-form textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--background);
    font-size: 0.95rem;
    transition: border-color 0.2s ease;
}

.tpu-booking-form input:focus,
.tpu-booking-form select:focus,
.tpu-booking-form textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(18, 157, 171, 0.1);
}

.tpu-booking-form .required {
    color: var(--primary);
}

.tpu-consent {
    background: rgba(18, 157, 171, 0.05);
    border: 1px solid rgba(18, 157, 171, 0.2);
    border-radius: 6px;
    padding: 1rem;
}

.tpu-consent-label {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    font-size: 0.9rem;
    line-height: 1.4;
    cursor: pointer;
}

.tpu-consent input[type="checkbox"] {
    margin-top: 0.1rem;
    width: auto;
}

.tpu-form-submit {
    text-align: center;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

.tpu-form-submit .button {
    min-width: 200px;
    padding: 0.875rem 2rem;
    font-size: 1rem;
    font-weight: 600;
}

.tpu-form-note {
    margin: 1rem 0 0;
    font-size: 0.85rem;
    color: var(--muted-foreground);
}

/* Booking page layout */
.tpu-booking-page {
    display: grid;
    gap: 2rem;
    grid-template-columns: 1fr 320px;
    align-items: start;
    margin-top: 1.25rem;
}

.tpu-booking-main { }

.tpu-booking-sidebar { }

.tpu-booking-widget {
    background: var(--card);
    padding: 1.5rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 1.5rem;
}

.tpu-booking-widget h3 {
    margin: 0 0 1rem;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--foreground);
}

.tpu-booking-services,
.tpu-booking-hours,
.tpu-booking-info {
    list-style: none;
    padding: 0;
    margin: 0;
}

.tpu-booking-services li,
.tpu-booking-hours li,
.tpu-booking-info li {
    padding: 0.25rem 0;
    border-bottom: 1px solid rgba(0,0,0,0.05);
}

.tpu-booking-services li:last-child,
.tpu-booking-hours li:last-child,
.tpu-booking-info li:last-child {
    border-bottom: none;
}

.tpu-booking-services li:before {
    content: "🐾";
    margin-right: 0.5rem;
}

.tpu-booking-hours li:before {
    content: "🕐";
    margin-right: 0.5rem;
}

.tpu-booking-info li:before {
    content: "ℹ️";
    margin-right: 0.5rem;
}

.tpu-hours-note {
    margin: 1rem 0 0;
    font-size: 0.85rem;
    color: var(--primary);
    font-weight: 500;
}

.tpu-booking-widget p {
    margin: 0 0 0.75rem;
    line-height: 1.5;
}

.tpu-booking-widget p:last-child {
    margin-bottom: 0;
}

/* Booking messages */
.tpu-booking-message {
    padding: 1rem 1.25rem;
    border-radius: 6px;
    margin-bottom: 1.5rem;
    font-weight: 500;
}

.tpu-booking-success {
    background: rgba(18,157,171,0.08);
    border: 1px solid rgba(18,157,171,0.2);
    color: var(--foreground);
}

.tpu-booking-error {
    background: rgba(250,35,43,0.06);
    border: 1px solid rgba(250,35,43,0.12);
    color: var(--foreground);
}

/* Admin urgency badges */
.tpu-urgency-badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.tpu-urgency-normal {
    background: rgba(18,157,171,0.1);
    color: var(--primary);
}

.tpu-urgency-urgent {
    background: rgba(255,193,0,0.1);
    color: #d4a500;
}

.tpu-urgency-emergency {
    background: rgba(250,35,43,0.1);
    color: var(--secondary);
}

/* Admin meta sections */
.tpu-booking-meta-sections {
    display: grid;
    gap: 1.5rem;
}

.tpu-meta-section {
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 6px;
    border: 1px solid #e9ecef;
}

.tpu-meta-section h4 {
    margin: 0 0 1rem;
    font-size: 1rem;
    font-weight: 600;
    color: var(--foreground);
    border-bottom: 1px solid #e9ecef;
    padding-bottom: 0.5rem;
}

.tpu-meta-section p {
    margin: 0 0 0.5rem;
    font-size: 0.9rem;
}

.tpu-meta-section p:last-child {
    margin-bottom: 0;
}

.tpu-meta-section select,
.tpu-meta-section input {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid #ced4da;
    border-radius: 4px;
    background: white;
}

.tpu-meta-section textarea {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid #ced4da;
    border-radius: 4px;
    background: white;
    resize: vertical;
}

/* Responsive */
@media (max-width: 992px) {
    .tpu-booking-page {
        grid-template-columns: 1fr;
    }

    .tpu-form-row {
        grid-template-columns: 1fr;
    }

    .tpu-booking-form {
        padding: 1rem;
    }

    .tpu-booking-form-header {
        padding: 1rem;
    }
}

@media (max-width: 768px) {
    .tpu-booking-widget {
        padding: 1rem;
    }

    .tpu-form-section {
        margin-bottom: 1.5rem;
        padding-bottom: 1rem;
    }
}


.woocommerce-breadcrumb a,
.breadcrumbs a {
    color: var(--muted-foreground);
}

.woocommerce-breadcrumb a:hover,
.breadcrumbs a:hover {
    color: var(--primary);
}

.breadcrumb-separator,
.separator {
    margin: 0 0.5rem;
}

/* Newsletter notice */
.newsletter-notice {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    padding: 1rem 2rem;
    border-radius: var(--radius);
    z-index: 10000;
    animation: slideUp 0.3s ease;
}

.newsletter-notice.success {
    background-color: rgb(236, 65, 48);
    border: 1px solid #00a3e0;
    color: #fff;
}

.newsletter-notice.error {
    background-color: rgba(250, 35, 43, 0.1);
    border: 1px solid var(--secondary);
    color: var(--secondary);
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(1rem);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

/* Print styles */
@media print {
    .site-header,
    .site-footer,
    .mobile-menu,
    .entry-share,
    .post-navigation,
    .comments-area {
        display: none !important;
    }
    
    body {
        font-size: 12pt;
        background: #fff;
        color: #000;
    }
    
    a {
        color: #000;
        text-decoration: underline;
    }
}

/* 
---------------------------------------------
   MEGA MENU STYLES (Desktop)
   Adjusted for TIBI Pet Universe
---------------------------------------------
*/

.primary-menu-container a {
    color: var(--foreground);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 600;
    transition: color 0.2s ease;
}

.primary-menu-container a:hover {
    color: var(--tibi-red);
}

.primary-menu-container > ul {
    list-style: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0;
    padding: 0;
}

.primary-menu-container li {
    position: relative;
}

/* Top-level menu items */
.primary-menu-container > ul > li > a {
    display: block;
    padding: 0.75rem 1.25rem;
    border-radius: 8px;
    font-family: 'Gilroy', sans-serif;
    transition: all 0.2s ease;
}

.primary-menu-container > ul > li > a:hover,
.primary-menu-container > ul > li.menu-open > a {
    background-color: rgba(250, 35, 43, 0.08);
    color: var(--tibi-red);
}

.sub-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background: white;
    border: none;
    border-radius: 12px;
    min-width: 240px;
    padding: 0.75rem;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    box-shadow: 0 15px 45px rgba(36, 39, 41, 0.15);
    z-index: 1001;
    list-style: none;
    transition: all 0.25s ease;
    transform: translateY(10px);
}

/* Show submenu ONLY with .menu-open class (controlled by JS) */
.primary-menu-container li.menu-open > .sub-menu {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0);
}

.sub-menu a {
    display: block;
    padding: 0.65rem 1rem;
    font-size: 0.9rem;
    border-radius: 8px;
    color: var(--foreground);
    font-weight: 500;
}

.sub-menu a:hover {
    background: rgba(250, 35, 43, 0.08);
    color: var(--tibi-red);
}

.sub-menu > li {
    margin: 0.15rem 0;
}

/* Burger Menu Toggle */
.menu-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    width: 2.75rem;
    height: 2.75rem;
    background-color: var(--muted);
    border: none;
    cursor: pointer;
    flex-direction: column;
    gap: 4px;
    border-radius: var(--radius);
    transition: var(--transition-smooth);
    z-index: 1100;
}

.menu-toggle span {
    width: 20px;
    height: 2px;
    background: var(--foreground);
    display: block;
    transition: all 0.3s ease;
    border-radius: 2px;
}

.menu-toggle:hover {
    background-color: var(--tibi-red);
}

.menu-toggle:hover span {
    background: white;
}

.menu-toggle[aria-expanded="true"] span:nth-child(1) {
    transform: translateY(6px) rotate(45deg);
}

.menu-toggle[aria-expanded="true"] span:nth-child(2) {
    opacity: 0;
}

.menu-toggle[aria-expanded="true"] span:nth-child(3) {
    transform: translateY(-6px) rotate(-45deg);
}

@media (max-width: 991px) {
    .menu-toggle {
        display: flex;
    }
}

/* Mega Menu Desktop */
@media (min-width: 992px) {
    .header-main {
        position: relative;
    }

    .primary-menu-container > ul > li.menu-item-has-children {
        position: static;
    }

    .primary-menu-container > ul > li.menu-open > ul.sub-menu.mega-submenu {
        width: 100%;
        left: 0;
        right: 0;
        top: 100%;
        padding: 0;
        background: #fff;
        box-shadow: 0 25px 50px rgba(36,39,41,0.15);
        border-top: 4px solid var(--tibi-red);
        border-radius: 0 0 16px 16px;
        overflow: hidden;
    }

    .primary-menu-container > ul > li.menu-open > ul.sub-menu.mega-submenu > li.mega-tabs {
        display: flex;
        min-height: 400px;
    }

    .primary-menu-container ul.sub-menu.mega-submenu .mega-tabs-left {
        width: 300px;
        background: #fcfdfe;
        border-right: 1px solid var(--border);
        padding: 1.5rem 0;
        margin: 0;
        list-style: none;
    }

    .primary-menu-container ul.sub-menu.mega-submenu .mega-tab > a {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 1rem 1.5rem;
        font-family: 'Gilroy', sans-serif;
        font-size: 0.95rem;
        text-transform: uppercase;
        letter-spacing: 0.5px;
        font-weight: 700;
        color: var(--foreground);
    }

    .primary-menu-container ul.sub-menu.mega-submenu .mega-tab.active > a,
    .primary-menu-container ul.sub-menu.mega-submenu .mega-tab > a:hover {
        background: rgba(250, 35, 43, 0.05);
        color: var(--tibi-red);
    }

    .primary-menu-container ul.sub-menu.mega-submenu .mega-tabs-right {
        flex: 1;
        padding: 2.5rem;
        background: #fff;
    }

    .primary-menu-container ul.sub-menu.mega-submenu .mega-panel {
        display: none;
    }

    .primary-menu-container ul.sub-menu.mega-submenu .mega-panel.active {
        display: block;
    }

    .primary-menu-container ul.sub-menu.mega-submenu .mega-tabs-right ul.sub-menu {
        position: static;
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
        box-shadow: none;
        border: none;
        background: transparent;
        padding: 0;
        margin: 0;
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 1rem 2rem;
        transform: none;
    }

    .primary-menu-container ul.sub-menu.mega-submenu .mega-tabs-right ul.sub-menu > li > a {
        font-weight: 400;
        color: var(--muted-foreground);
        padding: 0.5rem 0;
        font-size: 0.95rem;
    }

    .primary-menu-container ul.sub-menu.mega-submenu .mega-tabs-right ul.sub-menu > li > a:hover {
        color: var(--tibi-red);
        background: transparent;
        padding-left: 5px;
    }
}

/* 
=====================================================
   TIBI MEGA MENU V2 - ROBUST & OPTIMIZED
=====================================================
*/

/* 1. Reset & Overrides */
/* Ensure default sub-menus are hidden to prevent FOUC/Double Render */
.tibi-mega-menu-wrapper ul.sub-menu {
    display: none !important;
}

/* 2. Container Relative Positioning */
.tibi-mega-menu-wrapper .primary-menu-container > ul > li {
    position: static; /* Allows full-width dropdown */
}

.tibi-mega-menu-wrapper .primary-menu-container {
    position: relative; 
}

/* 3. The Mega Dropdown (Generated by JS) */
.tibi-mega-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
    z-index: 999;
    display: flex; /* Flex layout: Tabs + Content */
    min-height: 400px;
    border-radius: 0 0 16px 16px;
    border-top: 4px solid var(--tibi-red);
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
}

/* Show on Hover via CSS (JS sets structure, CSS handles show/hide) */
.tibi-mega-menu-wrapper .primary-menu-container > ul > li:hover .tibi-mega-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* 4. Left Tabs Column */
.mega-tabs-container {
    width: 280px;
    background: #f8f9fa;
    border-right: 1px solid #eee;
    padding: 1rem 0;
    flex-shrink: 0;
}

.mega-tab-btn {
    display: block;
    width: 100%;
    text-align: left;
    padding: 1rem 1.5rem;
    border: none;
    background: transparent;
    font-family: 'Gilroy', sans-serif;
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--foreground);
    cursor: pointer;
    transition: all 0.2s;
    text-transform: uppercase;
    position: relative;
}

.mega-tab-btn:hover,
.mega-tab-btn.active {
    background: #fff;
    color: var(--tibi-red);
    box-shadow: -4px 0 0 var(--tibi-red) inset; /* Left accent border */
}

/* 5. Right Content Area */
.mega-content-container {
    flex-grow: 1;
    padding: 2.5rem;
    background: #fff;
}

.mega-panel {
    display: none;
    animation: fadeIn 0.3s ease;
}

.mega-panel.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(5px); }
    to { opacity: 1; transform: translateY(0); }
}

.mega-panel-title {
    font-family: 'Pacifico', cursive; /* Brand Font */
    color: var(--tibi-red); /* Brand Color */
    font-size: 2rem;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #f0f0f0;
}
.mega-panel-title a { color: inherit; text-decoration: none; }

/* 6. Grid Layout for Links */
.mega-links-list {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    list-style: none;
    padding: 0;
    margin: 0;
}

.mega-links-list li {
    margin: 0;
}

.mega-links-list a {
    display: block;
    padding: 0.5rem 0;
    color: var(--muted-foreground);
    font-size: 0.95rem;
    transition: 0.2s;
    text-decoration: none;
}

.mega-links-list a:hover {
    color: var(--tibi-red);
    transform: translateX(5px);
}

/* 7. Simple Dropdown Fallback (Has-simple-dropdown) */
.has-simple-dropdown .sub-menu {
    display: none !important; /* Hide original */
}
/* We ideally should rebuild simple dropdowns too if we force hide .sub-menu, 
   or allow .sub-menu to show for simple dropdowns. 
   Let's create a simple JS re-builder for simple dropdowns or just use CSS override. */

/* Allow simple dropdowns to be shown if they are NOT inside a mega menu */
.tibi-mega-menu-wrapper .primary-menu-container > ul > li.has-simple-dropdown:hover > ul.sub-menu {
    display: block !important;
    position: absolute;
    left: 0;
    top: 100%;
    background: #fff;
    min-width: 220px;
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
    border-radius: 8px;
    padding: 1rem 0;
    opacity: 1;
    visibility: visible;
}

/* 8. Mobile Menu Off-Canvas Override - Moved to style.css for consistency */
/* 
.mobile-menu {
    ...
}
...
*/

/* Keep desktop mega menu rules from hiding mobile submenus. */
.mobile-menu-content .sub-menu {
    position: static;
    top: auto;
    left: auto;
    min-width: 0;
    padding: 0;
    border-radius: 0;
    box-shadow: none;
    transform: none;
    transition: none;
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    z-index: auto;
}

.mobile-menu-content li:not(.is-expanded) > .sub-menu {
    display: none !important;
}

.mobile-menu-content li.is-expanded > .sub-menu {
    display: block !important;
}

/* ==========================================================================
   bt-cta Responsive (shared across vet, banhos, bookings pages)
   ========================================================================== */
@media (max-width: 992px) {
    .bt-cta-card {
        flex-direction: column;
        text-align: center;
        padding: 2.5rem 2rem;
        gap: 2rem;
    }

    .bt-cta-text {
        max-width: 100%;
    }

    .bt-cta-actions {
        flex-direction: column;
        width: 100%;
    }

    .bt-cta-actions .btn {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .bt-cta {
        padding: 3rem 0;
    }

    .bt-cta-card {
        padding: 2rem 1.25rem;
        border-radius: var(--radius);
    }

    .bt-cta-title {
        font-size: 1.5rem;
    }
}
