/* ===== Parallax 3D Stack Carousel - Premium v3 ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --ps-primary: #AD8B73;
    --ps-secondary: #CEAB93;
    --ps-accent1: #E3CAA5;
    --ps-accent2: #FFFBE9;
    --ps-gold: #AD8B73;
    --ps-gold-light: #CEAB93;
    --ps-dark: #1E1511;
    --ps-ease: cubic-bezier(0.22, 1, 0.36, 1);
    --ps-card-w: 420px;
    --ps-card-h: 320px;
}

body {
    font-family: var(--font-secondary, 'DecoType Naskh', Tahoma, Arial, sans-serif);
    background: var(--ps-dark);
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* ===== Canvas الجسيمات ===== */
.ps-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

/* ===== القسم ===== */
.ps-section {
    position: relative;
    width: 100%;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    background: 
        radial-gradient(ellipse at 30% 0%, rgba(173, 139, 115, 0.4) 0%, transparent 60%),
        radial-gradient(ellipse at 70% 100%, rgba(173, 139, 115, 0.06) 0%, transparent 50%),
        linear-gradient(160deg, #1E1511 0%, #1E1511 30%, #1E1511 60%, #1E1511 100%);
    overflow: hidden;
}

/* ===== الهيدر ===== */
.ps-header {
    text-align: center;
    margin-bottom: 1.5rem;
    z-index: 2;
}

.ps-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 1.2rem;
    background: rgba(173, 139, 115, 0.08);
    border: 1px solid rgba(173, 139, 115, 0.25);
    border-radius: 50px;
    color: var(--ps-gold);
    font-size: 0.8rem;
    font-weight: 500;
    margin-bottom: 1rem;
    animation: psSlideDown 0.6s var(--ps-ease) forwards;
}

@keyframes psSlideDown {
    from { opacity: 0; transform: translateY(-15px); }
    to { opacity: 1; transform: translateY(0); }
}

.ps-title {
    font-family: var(--font-primary, 'Hacen Egypt', Tahoma, Arial, sans-serif);
    font-size: clamp(1.6rem, 3.5vw, 2.5rem);
    font-weight: 900;
    color: #FFFBE9;
    margin-bottom: 0.4rem;
    animation: psFadeIn 0.6s var(--ps-ease) 0.1s both;
}

.ps-gold {
    background: linear-gradient(135deg, var(--ps-gold), var(--ps-gold-light));
    background-size: 200% 200%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: psGoldShift 3s ease infinite;
}

@keyframes psGoldShift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

@keyframes psFadeIn {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

.ps-subtitle {
    font-family: var(--font-secondary, 'DecoType Naskh', Tahoma, Arial, sans-serif);
    font-size: clamp(0.8rem, 1.8vw, 0.95rem);
    color: var(--ps-accent1);
    font-weight: 300;
    opacity: 0.65;
    animation: psFadeIn 0.6s var(--ps-ease) 0.2s both;
}

.ps-line {
    width: 70px;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--ps-gold), transparent);
    margin: 0.8rem auto 0;
}

/* ===== المعرض ===== */
.ps-gallery {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 1200px;
    display: flex;
    justify-content: center;
    align-items: center;
    flex: 1;
}

.ps-stack {
    position: relative;
    width: var(--ps-card-w);
    height: var(--ps-card-h);
    transform-style: preserve-3d;
}

/* ===== الكروت (Stack Cards) ===== */
.ps-card {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 20px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.6s var(--ps-ease);
    will-change: transform, opacity, filter;
    backface-visibility: hidden;
    box-shadow: 
        0 10px 40px rgba(0, 0, 0, 0.5),
        0 20px 60px rgba(0, 0, 0, 0.3);
}

.ps-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.8s var(--ps-ease);
}

.ps-card:hover img {
    transform: scale(1.05);
}

/* ===== طبقات الكرت ===== */
.ps-card::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 20px;
    border: 1px solid rgba(173, 139, 115, 0.2);
    z-index: 2;
    pointer-events: none;
}

.ps-card.active::before {
    border-color: rgba(173, 139, 115, 0.5);
    box-shadow: 0 0 30px rgba(173, 139, 115, 0.15);
}

/* شارة الرقم */
.ps-card-num {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 38px;
    height: 38px;
    background: linear-gradient(135deg, var(--ps-gold), var(--ps-gold-light));
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--ps-dark);
    font-size: 0.8rem;
    font-weight: 900;
    z-index: 3;
    box-shadow: 0 4px 15px rgba(173, 139, 115, 0.3);
}

/* زر العين */
.ps-card-eye {
    position: absolute;
    top: 1rem;
    left: 1rem;
    width: 38px;
    height: 38px;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(173, 139, 115, 0.4);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    transform: scale(0.8);
    transition: all 0.3s var(--ps-ease);
    z-index: 4;
}

.ps-card-eye svg {
    width: 18px;
    height: 18px;
    fill: var(--ps-gold);
}

.ps-card:hover .ps-card-eye,
.ps-card.active .ps-card-eye {
    opacity: 1;
    transform: scale(1);
}

.ps-card-eye:hover {
    background: var(--ps-gold);
    transform: scale(1.15);
}

.ps-card-eye:hover svg {
    fill: var(--ps-dark);
}

/* Overlay النص */
.ps-card-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 2.5rem 1.2rem 1rem;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.95));
    transform: translateY(100%);
    transition: transform 0.5s var(--ps-ease);
    z-index: 3;
}

.ps-card:hover .ps-card-overlay,
.ps-card.active .ps-card-overlay {
    transform: translateY(0);
}

.ps-card-overlay h3 {
    color: #FFFBE9;
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 0.2rem;
}

.ps-card-overlay p {
    color: var(--ps-accent1);
    font-size: 0.75rem;
    opacity: 0.85;
}

/* ===== التذييل ===== */
.ps-footer {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.8rem;
    margin-top: 1.5rem;
}

.ps-counter-wrap {
    display: flex;
    align-items: baseline;
    gap: 0.3rem;
    direction: ltr;
}

.ps-counter-num {
    font-size: 1.6rem;
    font-weight: 900;
    color: var(--ps-gold);
    font-variant-numeric: tabular-nums;
}

.ps-counter-sep {
    color: rgba(255, 255, 255, 0.3);
    font-size: 1rem;
}

.ps-counter-total {
    color: rgba(255, 255, 255, 0.4);
    font-size: 1rem;
}

/* شريط التقدم الدائري */
.ps-progress-ring {
    position: relative;
    width: 50px;
    height: 50px;
}

.ps-ring-bg {
    fill: none;
    stroke: rgba(255, 255, 255, 0.08);
    stroke-width: 3;
}

.ps-ring-fill {
    fill: none;
    stroke: var(--ps-gold);
    stroke-width: 3;
    stroke-linecap: round;
    transition: stroke-dashoffset 0.6s var(--ps-ease);
    filter: drop-shadow(0 0 5px rgba(173, 139, 115, 0.4));
}

.ps-ring-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 0.65rem;
    font-weight: 700;
    color: var(--ps-gold);
}

/* أزرار التحكم */
.ps-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.ps-btn {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    border: 1px solid rgba(173, 139, 115, 0.3);
    background: rgba(173, 139, 115, 0.05);
    backdrop-filter: blur(10px);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s var(--ps-ease);
    color: var(--ps-gold);
}

.ps-btn svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
    transition: fill 0.3s ease;
}

.ps-btn:hover {
    background: rgba(173, 139, 115, 0.15);
    border-color: var(--ps-gold);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(173, 139, 115, 0.2);
}

.ps-btn:active {
    transform: translateY(0) scale(0.95);
}

.ps-btn-play {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--ps-gold), var(--ps-gold-light));
    border: none;
    box-shadow: 0 5px 20px rgba(173, 139, 115, 0.3);
}

.ps-btn-play svg {
    fill: var(--ps-dark);
    width: 24px;
    height: 24px;
}

.ps-btn-play:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 10px 30px rgba(173, 139, 115, 0.4);
}

/* النقاط */
.ps-dots {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
    justify-content: center;
}

.ps-dot {
    width: 24px;
    height: 24px;
    min-width: 24px;
    min-height: 24px;
    display: grid;
    place-items: center;
    position: relative;
    border-radius: 50%;
    background: transparent;
    border: 0;
    cursor: pointer;
    transition: all 0.4s var(--ps-ease);
    padding: 0;
}

.ps-dot::before {
    content: "";
    display: block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    transition: all 0.4s var(--ps-ease);
}

.ps-dot.active {
    width: 24px;
    min-width: 24px;
    background: transparent;
    box-shadow: none;
}

.ps-dot.active::before {
    width: 24px;
    height: 6px;
    border-radius: 3px;
    background: var(--ps-gold);
    box-shadow: 0 0 10px rgba(173, 139, 115, 0.5);
}

.ps-dot:hover:not(.active)::before {
    background: rgba(173, 139, 115, 0.4);
    transform: scale(1.4);
}

/* ===== لوحة التفاصيل ===== */
.ps-detail {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    gap: 1rem;
    max-width: 500px;
    width: 100%;
    margin-top: 1.2rem;
    padding: 1rem 1.5rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(173, 139, 115, 0.15);
    border-radius: 14px;
    backdrop-filter: blur(15px);
    transition: all 0.3s ease;
}

.ps-detail:hover {
    border-color: rgba(173, 139, 115, 0.3);
}

.ps-detail-icon {
    width: 40px;
    height: 40px;
    min-width: 40px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--ps-gold), var(--ps-gold-light));
    display: flex;
    align-items: center;
    justify-content: center;
}

.ps-detail-icon svg {
    width: 22px;
    height: 22px;
    fill: var(--ps-dark);
}

.ps-detail-content {
    flex: 1;
}

.ps-detail-title {
    color: #FFFBE9;
    font-size: 0.95rem;
    font-weight: 700;
    transition: opacity 0.3s ease;
}

.ps-detail-desc {
    color: var(--ps-accent1);
    font-size: 0.75rem;
    opacity: 0.65;
    transition: opacity 0.3s ease;
}

.ps-detail-eye {
    width: 36px;
    height: 36px;
    min-width: 36px;
    border-radius: 50%;
    border: 1px solid rgba(173, 139, 115, 0.3);
    background: rgba(173, 139, 115, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s var(--ps-ease);
}

.ps-detail-eye svg {
    width: 18px;
    height: 18px;
    fill: var(--ps-gold);
    transition: fill 0.3s ease;
}

.ps-detail-eye:hover {
    background: var(--ps-gold);
    transform: scale(1.1);
}

.ps-detail-eye:hover svg {
    fill: var(--ps-dark);
}

/* ===== Lightbox ===== */
.ps-lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.94);
    backdrop-filter: blur(20px);
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s ease;
}

.ps-lightbox.open {
    opacity: 1;
    visibility: visible;
}

.ps-lb-content {
    position: relative;
    max-width: 92vw;
    max-height: 90vh;
    transform: scale(0.8);
    transition: transform 0.4s var(--ps-ease);
}

.ps-lightbox.open .ps-lb-content {
    transform: scale(1);
}

.ps-lb-img {
    max-width: 92vw;
    max-height: 80vh;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 16px;
    box-shadow: 
        0 0 0 2px rgba(173, 139, 115, 0.4),
        0 20px 80px rgba(0, 0, 0, 0.6),
        0 0 100px rgba(173, 139, 115, 0.1);
}

.ps-lb-close {
    position: absolute;
    top: -55px;
    left: 50%;
    transform: translateX(-50%);
    width: 44px;
    height: 44px;
    background: rgba(173, 139, 115, 0.1);
    border: 1px solid rgba(173, 139, 115, 0.4);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    color: var(--ps-gold);
    font-size: 1.5rem;
}

.ps-lb-close:hover {
    background: var(--ps-gold);
    color: var(--ps-dark);
    transform: translateX(-50%) scale(1.1);
}

.ps-lb-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 46px;
    height: 46px;
    background: rgba(173, 139, 115, 0.1);
    border: 1px solid rgba(173, 139, 115, 0.3);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    color: var(--ps-gold);
}

.ps-lb-nav svg {
    width: 22px;
    height: 22px;
    fill: currentColor;
}

.ps-lb-nav:hover {
    background: var(--ps-gold);
    color: var(--ps-dark);
    transform: translateY(-50%) scale(1.15);
}

.ps-lb-prev { right: -65px; }
.ps-lb-next { left: -65px; }

.ps-lb-caption {
    position: absolute;
    bottom: -55px;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
    white-space: nowrap;
}

.ps-lb-caption h4 {
    color: #FFFBE9;
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 0.2rem;
}

.ps-lb-caption p {
    color: var(--ps-accent1);
    font-size: 0.8rem;
    opacity: 0.7;
}

/* ===== التجاوب ===== */
@media (min-width: 1400px) {
    :root { --ps-card-w: 480px; --ps-card-h: 360px; }
}

@media (max-width: 1200px) {
    :root { --ps-card-w: 420px; --ps-card-h: 320px; }
}

@media (max-width: 992px) {
    :root { --ps-card-w: 360px; --ps-card-h: 280px; }
    .ps-section { padding: 1.5rem; }
}

@media (max-width: 768px) {
    :root { --ps-card-w: 300px; --ps-card-h: 240px; }
    .ps-section { padding: 1rem; }
    .ps-header { margin-bottom: 1rem; }
    .ps-footer { gap: 0.6rem; }
    .ps-btn { width: 42px; height: 42px; border-radius: 12px; }
    .ps-btn svg { width: 18px; height: 18px; }
    .ps-btn-play { width: 50px; height: 50px; }
    .ps-detail { padding: 0.8rem 1rem; gap: 0.8rem; }
    .ps-detail-icon { width: 34px; height: 34px; min-width: 34px; }
    .ps-detail-eye { width: 32px; height: 32px; min-width: 32px; }
    .ps-lb-prev { right: -40px; }
    .ps-lb-next { left: -40px; }
    .ps-lb-nav { width: 38px; height: 38px; }
}

@media (max-width: 480px) {
    :root { --ps-card-w: 260px; --ps-card-h: 200px; }
    .ps-detail { flex-direction: column; text-align: center; padding: 0.8rem; }
    .ps-detail-eye { align-self: center; }
    .ps-counter-num { font-size: 1.4rem; }
    .ps-card-num { width: 32px; height: 32px; font-size: 0.7rem; }
    .ps-card-eye { width: 32px; height: 32px; }
}

@media (max-width: 360px) {
    :root { --ps-card-w: 230px; --ps-card-h: 180px; }
}

@media (max-height: 500px) and (orientation: landscape) {
    .ps-header { display: none; }
    .ps-detail { display: none; }
    .ps-section { padding: 0.5rem; }
    .ps-footer { margin-top: 0.5rem; }
}

@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}
