/**
 * Just Stylin Salon WordPress theme layout helpers.
 *
 * The original mirrored site already contains its own header, footer, and
 * navigation. The WordPress header/footer are kept in the DOM for theme
 * structure and accessibility but are visually hidden by default.
 */

/* WordPress header/footer are hidden visually but kept for accessibility. */
.juststylin-wp-header,
.juststylin-wp-footer {
    display: none;
}

/* Screen-reader text helper. */
.screen-reader-text {
    border: 0;
    clip: rect(1px, 1px, 1px, 1px);
    clip-path: inset(50%);
    height: 1px;
    margin: -1px;
    overflow: hidden;
    padding: 0;
    position: absolute;
    width: 1px;
    word-wrap: normal !important;
}

/* Container for the imported static content. */
.juststylin-static-content {
    margin: 0;
    padding: 0;
}

/* Ensure the static content wrapper fills the viewport. */
.site-content {
    margin: 0;
    padding: 0;
}

/* Gravity Forms submit button visibility and styling.
 * The Duda CSS does not target the GF submit input, so it can appear
 * missing or unstyled. These rules make it visible and consistent. */
.gform_footer,
.gform_footer.top_label {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    margin-top: 1em;
}

.gform_button,
.gform_button.button,
input[type="submit"].gform_button {
    display: inline-block !important;
    visibility: visible !important;
    opacity: 1 !important;
    background-color: #32373c;
    color: #fff;
    border: 1px solid #32373c;
    padding: 0.75em 1.5em;
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.2;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    border-radius: 4px;
    transition: background-color 0.2s ease, border-color 0.2s ease;
}

.gform_button:hover,
.gform_button.button:hover,
input[type="submit"].gform_button:hover {
    background-color: #1d2126;
    border-color: #1d2126;
}

/* Ensure Gravity Forms fields are visible and stacked on mobile. */
.gform_fields {
    display: flex;
    flex-wrap: wrap;
    gap: 1em;
}

.gform_fields .gfield {
    flex: 1 1 100%;
    box-sizing: border-box;
}

/* Modern Gravity Forms uses CSS grid for the field container. Force a single
 * column so fields stack vertically in the imported Duda narrow columns. */
.gform_fields {
    grid-template-columns: 1fr !important;
}

/* Force all Gravity Forms fields to stack vertically in the imported Duda
 * narrow columns so labels and inputs are readable. */
.gform_fields .gfield--width-half,
.gform_fields .gf_left_half,
.gform_fields .gf_right_half,
.gform_fields .gfield--width-full {
    flex: 1 1 100% !important;
    width: 100% !important;
    max-width: 100% !important;
}

/* Support Gravity Forms legacy half-width classes. */
.gf_left_half,
.gf_right_half {
    box-sizing: border-box;
    width: 100% !important;
    max-width: 100% !important;
    float: none !important;
    clear: both !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
}

/* FAQ accordion replacement styles. */
.juststylin-faq-accordion {
    max-width: 800px;
    margin: 0 auto;
    font-family: inherit;
}

.juststylin-faq-item {
    border-bottom: 1px solid #e3e3e3;
    margin-bottom: 8px;
}

.juststylin-faq-question {
    width: 100%;
    background: transparent;
    border: none;
    padding: 16px;
    text-align: left;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: inherit;
}

.juststylin-faq-question::after {
    content: '+';
    font-size: 1.5rem;
    line-height: 1;
    transition: transform 0.3s ease;
}

.juststylin-faq-item.active .juststylin-faq-question::after {
    transform: rotate(45deg);
}

.juststylin-faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
    padding: 0 16px;
}

.juststylin-faq-item.active .juststylin-faq-answer {
    max-height: 500px;
    padding: 0 16px 16px;
}

.juststylin-faq-answer p {
    margin: 0 0 10px;
}

/* Imported Duda icons are rendered as raw SVGs without their original sizing rules.
 * Cap them so they do not overwhelm the layout. */
.elementor-widget-html .svg,
.elementor-widget-html .graphicWidget svg,
.elementor-widget-html .graphicWidget img,
.elementor-widget-html svg[data-icon-name],
.elementor-widget-html img[data-icon-name] {
    max-width: 80px;
    max-height: 80px;
    width: auto;
    height: auto;
    display: inline-block;
}

/* Social icons already have their own size rules; do not shrink them. */
.elementor-widget-html .socialHubIcon svg,
.elementor-widget-html .socialHubIcon img {
    max-width: none;
    max-height: none;
}

/* Small decorative image icons imported from Duda (e.g. scissors.gif, Stylin-68h.png). */
.elementor-widget-image img[src*="scissors.gif"],
.elementor-widget-image img[src*="Stylin-68h.png"],
.elementor-widget-image img[src*="hair-loss-"][src$=".svg"],
.elementor-widget-image img[src*="reviews"][src$=".svg"],
.elementor-widget-image img[src*="salon"][src$=".svg"],
.elementor-widget-image img[src*="spa"][src$=".svg"],
.elementor-widget-image img[src*="woman-hair"][src$=".svg"] {
    max-width: 80px;
    max-height: 80px;
    width: auto;
    height: auto;
}

/* Duda custom widgets that show a rotating icon (e.g. extensions page). */
.dmCustomWidget img.spin,
.elementor-widget-html img.spin,
.elementor-widget-html .lottie img,
.elementor-widget-html .custom_widget img {
    max-width: 200px;
    max-height: 200px;
    width: auto;
    height: auto;
}

@keyframes juststylin-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.dmCustomWidget img.spin,
.elementor-widget-html img.spin {
    animation: juststylin-spin 10s linear infinite;
}

/* Gravity Forms fields in the imported Duda layout are often squeezed by
 * the original narrow column CSS. Make them comfortably sized. */
.gform_wrapper .gfield input,
.gform_wrapper .gfield textarea,
.gform_wrapper .gfield select {
    width: 100% !important;
    min-height: 44px;
    padding: 10px 12px;
    font-size: 1rem;
    box-sizing: border-box;
}

.gform_wrapper .gfield {
    margin-bottom: 1em;
}

.gform_wrapper .ginput_complex label,
.gform_wrapper .gfield_label,
.gform_wrapper .gfield_description {
    font-size: 0.95rem;
}

.gform_wrapper .gform_footer {
    margin-top: 1em;
}

/* Force Gravity Forms complex fields (name, phone/email pairs) to stack
 * vertically inside the narrow imported Duda columns so they remain usable. */
.gform_wrapper .ginput_complex,
.gform_wrapper .gf_left_half,
.gform_wrapper .gf_right_half,
.gform_wrapper .gfield--width-half,
.gform_wrapper .gfield--width-full,
.gform_wrapper .gfield.gfield--width-half,
.gform_wrapper .gfield.gf_left_half,
.gform_wrapper .gfield.gf_right_half {
    width: 100% !important;
    max-width: 100% !important;
    float: none !important;
    clear: both !important;
    padding: 0 !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    display: block !important;
}

.gform_wrapper .ginput_complex span,
.gform_wrapper .name_first,
.gform_wrapper .name_last,
.gform_wrapper .ginput_left,
.gform_wrapper .ginput_right,
.gform_wrapper .ginput_complex .name_first,
.gform_wrapper .ginput_complex .name_last {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    padding: 0 !important;
    margin: 0 0 0.5em !important;
}

.gform_wrapper .gfield_label {
    display: block;
    margin-bottom: 0.3em;
}

.gform_wrapper .gfield_description {
    font-size: 0.85em;
    color: #666;
}

.gform_wrapper .gfield_required {
    color: #c00;
}

/* Columns that contain a Gravity Form are often too narrow in imported Duda
 * layouts. Give them more breathing room so the fields are usable. */
.elementor-column:has(.gform_wrapper) {
    width: 50% !important;
    min-width: 320px !important;
}

@media (max-width: 767px) {
    .elementor-column:has(.gform_wrapper) {
        width: 100% !important;
        min-width: auto !important;
    }
}

/* Custom juststylin slider that lives inside an HTML widget. */
.juststylin-slider {
    width: 100%;
    height: 410px;
    position: relative;
    overflow: hidden;
    background: #eee;
}

.juststylin-slider__track {
    position: relative;
    width: 100%;
    height: 100%;
}

.juststylin-slider__slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 0.8s ease-in-out;
    z-index: 1;
}

.juststylin-slider__slide--active {
    opacity: 1;
    z-index: 2;
}

.juststylin-slider__slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.juststylin-slider__pagination {
    position: absolute;
    bottom: 15px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
    z-index: 3;
}

.juststylin-slider__dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 2px solid #fff;
    background: rgba(255,255,255,0.5);
    cursor: pointer;
    padding: 0;
}

.juststylin-slider__dot--active {
    background: #fff;
}

@media (max-width: 767px) {
    .juststylin-slider { height: 300px; }
}

/* Duda marquee/scrolling widget needs visible text. The original Duda layout
 * likely had it on a dark strip; ensure it is readable on the imported page. */
marquee.scrolling,
.scrolling {
    display: block;
    width: 100%;
    background: #f5f5f5;
    color: #222;
    padding: 12px 0;
    font-size: 1rem;
    font-weight: 500;
    white-space: nowrap;
}

/* Duda imageSlider widget fallback: show only the first slide when the
 * original flexslider runtime is not available. */
.dmImageSlider .slides li {
    display: none;
    position: relative;
}

.dmImageSlider .slides li:first-child {
    display: block;
}

.dmImageSlider .slides img {
    width: 100%;
    height: auto;
    display: block;
}

/* Imported Duda before/after sliders need the handle to be visible. */
.baf__container {
    position: relative;
    overflow: hidden;
    cursor: pointer;
    user-select: none;
    -webkit-user-select: none;
}

.baf__container img {
    display: block;
    width: 100%;
    max-width: 100%;
    height: auto;
}

.baf__after {
    position: absolute;
    top: 0;
    left: 0;
    width: 50%;
    height: 100%;
    overflow: hidden;
}

.baf__after img {
    height: 100%;
    max-width: none;
    object-fit: cover;
}

.baf__handle {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    width: 4px;
    transform: translateX(-50%);
    background: rgba(255, 255, 255, 0.8);
    border-left: 2px solid #fff;
    border-right: 2px solid #fff;
    cursor: ew-resize;
    z-index: 10;
}

.baf__arrow {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    margin-top: -6px;
    border-top: 6px solid transparent;
    border-bottom: 6px solid transparent;
}

.baf__arrow:not(.baf__right) {
    margin-left: -14px;
    border-right: 8px solid #fff;
}

.baf__arrow.baf__right {
    margin-left: 6px;
    border-left: 8px solid #fff;
}

.baf__labels-wrapper {
    position: absolute;
    bottom: 10px;
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-between;
    padding: 0 10px;
    pointer-events: none;
}

.baf__title {
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    padding: 4px 8px;
    font-size: 12px;
    border-radius: 3px;
}
