/* =========================================
   Instagram Slider Widget - Frontend Styles
   ========================================= */

/* --- Wrapper --- */
.isw-wrapper {
    position: relative;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.isw-wrapper * {
    box-sizing: border-box;
}

.isw-boxed .isw-slider-inner {
    margin: 0 auto;
}

.isw-full .isw-slider-inner {
    width: 100%;
}

.isw-full .isw-slider-container,
.isw-full .isw-swiper {
    width: 100%;
}

/* --- Heading --- */
.isw-heading-wrap {
    margin-bottom: 30px;
}

.isw-heading {
    margin: 0;
    padding: 0;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

/* --- Slider Container --- */
.isw-slider-inner {
    position: relative;
}

.isw-slider-container {
    position: relative;
    overflow: visible;
}

.isw-swiper {
    overflow: hidden;
    position: relative;
}

/* =========================================
   SLIDE CARD
   ========================================= */

.isw-slide {
    height: auto;
}

.isw-slide-inner {
    display: block;
    position: relative;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    width: 100%;
    background: #f0f0f0;
}

/* Aspect Ratios */
.isw-ratio-1-1  { padding-bottom: 100%;    height: 0; }
.isw-ratio-4-5  { padding-bottom: 125%;    height: 0; }
.isw-ratio-9-16 { padding-bottom: 177.78%; height: 0; }
.isw-ratio-16-9 { padding-bottom: 56.25%;  height: 0; }
.isw-ratio-auto { height: 400px; padding-bottom: 0; }

.isw-slide-img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.4s ease;
}

/* For auto ratio */
.isw-ratio-auto .isw-slide-img {
    position: absolute;
}

.isw-slide-placeholder {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: linear-gradient(135deg, #e0e0e0 0%, #cccccc 100%);
}

/* Scale hover */
.isw-scale-hover .isw-slide-inner:hover .isw-slide-img {
    transform: scale(1.07);
}

/* =========================================
   OVERLAY
   ========================================= */

.isw-slide-overlay {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    background: rgba(0, 0, 0, 0.5);
    z-index: 2;
}

.isw-slide-inner:hover .isw-slide-overlay {
    opacity: 1;
}

.isw-slide-stats {
    display: flex;
    align-items: center;
    gap: 16px;
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 12px;
}

.isw-stat-likes,
.isw-stat-views {
    display: flex;
    align-items: center;
    gap: 5px;
}

.isw-stat-likes svg,
.isw-stat-views svg {
    fill: #fff;
}

.isw-overlay-icon {
    color: #fff;
    opacity: 0.8;
}

/* =========================================
   BADGE
   ========================================= */

.isw-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 3;
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    border-radius: 20px;
    line-height: 1;
    pointer-events: none;
}

.isw-badge svg {
    flex-shrink: 0;
}

/* =========================================
   ARROW NAVIGATION
   ========================================= */

.isw-arrow {
    position: absolute;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    background: #000;
    border: none;
    cursor: pointer;
    transition: background-color 0.25s ease, color 0.25s ease, transform 0.2s ease, box-shadow 0.25s ease;
    border-radius: 50%;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15);
    padding: 0;
    outline: none;
    flex-shrink: 0;
}

.isw-arrow:hover {
    background: #000;
    transform: scale(1.05);
}

.isw-arrow svg {
    width: 18px;
    height: 18px;
    stroke: #fff;
    transition: stroke 0.25s ease;
    display: block;
}

.isw-arrow:hover svg {
    stroke: #fff;
}

.isw-arrow.swiper-button-disabled {
    opacity: 0.4;
    cursor: not-allowed;
    pointer-events: none;
}

/* Arrow Styles */
.isw-style-square {
    border-radius: 6px !important;
}

.isw-style-minimal {
    background: transparent !important;
    box-shadow: none !important;
}

.isw-style-minimal:hover {
    background: rgba(0,0,0,0.1) !important;
}

/* --- Position: Outside (default, overlaps edges) --- */
.isw-nav-outside {
    padding: 0 22px;
}

.isw-nav-outside .isw-btn-prev,
.isw-nav-outside .isw-btn-next {
    top: 50%;
    transform: translateY(-50%);
}

.isw-nav-outside .isw-btn-prev {
    left: -22px;
}

.isw-nav-outside .isw-btn-next {
    right: -22px;
}

.isw-nav-outside .isw-btn-prev:hover,
.isw-nav-outside .isw-btn-next:hover {
    transform: translateY(-50%) scale(1.05);
}

/* --- Position: Inside --- */
.isw-nav-inside .isw-btn-prev,
.isw-nav-inside .isw-btn-next {
    top: 50%;
    transform: translateY(-50%);
}

.isw-nav-inside .isw-btn-prev {
    left: 15px;
}

.isw-nav-inside .isw-btn-next {
    right: 15px;
}

.isw-nav-inside .isw-btn-prev:hover,
.isw-nav-inside .isw-btn-next:hover {
    transform: translateY(-50%) scale(1.05);
}

/* --- Position: Bottom --- */
.isw-nav-bottom .isw-btn-prev,
.isw-nav-bottom .isw-btn-next {
    position: static;
    transform: none;
}

.isw-nav-bottom .isw-btn-prev:hover,
.isw-nav-bottom .isw-btn-next:hover {
    transform: scale(1.05);
}

.isw-nav-bottom {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-top: 20px;
}

/* =========================================
   PAGINATION / DOTS
   ========================================= */

.isw-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: 24px;
    flex-wrap: wrap;
}

.isw-pagination .swiper-pagination-bullet {
    width: 8px;
    height: 8px;
    background: #ccc;
    border-radius: 50%;
    display: inline-block;
    cursor: pointer;
    transition: background 0.2s, transform 0.2s;
    opacity: 1;
}

.isw-pagination .swiper-pagination-bullet-active {
    background: #1a1a1a;
    transform: scale(1.3);
}

/* Fraction */
.isw-pagination.isw-dots-fraction {
    font-size: 14px;
    color: #666;
}

/* =========================================
   API LOADING STATE
   ========================================= */

.isw-api-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 200px;
    width: 100%;
}

.isw-loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #f0f0f0;
    border-top-color: #1a1a1a;
    border-radius: 50%;
    animation: isw-spin 0.8s linear infinite;
}

@keyframes isw-spin {
    to { transform: rotate(360deg); }
}

/* =========================================
   MOBILE RESPONSIVE
   ========================================= */

@media (max-width: 1024px) {
    .isw-nav-outside {
        padding: 0 16px;
    }
    .isw-nav-outside .isw-btn-prev { left: -16px; }
    .isw-nav-outside .isw-btn-next { right: -16px; }
}

@media (max-width: 767px) {
    .isw-arrow {
        width: 36px;
        height: 36px;
    }
    .isw-arrow svg {
        width: 14px;
        height: 14px;
    }
    .isw-nav-outside {
        padding: 0 10px;
    }
    .isw-nav-outside .isw-btn-prev { left: -10px; }
    .isw-nav-outside .isw-btn-next { right: -10px; }
    .isw-heading-wrap {
        margin-bottom: 20px;
    }
    .isw-slide-stats {
        font-size: 12px;
        gap: 10px;
    }
    .isw-badge {
        font-size: 9px;
        padding: 3px 7px;
    }
}

/* Hide arrows on mobile when option enabled */
.isw-hide-arrows-mobile .isw-btn-prev,
.isw-hide-arrows-mobile .isw-btn-next {
    display: none;
}

@media (min-width: 768px) {
    .isw-hide-arrows-mobile .isw-btn-prev,
    .isw-hide-arrows-mobile .isw-btn-next {
        display: flex;
    }
}

/* =========================================
   SWIPER OVERRIDES
   ========================================= */

.isw-swiper .swiper-wrapper {
    align-items: stretch;
}

.isw-swiper .swiper-slide {
    height: auto;
}

/* Progress bar pagination */
.isw-dots-bars .swiper-pagination-progressbar {
    height: 3px;
    background: #eee;
    border-radius: 2px;
    position: relative;
    margin-top: 16px;
}

.isw-dots-bars .swiper-pagination-progressbar-fill {
    background: #1a1a1a;
    border-radius: 2px;
}
