/* ═══════════════════════════════════════════════
   Photo Sticker v2 — Premium Configurator
   ═══════════════════════════════════════════════ */

.sd-ps, .sd-ps *, .sd-ps *::before, .sd-ps *::after { box-sizing: border-box; }
.sd-ps { direction: rtl; color: #1a1a1a; line-height: 1.5; }
.sd-ps img { max-width: 100%; height: auto; }

/* Container */
.sd-ps-container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }
.sd-ps-container--narrow { max-width: 720px; }

/* Section spacing */
.sd-ps-section { padding: 3rem 0; }
.sd-ps-section:nth-child(even) { background: #fafafa; }
.sd-ps-section__title {
    font-size: 1.5rem;
    font-weight: 700;
    text-align: center;
    margin: 0 0 0.5rem;
}
.sd-ps-section__sub {
    text-align: center;
    color: #666;
    font-size: 0.95rem;
    margin: 0 0 2rem;
}

/* ══════════════════════════════════════
   HERO — Above the Fold
   ══════════════════════════════════════ */
.sd-ps-hero {
    background: linear-gradient(160deg, #f9f6f2 0%, #f0ebe4 50%, #e8e3dc 100%);
    padding: 2rem 0 2.5rem;
    min-height: 80vh;
    display: flex;
    align-items: center;
}
.sd-ps-hero__grid {
    display: grid;
    grid-template-columns: 1fr 420px;
    gap: 2.5rem;
    align-items: start;
}

/* Showcase */
.sd-ps-hero__showcase {
    display: flex;
    align-items: center;
    justify-content: center;
}
.sd-ps-hero__img {
    width: 100%;
    max-width: 640px;
    border-radius: 16px;
    box-shadow: 0 12px 40px rgba(0,0,0,0.1);
}
.sd-ps-hero__placeholder {
    text-align: center;
    padding: 4rem 2rem;
}
.sd-ps-hero__placeholder h1 {
    font-size: 2.5rem;
    font-weight: 800;
    line-height: 1.2;
    margin: 0 0 1rem;
    color: #1a1a1a;
}
.sd-ps-hero__placeholder p {
    font-size: 1.1rem;
    color: #555;
}

/* ══════════════════════════════════════
   CONFIGURATOR CARD
   ══════════════════════════════════════ */
.sd-ps-config {
    background: #fff;
    border-radius: 20px;
    box-shadow: 0 4px 24px rgba(0,0,0,0.08);
    padding: 1.75rem;
    position: sticky;
    top: 80px;
    z-index: 10;
}
.sd-ps-config__header {
    text-align: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #eee;
}
.sd-ps-config__title {
    font-size: 1.35rem;
    font-weight: 700;
    margin: 0 0 0.25rem;
}
.sd-ps-config__subtitle {
    font-size: 0.85rem;
    color: #888;
    margin: 0;
}

/* Config sections */
.sd-ps-config__section {
    margin-bottom: 1.25rem;
    transition: opacity 0.3s, filter 0.3s;
}
.sd-ps-config__section.is-locked {
    opacity: 0.4;
    pointer-events: none;
    filter: grayscale(0.5);
}
.sd-ps-config__label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 0.6rem;
    color: #333;
}
.sd-ps-config__num {
    display: inline-flex;
    width: 24px;
    height: 24px;
    align-items: center;
    justify-content: center;
    background: #1a1a1a;
    color: #fff;
    border-radius: 50%;
    font-size: 0.75rem;
    font-weight: 700;
    flex-shrink: 0;
}

/* ══════════════════════════════════════
   UPLOAD / DROPZONE
   ══════════════════════════════════════ */
.sd-ps-dropzone {
    border: 2px dashed #ccc;
    border-radius: 12px;
    padding: 1.5rem;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
    min-height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}
.sd-ps-dropzone:hover,
.sd-ps-dropzone.is-dragover {
    border-color: #1a1a1a;
    background: #fafafa;
}
.sd-ps-dropzone__idle {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    color: #888;
}
.sd-ps-dropzone__idle svg { color: #999; margin-bottom: 4px; }
.sd-ps-dropzone__idle span { font-size: 0.9rem; }
.sd-ps-dropzone__idle small { font-size: 0.75rem; color: #aaa; }

.sd-ps-dropzone__preview { position: relative; width: 100%; }
.sd-ps-dropzone__preview img {
    width: 100%;
    max-height: 180px;
    object-fit: contain;
    border-radius: 8px;
}
.sd-ps-dropzone__change {
    position: absolute;
    top: 6px;
    left: 6px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: rgba(0,0,0,0.6);
    color: #fff;
    font-size: 1.1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}
.sd-ps-dropzone__change:hover { background: rgba(0,0,0,0.8); }

.sd-ps-dropzone__uploading {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #666;
    font-size: 0.9rem;
}

/* ══════════════════════════════════════
   CHARACTERS — Auto-Detect
   ══════════════════════════════════════ */
.sd-ps-chars-detect__loading {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    color: #666;
    padding: 0.5rem 0;
}
.sd-ps-chars-detect__result {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    background: #f5f5f5;
    border-radius: 10px;
    padding: 0.6rem 1rem;
}
.sd-ps-chars-detect__text {
    font-size: 0.9rem;
    color: #333;
}
.sd-ps-chars-detect__adjust {
    display: flex;
    align-items: center;
    gap: 8px;
}
.sd-ps-chars-btn {
    width: 32px;
    height: 32px;
    border: 1px solid #ddd;
    border-radius: 50%;
    background: #fff;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
    color: #333;
    line-height: 1;
}
.sd-ps-chars-btn:hover { border-color: #1a1a1a; background: #f5f5f5; }
.sd-ps-chars-detect__count {
    font-size: 1.25rem;
    font-weight: 700;
    min-width: 24px;
    text-align: center;
}

/* ══════════════════════════════════════
   STYLE SELECTOR
   ══════════════════════════════════════ */
.sd-ps-styles-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
}
.sd-ps-style-card {
    border: 2px solid #e5e5e5;
    border-radius: 10px;
    background: #fff;
    cursor: pointer;
    text-align: center;
    padding: 6px 6px 8px;
    transition: all 0.2s;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}
.sd-ps-style-card:hover {
    border-color: #999;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}
.sd-ps-style-card.is-active {
    border-color: #1a1a1a;
    box-shadow: 0 0 0 2px rgba(26,26,26,0.15);
}
.sd-ps-style-card__img {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    border-radius: 6px;
}
.sd-ps-style-card__icon {
    font-size: 2rem;
    display: block;
    padding: 0.5rem 0;
}
.sd-ps-style-card__name {
    font-size: 0.75rem;
    font-weight: 600;
    color: #333;
}

/* ══════════════════════════════════════
   SIZE PILLS
   ══════════════════════════════════════ */
.sd-ps-sizes-row {
    display: flex;
    gap: 8px;
}
.sd-ps-size-pill {
    flex: 1;
    border: 2px solid #e5e5e5;
    border-radius: 10px;
    background: #fff;
    cursor: pointer;
    text-align: center;
    padding: 0.6rem 0.5rem;
    transition: all 0.2s;
}
.sd-ps-size-pill:hover { border-color: #999; }
.sd-ps-size-pill.is-active {
    border-color: #1a1a1a;
    background: #1a1a1a;
    color: #fff;
}
.sd-ps-size-pill.is-active .sd-ps-size-pill__price { color: rgba(255,255,255,0.7); }
.sd-ps-size-pill strong { display: block; font-size: 0.9rem; margin-bottom: 2px; }
.sd-ps-size-pill__price { font-size: 0.7rem; color: #888; }

/* ══════════════════════════════════════
   PRICE BOX + CTA
   ══════════════════════════════════════ */
.sd-ps-config__footer {
    border-top: 1px solid #eee;
    padding-top: 1.25rem;
    margin-top: 0.5rem;
}
.sd-ps-price-box {
    margin-bottom: 0.75rem;
}
.sd-ps-price-box__breakdown {
    font-size: 0.8rem;
    color: #888;
    margin-bottom: 0.25rem;
}
.sd-ps-price-box__total {
    font-size: 1.4rem;
    font-weight: 700;
    color: #1a1a1a;
}
.sd-ps-price-box__total strong {
    font-size: 1.8rem;
    color: #1a1a1a;
}

.sd-ps-cta {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 0.9rem 1.5rem;
    border: none;
    border-radius: 12px;
    background: #1a1a1a;
    color: #fff;
    font-size: 1.05rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}
.sd-ps-cta:hover:not(:disabled) { background: #333; transform: translateY(-1px); box-shadow: 0 4px 12px rgba(0,0,0,0.15); }
.sd-ps-cta:disabled { opacity: 0.4; cursor: not-allowed; }
.sd-ps-cta--cart { background: #28a745; }
.sd-ps-cta--cart:hover:not(:disabled) { background: #218838; }
.sd-ps-cta--outline {
    background: transparent;
    border: 2px solid #1a1a1a;
    color: #1a1a1a;
}
.sd-ps-cta--outline:hover { background: #f5f5f5; }
.sd-ps-cta svg { flex-shrink: 0; }

.sd-ps-btn-link {
    background: none;
    border: none;
    color: #666;
    text-decoration: underline;
    cursor: pointer;
    font-size: 0.9rem;
    padding: 0.5rem;
    transition: color 0.2s;
}
.sd-ps-btn-link:hover { color: #1a1a1a; }

/* ══════════════════════════════════════
   GENERATION OVERLAY
   ══════════════════════════════════════ */
.sd-ps-overlay {
    position: absolute;
    inset: 0;
    background: rgba(255,255,255,0.97);
    border-radius: 20px;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    text-align: center;
}
.sd-ps-overlay h3 { font-size: 1.2rem; margin: 0.75rem 0 0.5rem; }
.sd-ps-overlay p { color: #666; font-size: 0.9rem; margin: 0 0 1rem; }

.sd-ps-overlay__error-icon,
.sd-ps-overlay__success-icon {
    display: inline-flex;
    width: 56px;
    height: 56px;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 1.5rem;
    font-weight: 700;
}
.sd-ps-overlay__error-icon { background: #fee; color: #d9534f; }
.sd-ps-overlay__success-icon { background: #e8f5e9; color: #28a745; }

.sd-ps-result-preview { margin: 1rem 0; }
.sd-ps-result-preview img {
    max-width: 240px;
    max-height: 240px;
    border-radius: 10px;
    border: 1px solid #eee;
}
.sd-ps-result-info { margin-bottom: 1rem; }
.sd-ps-result-price {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}
.sd-ps-result-meta {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
    font-size: 0.8rem;
    color: #888;
    flex-wrap: wrap;
}
.sd-ps-result-actions {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}
.sd-ps-result-actions .sd-ps-cta { max-width: 280px; }

.sd-ps-added-actions {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    margin-top: 1rem;
}
.sd-ps-added-actions .sd-ps-cta { max-width: 240px; }

.sd-ps-remaining {
    font-size: 0.8rem;
    color: #999;
    margin-top: 0.75rem;
}

/* ══════════════════════════════════════
   SPINNER
   ══════════════════════════════════════ */
.sd-ps-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #e0e0e0;
    border-top-color: #1a1a1a;
    border-radius: 50%;
    animation: sd-ps-spin 0.7s linear infinite;
    margin: 0 auto;
}
.sd-ps-spinner--sm { width: 20px; height: 20px; border-width: 2px; margin: 0; }
@keyframes sd-ps-spin { to { transform: rotate(360deg); } }

/* ══════════════════════════════════════
   STYLE GALLERY SECTION
   ══════════════════════════════════════ */
.sd-ps-gallery__grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    max-width: 800px;
    margin: 0 auto;
}
.sd-ps-gallery__item {
    text-align: center;
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    transition: transform 0.2s;
}
.sd-ps-gallery__item:hover { transform: translateY(-3px); }
.sd-ps-gallery__item img {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
}
.sd-ps-gallery__placeholder {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    background: #f5f5f5;
}
.sd-ps-gallery__label {
    display: block;
    padding: 0.6rem;
    font-weight: 600;
    font-size: 0.9rem;
}

/* ══════════════════════════════════════
   HOW IT WORKS — Condensed
   ══════════════════════════════════════ */
.sd-ps-how__steps {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
}
.sd-ps-how__step {
    display: flex;
    align-items: center;
    gap: 10px;
}
.sd-ps-how__num {
    display: inline-flex;
    width: 32px;
    height: 32px;
    align-items: center;
    justify-content: center;
    background: #1a1a1a;
    color: #fff;
    border-radius: 50%;
    font-weight: 700;
    font-size: 0.85rem;
    flex-shrink: 0;
}
.sd-ps-how__step strong { font-size: 0.95rem; }
.sd-ps-how__arrow { color: #ccc; font-size: 1.5rem; font-weight: 300; }

/* ══════════════════════════════════════
   TIPS — Compact Pills
   ══════════════════════════════════════ */
.sd-ps-tips__row {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.75rem;
}
.sd-ps-tip {
    padding: 0.5rem 1rem;
    background: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 100px;
    font-size: 0.85rem;
    white-space: nowrap;
}

/* ══════════════════════════════════════
   FAQ — Accordion
   ══════════════════════════════════════ */
.sd-ps-accordion__item {
    border-bottom: 1px solid #e5e5e5;
}
.sd-ps-accordion__item summary {
    padding: 1rem 0;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.95rem;
    list-style: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.sd-ps-accordion__item summary::after {
    content: '+';
    font-size: 1.25rem;
    font-weight: 300;
    color: #999;
    transition: transform 0.2s;
}
.sd-ps-accordion__item[open] summary::after {
    content: '−';
}
.sd-ps-accordion__item summary::-webkit-details-marker { display: none; }
.sd-ps-accordion__item p {
    padding: 0 0 1rem;
    margin: 0;
    color: #666;
    font-size: 0.9rem;
    line-height: 1.6;
}

/* ══════════════════════════════════════
   MOBILE STICKY BAR
   ══════════════════════════════════════ */
.sd-ps-sticky {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 999;
    background: #fff;
    border-top: 1px solid #e5e5e5;
    box-shadow: 0 -2px 12px rgba(0,0,0,0.08);
    padding: 0.6rem 1rem;
    display: none; /* controlled by JS on mobile */
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    direction: rtl;
}
.sd-ps-sticky.is-visible { display: flex; }
.sd-ps-sticky__price {
    font-size: 1.1rem;
    font-weight: 700;
}
.sd-ps-sticky__cta {
    padding: 0.65rem 1.5rem;
    border: none;
    border-radius: 10px;
    background: #1a1a1a;
    color: #fff;
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s;
    flex-shrink: 0;
}
.sd-ps-sticky__cta:disabled { opacity: 0.4; cursor: not-allowed; }
.sd-ps-sticky__cta:hover:not(:disabled) { background: #333; }

/* ══════════════════════════════════════
   RESPONSIVE
   ══════════════════════════════════════ */

/* Tablet */
@media (max-width: 960px) {
    .sd-ps-hero__grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    .sd-ps-hero {
        min-height: auto;
        padding: 1.5rem 0;
    }
    .sd-ps-hero__showcase {
        max-height: 280px;
        overflow: hidden;
        border-radius: 12px;
        margin: 0 auto;
    }
    .sd-ps-hero__img { border-radius: 12px; }
    .sd-ps-config {
        position: static;
        border-radius: 16px;
        max-width: 500px;
        margin: 0 auto;
    }
}

/* Mobile */
@media (max-width: 767px) {
    .sd-ps-hero { padding: 1rem 0; }
    .sd-ps-hero__showcase { max-height: 220px; }
    .sd-ps-hero__placeholder h1 { font-size: 1.75rem; }

    .sd-ps-config {
        padding: 1.25rem;
        border-radius: 14px;
        margin: 0 -4px;
    }
    .sd-ps-config__title { font-size: 1.15rem; }

    .sd-ps-styles-grid { grid-template-columns: repeat(4, 1fr); gap: 6px; }
    .sd-ps-style-card { padding: 4px 4px 6px; }
    .sd-ps-style-card__name { font-size: 0.65rem; }

    .sd-ps-sizes-row { gap: 6px; }
    .sd-ps-size-pill { padding: 0.5rem 0.25rem; }
    .sd-ps-size-pill strong { font-size: 0.8rem; }
    .sd-ps-size-pill__price { font-size: 0.65rem; }

    .sd-ps-gallery__grid { grid-template-columns: repeat(2, 1fr); }

    .sd-ps-how__steps { flex-direction: column; gap: 0.75rem; }
    .sd-ps-how__arrow { transform: rotate(90deg); }

    .sd-ps-section { padding: 2rem 0; }

    /* Sticky bar visible on mobile only */
    body.sd-ps-has-sticky { padding-bottom: 70px; }
}

/* Desktop: hide sticky */
@media (min-width: 768px) {
    .sd-ps-sticky { display: none !important; }
}
