/* ===== Common Shared Styles ===== */

/* ---- Contact Popover ---- */
.contact-popover {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 12px;
    background: #fff;
    border-radius: 8px;
    padding: 18px 22px;
    width: 340px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.15);
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: all 0.2s ease;
    text-align: left;
}
.contact-popover.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
.popover-arrow {
    position: absolute;
    top: -6px;
    right: 60px;
    width: 12px;
    height: 12px;
    background: #fff;
    transform: rotate(45deg);
    box-shadow: -2px -2px 4px rgba(0,0,0,0.04);
}
.popover-item {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
    color: #05305b;
    padding: 8px 0;
    border-bottom: 1px solid #f0f0f0;
    text-align: left;
}
.popover-item span,
.popover-item a {
    padding: 0;
    font-weight: 400;
    text-align: left;
}
.popover-item:last-child { border-bottom: none; padding-bottom: 0; }
.popover-item:first-of-type { padding-top: 0; }
.popover-item i {
    width: 30px;
    height: 30px;
    background: #05305b;
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    flex-shrink: 0;
}
.popover-item a { color: #05305b; text-decoration: none; word-break: break-all; background: none; }
.popover-item a:hover { color: #05305b; text-decoration: underline; background: none; }

/* Mobile: force popover text left */
@media (max-width: 768px) {
    .contact-popover,
    .contact-popover .popover-item,
    .contact-popover .popover-item span,
    .contact-popover .popover-item a {
        text-align: left !important;
    }
}

/* ===== Image Lazy Loading Styles ===== */
.img-container {
    position: relative;
    display: block;
    overflow: hidden;
    width: 100%;
    height: 100%;
}

.img-placeholder {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, #f5f5f5 25%, #e0e0e0 50%, #f5f5f5 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
    z-index: 1;
}

@keyframes loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

.lazy-img {
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.lazy-img.loaded {
    opacity: 1;
}

.img-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 24px;
    height: 24px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top: 2px solid #2196F3;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    z-index: 2;
}

@keyframes spin {
    0% {
        transform: translate(-50%, -50%) rotate(0deg);
    }
    100% {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

.img-error {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #f8f9fa;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6c757d;
    font-size: 12px;
    z-index: 3;
}

/* Responsive image optimization */
img[loading="lazy"] {
    will-change: transform;
}

/* Prevent layout shift */
.img-container img {
    display: block;
}

/* Fallback for older browsers */
.no-js .lazy-img {
    opacity: 1;
}
