/* ============================================
   PHONE SLIDER – CSS FRONTEND
   ============================================ */

/* ---------- CONTAINER & SLIDER ---------- */
.ps-slider-container {
    position: relative;
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
    padding: 15px 0 20px;
    overflow: hidden;
    cursor: grab;
    user-select: none;
}

.ps-slider-container.dragging {
    cursor: grabbing;
}

.ps-slider-track {
    display: flex;
    transition: transform 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    will-change: transform;
}

.ps-slide {
    flex: 0 0 33.3333%;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 5px 8px;
    box-sizing: border-box;
}

/* ---------- IPHONE MOCKUP (CSS ONLY) ---------- */
.ps-iphone {
    position: relative;
    width: 100%;
    max-width: 320px;
    aspect-ratio: 9 / 19.2;
    background: #1a1a1a;
    border-radius: 44px;
    padding: 14px;
    /* Không shadow, không hiệu ứng hover */
}

/* --- Viền kim loại ngoài --- */
.ps-iphone::before {
    content: '';
    position: absolute;
    top: -3px;
    left: -3px;
    right: -3px;
    bottom: -3px;
    border-radius: 47px;
    background: linear-gradient(145deg, #e0e0e0, #9e9e9e, #bdbdbd, #757575);
    z-index: -1;
}

/* --- Dynamic Island (tai thỏ hiện đại) --- */
.ps-iphone-notch {
    position: absolute;
    top: 16px;
    left: 50%;
    transform: translateX(-50%);
    width: 90px;
    height: 28px;
    background: #000;
    border-radius: 20px;
    z-index: 10;
}

/* --- Camera chấm trong Dynamic Island --- */
.ps-iphone-notch::after {
    content: '';
    position: absolute;
    right: 18px;
    top: 50%;
    transform: translateY(-50%);
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: radial-gradient(circle, #1a237e 30%, #0d1117 70%);
    box-shadow: inset 0 0 2px rgba(255,255,255,0.2);
}

/* --- Nút nguồn (Power) --- */
.ps-iphone-btn-power {
    position: absolute;
    top: 120px;
    right: -4px;
    width: 4px;
    height: 60px;
    background: linear-gradient(to bottom, #999, #666, #999);
    border-radius: 0 2px 2px 0;
}

/* --- Nút âm lượng --- */
.ps-iphone-btn-vol-up {
    position: absolute;
    top: 110px;
    left: -4px;
    width: 4px;
    height: 40px;
    background: linear-gradient(to bottom, #999, #666, #999);
    border-radius: 2px 0 0 2px;
}

.ps-iphone-btn-vol-down {
    position: absolute;
    top: 160px;
    left: -4px;
    width: 4px;
    height: 40px;
    background: linear-gradient(to bottom, #999, #666, #999);
    border-radius: 2px 0 0 2px;
}

/* --- Nút gạt rung --- */
.ps-iphone-btn-silent {
    position: absolute;
    top: 70px;
    left: -4px;
    width: 4px;
    height: 22px;
    background: linear-gradient(to bottom, #999, #666, #999);
    border-radius: 2px 0 0 2px;
}

/* --- Màn hình --- */
.ps-iphone-screen {
    position: relative;
    width: 100%;
    height: 100%;
    background: #000;
    border-radius: 32px;
    overflow: hidden;
}

.ps-iphone-screen img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* --- Home Indicator bar --- */
.ps-iphone-home-indicator {
    position: absolute;
    bottom: 8px;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 4px;
    background: rgba(255,255,255,0.4);
    border-radius: 4px;
    z-index: 10;
}

/* ---------- SLIDER ARROWS (HIDDEN) ---------- */
.ps-slider-arrow {
    display: none; /* Ẩn nút mũi tên */
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 46px;
    height: 46px;
    border: none;
    background: rgba(255,255,255,0.9);
    color: #333;
    border-radius: 50%;
    font-size: 18px;
    cursor: pointer;
    z-index: 10;
    box-shadow: 0 4px 15px rgba(0,0,0,0.15);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.ps-slider-arrow:hover {
    background: #d33c56;
    color: #fff;
    box-shadow: 0 6px 20px rgba(211,60,86,0.4);
}

.ps-arrow-prev { left: 5px; }
.ps-arrow-next { right: 5px; }

/* ---------- SLIDER DOTS ---------- */
.ps-slider-dots {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 30px;
}

.ps-dot {
    width: 30px;
    height: 4px;
    border-radius: 4px;
    background: #ccc;
    cursor: pointer;
    transition: all 0.3s ease;
}

.ps-dot.active {
    background: #d33c56;
    width: 40px;
}

.ps-dot:hover {
    background: #e57388;
}

/* ---------- RESPONSIVE ---------- */
@media (max-width: 960px) {
    .ps-slide {
        flex: 0 0 50%;
    }
}

@media (max-width: 600px) {
    .ps-slide {
        flex: 0 0 100%;
    }
    .ps-iphone {
        width: 260px; /* Tăng xíu cho dễ nhìn nhưng không cần cố định chiều cao vì đã có aspect-ratio */
        max-width: 100%;
        border-radius: 38px;
        padding: 12px;
    }
    .ps-iphone::before {
        border-radius: 41px;
    }
    .ps-iphone-screen {
        border-radius: 28px;
    }
    .ps-iphone-notch {
        width: 76px;
        height: 24px;
        top: 14px;
    }
    .ps-slider-container {
        padding: 8px 0 15px; /* Tối ưu padding dọc trên mobile, xoá padding ngang để flex và JS translate không bị lệch */
    }
}
