/* --- Responsive Grid Adjustment (Larger Images, Fewer Per Row) --- */
.detail-images .repeat-element__repeated-elements {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)) !important; 
    gap: 1rem;
    justify-items: center;
}

/* 1. Define the square shape on the immediate grid item */
.detail-images .repeat-element__repeated-elements > div {
  width: 100%;
  aspect-ratio: 1 / 1;
  overflow: hidden;
}

/* 2. Force 100% height through all wrapper layers (to prevent gaps) */
.detail-images .element__wrapper,
.detail-images .element__inner-wrapper,
.detail-images .image-element {
  width: 100%;
  height: 100%;
}

/* 3. Baserow image wrapper: Apply Border Radius and Overflow here */
.detail-images .ab-image {
  width: 100%;
  height: 100%;
  overflow: hidden; /* CRITICAL: Clips the scaled corners */
  border-radius: 0.5rem; /* CRITICAL: Maintains the corner shape */
}

/* 4. The Image itself: Fill and Hover */
.detail-images .ab-image__img {
  width: 100%;
  height: 100%; 
  object-fit: cover; 
  
  /* Gap elimination */
  display: block; 
  vertical-align: top;
  
  /* Hover and Shadow settings */
  box-shadow: 0 4px 8px rgba(0,0,0,0.15);
  cursor: zoom-in; /* Changed to zoom-in to match previous code */
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

/* 5. Hover Effect: Image scales within the rounded container */
.detail-images .ab-image__img:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 12px rgba(0,0,0,0.25);
}

/* === Responsive behavior === */
@media (min-width: 768px) {
  .detail-images .repeat-element__repeated-elements {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  }
}

@media (min-width: 1024px) {
  .detail-images .repeat-element__repeated-elements {
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  }
}


/* Modal overlay (shared globally, but invisible until used) */
#imageModal {
  display: none;
  position: fixed;
  z-index: 9999;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0,0,0,0.85);
  justify-content: center;
  align-items: center;
}

/* Enlarged image */
#imageModal img {
  max-width: 90%;
  max-height: 90%;
  border-radius: 0.5rem;
  box-shadow: 0 0 20px rgba(0,0,0,0.6);
  transition: transform 0.25s ease;
}

#imageModal img:hover {
  transform: scale(1.02);
}

#imageModal.show {
  display: flex;
}

/* Navigation arrows */
.modal-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  font-size: 3rem;
  color: white;
  cursor: pointer;
  user-select: none;
  opacity: 0.6;
  transition: opacity 0.2s;
}

.modal-arrow:hover {
  opacity: 1;
}

.modal-arrow.left {
  left: 40px;
}

.modal-arrow.right {
  right: 40px;
}

/* ----------------------------------------------------------------------
   --- STABLE NEON GLOW (v7.2 - Builder Cleanup Fix) ---
   This version is the same as v7, but adds dedicated, high-specificity 
   rules to kill Baserow's default padding, margin, and borders 
   set in the visual app builder.
   ---------------------------------------------------------------------- 
*/

/* --- BUILDER CLEANUP (Targeted Overrides to remove App Builder styles) --- */

/* 1. Kill all padding and margin on the main card container */
.search-section .repeat-element__repeated-elements > div > .element__wrapper {
    margin: 0 !important;
    padding: 0 !important;
}

/* 2. Kill all padding and margin on the image/content inner wrapper */
.search-section .repeat-element__repeated-elements > div > .element__wrapper > .element__inner-wrapper {
    margin: 0 !important;
    padding: 0 !important;
}

/* 3. Kill the builder's border CSS variables */
.search-section .repeat-element__repeated-elements > div > .element__wrapper {
    --element-border-top: none !important;
    --element-border-bottom: none !important;
    --element-border-left: none !important;
    --element-border-right: none !important;
}

/* --- 1. OVERALL CARD STRUCTURE & HEIGHT (Visual Styles) --- */
.search-section .repeat-element__repeated-elements > div > .element__wrapper {
    height: 100% !important; 
    overflow: hidden; 
    display: flex;
    flex-direction: column; 
    cursor: pointer;
    position: relative !important; 
    z-index: 1 !important;
    
    /* Base state: solid dark background and border */
    background-color: #013539;
    border: 3px solid #013539 !important; /* Re-apply our custom border */
    border-radius: 20px;
    padding: 20px; !important
    /* Add transitions */
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

/* --- 2. NEW, RELIABLE HOVER EFFECT --- */
.search-section .repeat-element__repeated-elements > div > .element__wrapper:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: 0px 0px 30px 1px rgba(153, 189, 37, .30); /* The Glow */
    z-index: 10 !important; 
    
    border-color: #99bd25 !important; /* The Neon Border */
}

/* --- 3. IMAGE SECTION SIZING (Fixed height, prevents shrinking) --- */
.search-section .image-element.element {
    height: 250px !important; 
    flex-shrink: 0; /* Prevents this element from shrinking */
    
    width: 100% !important;
    min-width: 100% !important; 
    overflow: hidden;
    margin: 0 !important;
    padding: 0 !important;
    border-radius: 10px !important; /* Round all corners */
}

/* --- 4. CONTENT AREA SIZING (Fills remaining space) --- */
/* This is the wrapper for all the text/button content */
.search-section .repeat-element__repeated-elements > div > .element__wrapper > .element__inner-wrapper > .element__wrapper:nth-child(2) {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    min-height: 0; /* Prevents overflow issues in flex columns */
    margin: 0 !important;
    padding: 0 !important;
    overflow-y: auto !important;
}

/* --- 5. IMAGE FILL & ALIGNMENT --- */
.search-section .image-element.element .ab-image,
.search-section .image-element.element .ab-image__img {
    width: 100% !important;
    height: 250px !important; 
    object-fit: cover !important; 
    object-position: top !important; 
    display: block;
    border-radius: 10px !important; 
}

.search-section .element__inner-wrapper,
.search-section .element__inner-wrapper > .element__wrapper {
    width: 100%;
    min-height: 0; 
}


/* --- 6. CLICKABLE LINK FIX (Your Stable Code) --- */
.search-section .card-link {
    margin: 0 !important; padding: 0 !important; height: 0 !important;
    position: absolute !important;
    top: 0 !important; right: 0 !important; bottom: 0 !important; left: 0 !important;
    z-index: 5 !important; 
    cursor: pointer !important;
    background: transparent !important;
}
.search-section .card-link.element {
    height: 100% !important; width: 100% !important; padding: 0 !important;
    margin: 0 !important; overflow: visible !important;
}
.search-section .card-link a {
    width: 100% !important; height: 100% !important; display: block !important;
    color: transparent !important; text-decoration: none !important;
    font-size: 0 !important; line-height: 0 !important; background: transparent !important;
}
.search-section .repeat-element__repeated-elements > div {
    overflow: visible !important;
}


/* --- 7. TEXT & BUTTON LAYOUT (Now inside the flex-grow content area) --- */
/* We target the wrappers *inside* the new flex-grow container */
.search-section .repeat-element__repeated-elements > div > .element__wrapper > .element__inner-wrapper > .element__wrapper:nth-child(2) > .element__wrapper {
    width: 100% !important; 
    padding: 10px 15px !important; 
    box-sizing: border-box !important;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

/* Doll Name Link (wrapper 1 *inside* content area): Left Aligned */
.search-section .repeat-element__repeated-elements > div > .element__wrapper > .element__inner-wrapper > .element__wrapper:nth-child(2) > .element__wrapper:nth-child(1) {
    align-items: flex-start; 
    text-align: left !important;
}

/* Company Name Link (wrapper 2 *inside* content area): Centered and ABSORBS SPACE */
.search-section .repeat-element__repeated-elements > div > .element__wrapper > .element__inner-wrapper > .element__wrapper:nth-child(2) > .element__wrapper:nth-child(2) {
    text-align: center !important; 
    flex-grow: 1; /* Pushes button to the bottom */
}

/* Size Button (wrapper 3 *inside* content area): Centered */
.search-section .repeat-element__repeated-elements > div > .element__wrapper > .element__inner-wrapper > .element__wrapper:nth-child(2) > .element__wrapper:nth-child(3) {
    text-align: center !important;
}

/* 1. Primary Links and Titles (#99bd25) */
.filters__none-title, 
.button-text__label, 
.button-text__icon {
    color: #99bd25 !important;
}

/* 2. Secondary Labels and Descriptions (#a6bc71) */
.filters__none-description,
.filters__operator-where {
    color: #a6bc71 !important;
}

/* 3. Interaction (Optional) */
.button-text:hover .button-text__label {
    filter: brightness(1.2); /* Makes the lime green slightly glow on hover */
}

/* Styling the "all disabled" text label */
.switch__label {
    color: #a6bc71 !important;
}

/* Styling the switch track (the background of the toggle) */
.switch.switch--color-green {
    background-color: rgba(166, 188, 113, 0.2) !important; /* Muted sage at 20% opacity */
    border: 1px solid #a6bc71;
}

/* Styling the switch knob (the part that moves) */
.switch.switch--color-green .switch__button {
    background-color: #99bd25 !important; /* Your bright link color */
}

/* If the switch is 'active' or 'on', you might want to brighten the track */
.switch.switch--color-green.active {
    background-color: #99bd25 !important;
}

.filters__group-item {
    background-color: #1e4856 !important;
    border: 1px solid #013539 !important;
    border-radius: 4px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 10px 6px 0;
}


.filters__operator-text {
    margin-left: 12px;
    color: #a6bc71 !important;
}

/* 1. The Empty State Text */
.sortings__none-title {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 10px;
    color: #99bd25 !important; /* Using your brighter green for the title */
}

.sortings__none-description {
    font-size: 13px;
    color: #a6bc71 !important; /* Sage for the description */
}

/* 2. The Remove/Trash/Cancel buttons */
.sortings__remove {
    align-items: center;
    color: #a6bc71 !important; /* Changed from #070810 */
    display: flex;
    font-size: 20px;
    gap: 0;
    justify-content: center;
    width: 22px;
}

/* Targeting the "Sort by" label */
.sortings__description {
    color: #a6bc71 !important;
    font-size: 13px; /* Matches the other descriptions */
    font-weight: 500;
}

/* 3. The Sorting Order Labels/Items */
.sortings__order-item {
    align-items: center;
    border-radius: 4px;
    color: #a6bc71 !important; /* Changed from #070810 */
    border: 1px solid rgba(166, 188, 113, 0.3); /* Optional: subtle border to see the box */
    display: flex;
    flex-wrap: nowrap;
    font-size: 14px;
    font-weight: 600;
    gap: 5px;
    height: 32px;
    justify-content: center;
    width: 80px;
}

/* 4. Targeting the specific icons directly */
.iconoir-cancel, 
.iconoir-arrow-right {
    color: #a6bc71 !important;
}

/* Hover effect for the cancel icon to make it feel like a button */
.sortings__remove:hover .iconoir-cancel {
    color: #99bd25 !important; /* Pops brighter on hover */
}

/* Styling the active sort button (e.g., Z -> A) */
.sortings__order-item.active {
    background-color: #99bd25 !important; /* Bright green background */
    color: #013539 !important;            /* Dark blue text */
    border: none !important;              /* Remove any default borders */
}

/* Ensuring the icon inside the active button also turns dark blue */
.sortings__order-item.active .iconoir-arrow-right {
    color: #013539 !important;
}

/* Optional: Slight hover effect when active to show it's still clickable */
.sortings__order-item.active:hover {
    background-color: #a6bc71 !important; /* Muted sage on hover */
    filter: brightness(1.1);
    cursor: pointer;
}

/* Ensure the icon stays dark blue during the hover too */
.sortings__order-item.active:hover .iconoir-arrow-right {
    color: #013539 !important;
}

/* Target the inactive sorting item hover state */
.sortings__order-item:not(.active):hover {
    background-color: #a6bc71 !important; /* Sage background on hover */
    color: #013539 !important;            /* Dark blue text on hover */
    cursor: pointer;
    transition: background-color 0.2s ease;
}

/* Ensure icons inside the inactive hover also turn dark blue */
.sortings__order-item:not(.active):hover i {
    color: #013539 !important;
}

/* Push the Baserow context/filter menus to the very front */
.context {
    z-index: 2000 !important;
}

/* 1. Change the color and height */
.nuxt-loading-indicator {
    /* Use your Neon Green (#99bd25) */
    background: #99bd25 !important; 
    
    /* Or a glowy gradient to match your search cards */
    background: linear-gradient(to right, #013539, #99bd25) !important;
    
    /* Make it a bit thicker so it's more visible */
    height: 4px !important;
    
    /* Add a neon glow/bloom effect */
    box-shadow: 0 0 10px #99bd25, 0 0 5px rgba(153, 189, 37, 0.5) !important;
}

/* 2. Optional: Make it pulse while loading */
@keyframes pulseGlow {
    0% { opacity: 0.6; }
    50% { opacity: 1; }
    100% { opacity: 0.6; }
}

.nuxt-loading-indicator {
    animation: pulseGlow 1.5s infinite ease-in-out;
}

/* Target the footer containing the 'Show more' button only within the features-list table */
.features-list .table-element__footer {
    display: none !important;
}

@media screen and (max-width: 600px) {
    /* 1. Reset the columns to allow full width */
    .column-element__column {
        --column-width: 100% !important;
        width: 100% !important;
        padding-left: 0 !important;
        padding-right: 0 !important;
    }

    /* 2. Fix the menu container */
    .menu-element__container--horizontal {
        display: flex !important;
        flex-wrap: wrap !important; /* This stops the 'cut off' by moving items to a new line */
        justify-content: center !important;
        width: 100% !important;
        padding: 0 0px !important;
        box-sizing: border-box !important;
        gap: 0px !important; /* Removes the modern CSS gap if it's active */
    }

    /* 3. Give each link room to breathe */
    .menu-element__menu-item-link {
        flex: 0 1 auto !important;
        margin: 5px 5px !important; /* Space between links on mobile */
    }

    /* 4. Optional: Shrink the logo text slightly if it clips */
    .header-txt {
        font-size: 16px !important;
    }
}

/* Shrink the gap between text and arrow */
.menu-element__sub-link-menu-spacer {
    width: 0px !important; /* Adjust this number to get the arrow closer */
    flex-shrink: 0;
}

/* Target the container that holds the text and the arrow */
.menu-element__sub-link-menu--container {
    display: flex !important;
    gap: 1px !important; /* This is the most direct way to control that space */
    justify-content: center !important;
    align-items: center !important;
}

/* Ensure the arrow doesn't have its own extra padding */
.menu-element__sub-link--expanded-icon {
    margin-left: 0 !important;
    font-size: 14px; /* Optional: adjust icon size if it looks too big now */
}

/* This MUST stay in the App Builder's Global CSS box */
@media screen and (max-width: 600px) {
    .homepage-banner {
        height: 80px !important; /* Adjust this to fit your image exactly */
        min-height: 80px !important;
    }
}

@media screen and (max-width: 1024px) {
    /* Target the donate button specifically */
    .donate {
        position: fixed !important;
        bottom: 30px !important; /* Raised slightly so it doesn't hit the bottom edge */
        right: 20px !important;  
        z-index: 10000 !important; /* Maximum priority to stay above the banner and content */
        width: auto !important;
        pointer-events: auto !important; /* Ensures it remains clickable while floating */
    }

    /* Styling the button to look like a floating action button */
    .donate .ab-button {
        box-shadow: 0px 8px 20px rgba(0, 0, 0, 0.4) !important;
        border-radius: 50px !important; /* Makes it a pill shape, common for floating buttons */
        padding: 10px 20px !important;
        background-color: #013539 !important; /* Your dark teal */
        color: #99bd25 !important; /* Your signature lime green */
        border: 2px solid #99bd25 !important;
        display: flex !important;
        align-items: center !important;
        gap: 8px !important;
    }
}

@media screen and (max-width: 600px) {
    /* 1. ROOT CONTAINER: Kill the side-scroll and force screen-width */
    .footer-adver {
        width: 100% !important;
        max-width: 100vw !important;
        overflow-x: hidden !important;
        padding-left: 0 !important;
        padding-right: 0 !important;
        margin: 0 !important;
        display: block !important;
    }

    /* 2. LAYOUT: Force columns to stack vertically */
    .footer-adver .column-element {
        display: flex !important;
        flex-direction: column !important;
        width: 100% !important;
        gap: 0px !important;
    }

    /* 3. COLUMNS: Reset width to 100% and center padding */
    .footer-adver .column-element__column {
        --column-width: 100% !important;
        width: 100% !important;
        max-width: 100% !important;
        padding: 20px !important; /* Balanced breathing room for text/video */
        box-sizing: border-box !important;
    }

    /* 4. VIDEO: Ensure the iframe maintains its shape */
    .footer-adver .iframe-element__iframe {
        width: 100% !important;
        height: auto !important;
        aspect-ratio: 16 / 9 !important;
        display: block !important;
    }

    /* 5. TEXT & HEADERS: Force centering for the second column */
    .footer-adver .ab-heading, 
    .footer-adver .ab-text {
        width: 100% !important;
        margin-left: auto !important;
        margin-right: auto !important;
    }

    /* 6. BUTTON: Specifically center the 'Learn More' button */
    .footer-adver .button-element {
        display: flex !important;
        width: 100% !important;
        padding-top: 15px !important;
    }

    /* 7. SAFETY: Final override for full-bleed horizontal bleed */
    .element__wrapper--full-bleed {
        overflow-x: hidden !important;
        max-width: 100vw !important;
    }
}

@media screen and (max-width: 1024px) {
    /* Target the container and the header inside it */
    .page-top-title, 
    .page-top-title h1,
    .page-top-title .ab-heading {
        /* 1. Size: Slightly larger than an H2 but smaller than the giant desktop H1 */
        font-size: 4rem !important; 
        line-height: 1.1 !important;
        
        /* 2. Alignment: Force Left */
        text-align: left !important;
        display: block !important;
        margin-left: 0 !important;
        margin-right: auto !important;
        
        /* 3. Containment: Prevent the overflow */
        width: 100% !important;
        max-width: 100% !important;
        white-space: normal !important;
        word-wrap: break-word !important;
        
        /* 4. Padding: Ensure it's not hugging the very edge of the glass */
        padding-left: 0px !important; 
        padding-right: 0px !important;
        box-sizing: border-box !important;
    }

    /* Force the parent container to also stop centering children */
    .page-top-title-container,
    .page-top-title.element__wrapper {
        display: block !important;
        text-align: left !important;
        width: 100% !important;
        max-width: 100vw !important;
        overflow-x: hidden !important;
    }
}

@media screen and (max-width: 1024px) {
    /* 1. Make the table container scrollable */
    .doll-sizes {
        width: 100% !important;
        overflow-x: auto !important;
        display: block !important;
        -webkit-overflow-scrolling: touch;
    }

    /* 2. The Swipe Indicator at the TOP */
    .doll-sizes::before {
        content: "← Swipe to see full measurements →";
        display: block;
        text-align: center;
        font-size: 13px;
        font-weight: bold;
        color: #99bd25; /* Your signature lime green */
        padding: 10px 0;
        background-color: rgba(1, 53, 57, 0.05); /* Very faint dark teal background */
        border-radius: 5px;
        margin-bottom: 5px;
    }

    .doll-sizes table {
        min-width: 850px !important; /* Slightly wider to give the 'Notes' column breathing room */
        table-layout: auto !important;
    }

    .doll-sizes .ab-table__cell {
        white-space: normal !important;
        padding: 12px 8px !important;
        font-size: 14px !important;
        vertical-align: top !important;
    }
}