/* OpticWeb Instagram Feed - Main Styles */

.opticwebinstafeed-feed {
    position: relative;
    overflow: visible !important;
}

.opticwebinstafeed-feed.full-width {
    width: 100vw;
    margin-left: calc(-50vw + 50%);
}

.opticwebinstafeed-feed .feed-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1rem;
    padding: 0 5px;
}

.opticwebinstafeed-feed .feed-title.text-left { text-align: left; }
.opticwebinstafeed-feed .feed-title.text-center { text-align: center; }
.opticwebinstafeed-feed .feed-title.text-right { text-align: right; }

/* Feed item base */
.instafeed-item {
    position: relative;
    overflow: visible !important;
    background: transparent;
    z-index: 1;
}

.instafeed-item:hover {
    z-index: 9999 !important;
}

.instafeed-item .item-image-wrapper {
    position: relative;
    display: block;
    width: 100%;
    overflow: visible !important;
    cursor: pointer;
    border-radius: inherit;
}

.instafeed-item .item-image-wrapper img,
.instafeed-item .item-image-wrapper video,
.instafeed-item .item-image-wrapper picture {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    border-radius: inherit;
    overflow: hidden;
    transition: transform 0.4s ease;
}

/* Hover animation effects */
.instafeed-item.hover-zoom .item-image-wrapper:hover img {
    transform: scale(1.08);
}

.instafeed-item.hover-lift {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.instafeed-item.hover-lift:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.15);
}

.instafeed-item.hover-fade .item-image-wrapper:hover img {
    opacity: 0.85;
}

/* Card Shadow Options */
.instafeed-item.shadow-subtle {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.instafeed-item.shadow-elevated {
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

.instafeed-item.shadow-glow {
    box-shadow: 0 0 20px rgba(225, 48, 108, 0.25);
}

/* Overlay on hover */
.instafeed-item .item-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0);
    transition: background 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.instafeed-item .item-image-wrapper:hover .item-overlay {
    background: rgba(0, 0, 0, 0.3);
}

/* Stats overlay */
.instafeed-item .item-stats {
    display: flex;
    gap: 15px;
    opacity: 0;
    transition: opacity 0.3s ease;
    color: #fff;
    font-size: 14px;
    font-weight: 600;
}

.instafeed-item .item-image-wrapper:hover .item-stats {
    opacity: 1;
}

.instafeed-item .item-stats span {
    display: flex;
    align-items: center;
    gap: 4px;
}

.instafeed-item .item-stats svg {
    width: 18px;
    height: 18px;
    fill: #fff;
}

/* Video indicator */
.instafeed-item .video-indicator {
    position: absolute;
    top: 10px;
    right: 10px;
    color: #fff;
    font-size: 24px;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
    pointer-events: none;
}

/* Caption */
.instafeed-item .item-caption {
    padding: 8px 10px;
    font-size: 13px;
    line-height: 1.4;
    color: #333;
    max-height: 60px;
    overflow: hidden;
}

/* Shopping tag markers */
.instafeed-item .product-marker {
    position: absolute;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2px solid #fff;
    transform: translate(-50%, -50%);
    cursor: pointer;
    z-index: 5;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
    transition: transform 0.2s ease;
    opacity: 0;
}

.instafeed-item .item-image-wrapper:hover .product-marker {
    opacity: 1;
}

.instafeed-item .product-marker:hover {
    transform: translate(-50%, -50%) scale(1.15);
    z-index: 100;
}

/* Hover Product Card Tooltip */
.instafeed-item .product-marker-tooltip {
    position: absolute !important;
    width: 250px !important;
    min-width: 250px !important;
    max-width: 250px !important;
    height: auto !important;
    min-height: 56px !important;
    max-height: 70px !important;
    background: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 8px !important;
    padding: 6px 10px !important;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35) !important;
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 8px !important;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease;
    z-index: 9999 !important;
    color: #222222 !important;
    text-align: left !important;
    box-sizing: border-box !important;
    white-space: normal !important;
}

/* Vertical Positioning */
.instafeed-item .product-marker.pos-top .product-marker-tooltip,
.instafeed-item .product-marker:not(.pos-bottom) .product-marker-tooltip {
    bottom: 18px !important;
    top: auto !important;
}

.instafeed-item .product-marker.pos-bottom .product-marker-tooltip {
    top: 18px !important;
    bottom: auto !important;
}

/* Horizontal Smart Alignment (prevents left/right clipping) */
/* Left side marker: align tooltip to left */
.instafeed-item .product-marker.align-left .product-marker-tooltip {
    left: -6px !important;
    right: auto !important;
    transform: translateY(-4px) !important;
}
.instafeed-item .product-marker.align-left.pos-bottom .product-marker-tooltip {
    transform: translateY(4px) !important;
}

/* Right side marker: align tooltip to right */
.instafeed-item .product-marker.align-right .product-marker-tooltip {
    right: -6px !important;
    left: auto !important;
    transform: translateY(-4px) !important;
}
.instafeed-item .product-marker.align-right.pos-bottom .product-marker-tooltip {
    transform: translateY(4px) !important;
}

/* Middle marker: centered */
.instafeed-item .product-marker.align-center .product-marker-tooltip,
.instafeed-item .product-marker:not(.align-left):not(.align-right) .product-marker-tooltip {
    left: 50% !important;
    right: auto !important;
    transform: translateX(-50%) translateY(-4px) !important;
}
.instafeed-item .product-marker.align-center.pos-bottom .product-marker-tooltip,
.instafeed-item .product-marker:not(.align-left):not(.align-right).pos-bottom .product-marker-tooltip {
    transform: translateX(-50%) translateY(4px) !important;
}

/* Invisible Hover Bridge between dot and tooltip */
.instafeed-item .product-marker-tooltip::before {
    content: '' !important;
    position: absolute !important;
    left: -30px !important;
    right: -30px !important;
    height: 24px !important;
    background: transparent !important;
    display: block !important;
}

.instafeed-item .product-marker.pos-top .product-marker-tooltip::before,
.instafeed-item .product-marker:not(.pos-bottom) .product-marker-tooltip::before {
    bottom: -20px !important;
}

.instafeed-item .product-marker.pos-bottom .product-marker-tooltip::before {
    top: -20px !important;
}

/* Active Hover State */
.instafeed-item .product-marker:hover .product-marker-tooltip,
.instafeed-item .product-marker-tooltip:hover {
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
}

.instafeed-item .product-marker.align-left:hover .product-marker-tooltip,
.instafeed-item .product-marker.align-left .product-marker-tooltip:hover,
.instafeed-item .product-marker.align-right:hover .product-marker-tooltip,
.instafeed-item .product-marker.align-right .product-marker-tooltip:hover {
    transform: translateY(0) !important;
}

.instafeed-item .product-marker.align-center:hover .product-marker-tooltip,
.instafeed-item .product-marker.align-center .product-marker-tooltip:hover,
.instafeed-item .product-marker:not(.align-left):not(.align-right):hover .product-marker-tooltip,
.instafeed-item .product-marker:not(.align-left):not(.align-right) .product-marker-tooltip:hover {
    transform: translateX(-50%) translateY(0) !important;
}

.instafeed-item .product-marker-tooltip img.pmt-thumb {
    width: 44px !important;
    height: 44px !important;
    min-width: 44px !important;
    min-height: 44px !important;
    max-width: 44px !important;
    max-height: 44px !important;
    object-fit: cover !important;
    border-radius: 6px !important;
    flex-shrink: 0 !important;
    border: 1px solid #eeeeee !important;
    display: block !important;
    margin: 0 !important;
    padding: 0 !important;
    float: none !important;
}

.instafeed-item .product-marker-tooltip .pmt-info {
    flex: 1 1 auto !important;
    min-width: 0 !important;
    display: block !important;
    margin: 0 !important;
    padding: 0 !important;
}

.instafeed-item .product-marker-tooltip .pmt-title {
    font-size: 11.5px !important;
    font-weight: 700 !important;
    color: #1c1e21 !important;
    line-height: 1.2 !important;
    margin: 0 0 2px 0 !important;
    padding: 0 !important;
    white-space: normal !important;
    display: -webkit-box !important;
    -webkit-line-clamp: 2 !important;
    -webkit-box-orient: vertical !important;
    overflow: hidden !important;
}

.instafeed-item .product-marker-tooltip .pmt-desc {
    font-size: 10px !important;
    color: #65676b !important;
    line-height: 1.2 !important;
    margin: 0 0 2px 0 !important;
    padding: 0 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
}

.instafeed-item .product-marker-tooltip .pmt-price {
    font-size: 13px !important;
    font-weight: 700 !important;
    color: #e1306c !important;
    margin: 0 !important;
    padding: 0 !important;
}

.instafeed-item .product-marker-tooltip .pmt-btn {
    padding: 6px 12px !important;
    background: #e1306c !important;
    color: #ffffff !important;
    border: none !important;
    border-radius: 6px !important;
    font-size: 11.5px !important;
    font-weight: 600 !important;
    text-decoration: none !important;
    white-space: nowrap !important;
    flex-shrink: 0 !important;
    transition: opacity 0.2s ease !important;
    display: inline-block !important;
    cursor: pointer !important;
    text-align: center !important;
    margin: 0 !important;
    height: auto !important;
    line-height: 1.2 !important;
}

.instafeed-item .product-marker-tooltip .pmt-btn:hover {
    opacity: 0.9 !important;
}

.instafeed-item .product-marker-tooltip img.pmt-thumb {
    width: 44px !important;
    height: 44px !important;
    min-width: 44px !important;
    min-height: 44px !important;
    max-width: 44px !important;
    max-height: 44px !important;
    object-fit: cover !important;
    border-radius: 6px !important;
    flex-shrink: 0 !important;
    border: 1px solid #eeeeee !important;
    display: block !important;
    margin: 0 !important;
    padding: 0 !important;
}

.instafeed-item .pmt-info {
    flex: 1;
    min-width: 0;
}

.instafeed-item .pmt-title {
    font-size: 12.5px;
    font-weight: 700;
    color: #1c1e21;
    line-height: 1.3;
    margin-bottom: 2px;
    white-space: normal;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.instafeed-item .pmt-desc {
    font-size: 11px;
    color: #65676b;
    line-height: 1.25;
    margin-bottom: 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.instafeed-item .pmt-price {
    font-size: 14px;
    font-weight: 700;
    color: #e1306c;
}

.instafeed-item .pmt-btn {
    padding: 7px 14px;
    background: #e1306c;
    color: #ffffff !important;
    border: none;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    text-decoration: none !important;
    white-space: nowrap;
    flex-shrink: 0;
    transition: opacity 0.2s, transform 0.2s;
    display: inline-block;
    cursor: pointer;
    text-align: center;
}

.instafeed-item .pmt-btn:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

/* Instagram link and caption hidden under feed items */
.instafeed-item .item-caption,
.instafeed-item .item-instagram-link {
    display: none !important;
}

/* Load more button */
.instafeed-load-more {
    text-align: center;
    padding: 20px;
}

.instafeed-load-more .btn-load-more {
    display: inline-block;
    padding: 12px 30px;
    border: 1px solid var(--instafeed-btn-bg, #333);
    background: var(--instafeed-btn-bg, #333);
    color: var(--instafeed-btn-color, #fff);
    border-radius: var(--instafeed-btn-radius, 4px);
    font-size: var(--instafeed-btn-size, 14px);
    font-weight: var(--instafeed-btn-weight, 600);
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.instafeed-load-more .btn-load-more:hover {
    opacity: 0.85;
}

.instafeed-load-more .btn-load-more.loading {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Placeholder for lazy loading */
.instafeed-item img[data-src] {
    background: #eee;
    min-height: 200px;
}

/* Continuous Marquee Ribbon Layout */
.instafeed-marquee-container {
    overflow: hidden;
    white-space: nowrap;
    width: 100%;
    position: relative;
    padding: 10px 0;
}

.instafeed-marquee-track {
    display: flex;
    width: max-content;
    animation: instafeed-marquee 35s linear infinite;
}

.instafeed-marquee-container:hover .instafeed-marquee-track {
    animation-play-state: paused;
}

.instafeed-marquee-content {
    display: flex;
    flex-shrink: 0;
    align-items: center;
    gap: var(--instafeed-spacing, 15px);
}

.instafeed-marquee-item {
    flex: 0 0 220px;
    width: 220px;
    height: 220px;
}

.instafeed-marquee-item .instafeed-item {
    height: 100%;
}

@keyframes instafeed-marquee {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(-50%);
    }
}

/* Quick Buy Modal Overlay inside Popup */
.instafeed-quickbuy-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(4px);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.instafeed-quickbuy-box {
    background: #ffffff;
    color: #222222;
    border-radius: 12px;
    max-width: 420px;
    width: 100%;
    padding: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    position: relative;
}

.instafeed-quickbuy-close {
    position: absolute;
    top: 10px;
    right: 14px;
    font-size: 24px;
    background: none;
    border: none;
    cursor: pointer;
    color: #888;
}

.instafeed-quickbuy-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
}

.instafeed-quickbuy-img {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 8px;
}

.instafeed-quickbuy-title {
    font-weight: 700;
    font-size: 15px;
    margin-bottom: 4px;
}

.instafeed-quickbuy-price {
    font-size: 16px;
    font-weight: 700;
    color: #e1306c;
}

.instafeed-quickbuy-btn {
    width: 100%;
    padding: 12px;
    background: #000000;
    color: #ffffff;
    border: none;
    border-radius: 6px;
    font-weight: 700;
    cursor: pointer;
    margin-top: 15px;
    transition: opacity 0.2s;
}

.instafeed-quickbuy-btn:hover {
    opacity: 0.9;
}
