/* ==========================================
   Shopee Produk - Elementor Widgets Styles
   ========================================== */

/* --- Deskripsi --- */
.sai-deskripsi {
    line-height: 1.8;
    word-break: break-word;
}
.sai-desc-full {
    display: none;
}
.sai-deskripsi.sai-desc-expanded .sai-desc-short {
    display: none;
}
.sai-deskripsi.sai-desc-expanded .sai-desc-full {
    display: block;
}
.sai-desc-toggle {
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: opacity 0.2s;
}
.sai-desc-toggle:hover {
    opacity: 0.75;
}

/* --- Harga --- */
.sai-harga {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.sai-harga-label {
    font-weight: 500;
}
.sai-harga-value {
    font-weight: 700;
    font-size: 1.5em;
}

/* --- Kategori --- */
.sai-kategori {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}
.sai-kategori-badge {
    display: inline-block;
    padding: 4px 14px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    transition: opacity 0.2s ease;
}
.sai-kategori-badge:hover {
    opacity: 0.85;
}
.sai-kategori-text {
    text-decoration: none;
    transition: opacity 0.2s ease;
}
.sai-kategori-text:hover {
    opacity: 0.7;
}

/* --- Rating --- */
.sai-rating {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.sai-rating-stars {
    display: inline-flex;
    align-items: center;
    gap: 2px;
}
.sai-rating-stars svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}
.sai-rating-text {
    font-size: 14px;
    font-weight: 500;
}

/* --- Galeri Slide --- */
.sai-galeri-slide {
    position: relative;
    overflow: hidden;
    width: 100%;
}
.sai-slide-container {
    position: relative;
    width: 100%;
    overflow: hidden;
    background: #f5f5f5;
    /* aspect-ratio di-set via inline style dari widget */
}
.sai-slide-item {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 0.5s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}
.sai-slide-item.active {
    opacity: 1;
    pointer-events: auto;
    z-index: 1;
}
.sai-slide-item img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    display: block;
}
.sai-slide-container {
    cursor: grab;
}
.sai-slide-container:active {
    cursor: grabbing;
}

/* Lightbox Popup */
.sai-lightbox {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 999999;
    background: rgba(0,0,0,0.92);
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.sai-lightbox.active {
    display: flex;
}
.sai-lightbox-img {
    max-width: 90vw;
    max-height: 85vh;
    object-fit: contain;
    border-radius: 4px;
    box-shadow: 0 8px 40px rgba(0,0,0,0.5);
    user-select: none;
}
.sai-lightbox-close {
    position: absolute;
    top: 16px;
    right: 24px;
    background: none;
    border: none;
    color: #fff;
    font-size: 36px;
    cursor: pointer;
    z-index: 10;
    line-height: 1;
    opacity: 0.8;
    transition: opacity 0.2s;
}
.sai-lightbox-close:hover {
    opacity: 1;
}
.sai-lightbox-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255,255,255,0.15);
    color: #fff;
    border: none;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    font-size: 22px;
    cursor: pointer;
    transition: background 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}
.sai-lightbox-arrow:hover {
    background: rgba(255,255,255,0.3);
}
.sai-lightbox-prev { left: 20px; }
.sai-lightbox-next { right: 20px; }

/* Arrows */
.sai-slide-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    background: rgba(0,0,0,0.45);
    color: #fff;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 18px;
    cursor: pointer;
    transition: background 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}
.sai-slide-arrow:hover {
    background: rgba(0,0,0,0.7);
}
.sai-slide-prev { left: 12px; }
.sai-slide-next { right: 12px; }

/* Dots */
.sai-slide-dots {
    display: flex;
    justify-content: center;
    gap: 8px;
    padding: 12px 0;
}
.sai-slide-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #ccc;
    border: none;
    cursor: pointer;
    transition: background 0.2s ease;
    padding: 0;
}
.sai-slide-dot.active {
    background: #ee4d2d;
}

/* Thumbnails */
.sai-slide-thumbs {
    display: flex;
    gap: 8px;
    padding: 10px 0;
    overflow-x: auto;
    scrollbar-width: thin;
}
.sai-slide-thumb {
    flex: 0 0 auto;
    width: 64px;
    height: 64px;
    border: 2px solid transparent;
    border-radius: 6px;
    overflow: hidden;
    cursor: pointer;
    padding: 0;
    background: none;
    transition: border-color 0.2s ease;
}
.sai-slide-thumb.active {
    border-color: #ee4d2d;
}
.sai-slide-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* --- Grid Produk --- */
.sai-grid-title {
    font-size: 1.3em;
    font-weight: 700;
    margin-bottom: 16px;
    color: #222;
}
.sai-grid {
    display: block;
}
.sai-grid-items {
    display: grid;
    gap: 16px;
}
.sai-grid-card {
    display: block;
    text-decoration: none;
    overflow: hidden;
    border: 1px solid #eee;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.sai-grid-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.1);
}
.sai-grid-card-img {
    width: 100%;
    aspect-ratio: 1/1;
    overflow: hidden;
    background: #f5f5f5;
}
.sai-grid-card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}
.sai-grid-card:hover .sai-grid-card-img img {
    transform: scale(1.05);
}
.sai-grid-card-body {
    padding: 12px;
}
.sai-grid-card-title {
    font-size: 14px;
    font-weight: 600;
    margin: 0 0 6px 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.4;
}
.sai-grid-card-price {
    font-size: 15px;
    font-weight: 700;
    display: block;
}

/* --- WhatsApp Button --- */
.sai-wa-wrap {
    display: inline-block;
}
.sai-wa-wrap.sai-wa-full {
    display: block;
}
.sai-wa-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: background-color 0.2s ease, transform 0.15s ease;
    box-shadow: 0 4px 14px rgba(37, 211, 102, 0.3);
}
.sai-wa-full .sai-wa-btn {
    display: flex;
    width: 100%;
}
.sai-wa-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(37, 211, 102, 0.4);
}
.sai-wa-btn:active {
    transform: translateY(0);
}
