#frameslide-container,
.frameslide-container {
    width: 100%;
    min-width: 400px;
    position: relative;
    user-select: none;
    flex-shrink: 0;
}

.frameslide-wrapper {
    margin: 0;
    padding: 0;
    width: 100%;
    min-width: 400px;
    flex-shrink: 0;
    flex-grow: 0;
    display: flex;
    flex-direction: column;
    align-items: stretch;
}

.elementor-frameslide-wrapper {
    /* Elementor widget specific styles */
    box-sizing: border-box;
}

.frame-container {
    position: relative;
    width: 100%;
    /* This padding-top trick maintains the aspect ratio. */
   padding-top: 80%; /* 4:5 Aspect Ratio (5 / 4 = 1.25) */
    display: flex;
    justify-content: center;
    align-items: center;
}

.slider-frame,
.slider-photo,
.frameslide-container .slider-frame,
.frameslide-container .slider-photo {
    position: absolute;
    /* Make the photo a square, 90% of the container's width */
    width: 90%;
    aspect-ratio: 1 / 1;
    /* Center the square photo inside the container */
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    /* Crop the image to fill the square area */
    object-fit: cover;
    z-index: 5;
    transition: opacity 0.4s ease-in-out;
}

.slider-frame,
.frameslide-container .slider-frame {
    z-index: 10;
}

.slider-photo,
.frameslide-container .slider-photo {
    z-index: 5;
    /* Add padding to keep the photo inside the frame's transparent area */
    padding: 5%; /* Adjust as needed */
    box-sizing: border-box;
}

.slider-navigation {
    text-align: center;
    margin: 0;
    padding: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 80px;
}

/* Default margin-top for navigation (can be overridden by Elementor widget) */
.elementor-widget-frameslide .slider-navigation {
    margin-top: 10px;
}

.slider-arrow {
    position: relative;
    z-index: 20;
    cursor: pointer;
    width: 30px;
    height: 30px;
    background-color: transparent !important;
    border: none;
    padding: 0;
    flex-shrink: 0;
}

.slider-arrow:hover {
    background-color: transparent !important; /* Ensure background stays transparent on hover */
}

.slider-arrow::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: black;
    clip-path: polygon(40% 0%, 80% 50%, 40% 100%, 0% 100%, 40% 50%, 0% 0%); /* Triangle shape */
    transition: background-color 0.2s ease;
}

.slider-arrow:hover::before {
    background-color: #555; /* Dark grey on hover */
}

.slider-arrow.prev::before {
    transform: rotate(180deg);
}

/* Responsive adjustments for mobile */
@media (max-width: 768px) {
    .slider-arrow {
        width: 40px;
        height: 40px;
    }
}

/* Thumbnail Carousel Styles */
.frameslide-thumbnails-container {
    width: 100%;
    overflow: hidden;
    margin: 0;
    padding: 0;
}

.elementor-frameslide-thumbnails-wrapper {
    box-sizing: border-box;
}

.thumbnail-track {
    display: flex;
    justify-content: flex-start;
    flex-wrap: wrap; /* Allow thumbnails to wrap to multiple rows */
    margin: 0;
    padding: 0;
}

.thumbnail-item {
    flex: 0 0 calc(100% / 6); /* Responsive width for 6 items, no margin in calculation */
    /* max-width removed - will use WordPress medium size dimensions */
    aspect-ratio: 1 / 1; /* Maintain square aspect ratio */
    height: auto;  /* Height will be automatic based on aspect ratio */
    margin: 0; /* No margin */
    cursor: pointer;
    border: 3px solid transparent;
    box-sizing: border-box;
    overflow: hidden;
    display: block; /* Always visible for Elementor widgets */
    opacity: 0.9;
    transition: opacity 0.3s ease;
}

.thumbnail-item:hover {
    opacity: 1;
}

.thumbnail-item.active {
    border-color: #0073aa; /* WordPress blue border for active thumbnail */
    opacity: 1;
}

.thumbnail-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
