/* ============================================================
   STYLE.CSS — All visual presentation
   No data, no logic — only CSS rules
   RTL Arabic, Mobile-First
   ============================================================ */

/* ===== RESET & BASE ===== */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --green: #16a34a;
    --green-hover: #15803d;
    --green-light: #dcfce7;
    --red: #dc2626;
    --red-light: #fef2f2;
    --yellow: #f59e0b;
    --yellow-light: #fef9c3;
    --amber: #d97706;
    --text: #1a1a1a;
    --text-secondary: #555;
    --text-muted: #888;
    --bg: #fafafa;
    --card-bg: #ffffff;
    --border: #e5e5e5;
    --radius: 12px;
    --radius-sm: 8px;
    --radius-pill: 9999px;
    --max-width: 680px;
    --font: 'Segoe UI', 'Arabic Typesetting', Tahoma, sans-serif;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    line-height: 1.7;
    direction: rtl;
    text-align: right;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0 16px 40px;
}

/* ===== CONTAINER ===== */
.page {
    width: 100%;
    max-width: var(--max-width);
}

/* ===== STORE NAME HEADER ===== */
.store-header {
    text-align: center;
    padding: 24px 0 8px;
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    color: var(--text);
}

/* ===== LOCATION BADGE ===== */
.location-badge {
    text-align: center;
    margin: 8px 0 12px;
}

.location-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--green-light);
    color: var(--green);
    border: 1px solid #bbf7d0;
    border-radius: var(--radius-pill);
    padding: 6px 14px;
    font-size: 0.8rem;
    font-weight: 600;
}

/* ===== URGENCY BAR ===== */
.urgency-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 14px;
    justify-content: center;
}

.urgency-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: var(--yellow-light);
    color: var(--amber);
    border: 1px solid #fde68a;
    border-radius: var(--radius-pill);
    padding: 6px 12px;
    font-size: 0.78rem;
    font-weight: 600;
}

.limited-offer-banner {
    width: 100%;
    text-align: center;
    background: linear-gradient(135deg, #fef3c7, #fde68a);
    color: var(--amber);
    border: 1px solid #fcd34d;
    border-radius: var(--radius-sm);
    padding: 10px 16px;
    font-size: 0.85rem;
    font-weight: 700;
    margin-bottom: 12px;
    animation: pulse-banner 2s ease-in-out infinite;
}

@keyframes pulse-banner {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.85; }
}

/* ===== IMAGE GALLERY ===== */
.gallery-wrapper {
    position: relative;
    margin: 16px 0 8px;
}

.gallery {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 8px;
    scrollbar-width: thin;
    scrollbar-color: #ccc transparent;
}

.gallery::-webkit-scrollbar {
    height: 6px;
}
.gallery::-webkit-scrollbar-track {
    background: transparent;
}
.gallery::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 10px;
}

.gallery img {
    flex: 0 0 auto;
    width: 85%;
    max-width: 500px;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    border-radius: var(--radius);
    scroll-snap-align: start;
    border: 1px solid var(--border);
    background: #f3f3f3;
    user-select: none;
    -webkit-user-drag: none;
}

.gallery img.error {
    object-fit: contain;
    background: #fef2f2;
    padding: 40px;
}

/* Scroll hint dots */
.scroll-hint {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin-top: 8px;
}

.scroll-hint span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #d4d4d4;
    transition: all 0.2s;
}

.scroll-hint span.active {
    background: var(--green);
    width: 20px;
    border-radius: 10px;
}

/* ===== PRODUCT NAME ===== */
.product-name {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 12px 0 4px;
    color: var(--text);
}

/* ===== PRICE SAVINGS ===== */
.price-savings {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 4px;
}

.original-price {
    font-size: 1rem;
    color: var(--text-muted);
    text-decoration: line-through;
}

.savings-badge {
    display: inline-flex;
    align-items: center;
    background: var(--red-light);
    color: var(--red);
    border: 1px solid #fecaca;
    border-radius: var(--radius-pill);
    padding: 2px 10px;
    font-size: 0.78rem;
    font-weight: 700;
}

.savings-amount {
    font-size: 0.85rem;
    color: var(--red);
    font-weight: 600;
}

/* ===== PRODUCT PRICE ===== */
.product-price {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--green);
    margin-bottom: 6px;
}

/* ===== DELIVERY PROMISE ===== */
.delivery-promise {
    background: var(--yellow-light);
    border: 1px solid #fde68a;
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    margin-bottom: 12px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--amber);
    text-align: center;
}

/* ===== TIME-LIMITED PROMO ===== */
.promo-banner {
    background: linear-gradient(135deg, #fef3c7, #fde68a, #fcd34d);
    border: 1px solid #fbbf24;
    border-radius: var(--radius);
    padding: 14px 18px;
    margin-bottom: 14px;
    text-align: center;
}

.promo-text {
    font-size: 0.9rem;
    font-weight: 700;
    color: #92400e;
    margin-bottom: 8px;
    line-height: 1.6;
}

.promo-progress {
    width: 100%;
    height: 6px;
    background: #fef3c7;
    border-radius: 3px;
    overflow: hidden;
}

.promo-progress-bar {
    height: 100%;
    background: var(--amber);
    border-radius: 3px;
    transition: width 0.5s ease;
}

/* ===== COUNTDOWN TIMER ===== */
.countdown-timer {
    display: flex;
    gap: 8px;
    justify-content: center;
    margin-bottom: 14px;
    flex-wrap: wrap;
}

.time-block {
    background: #1a1a1a;
    color: #ffffff;
    border-radius: var(--radius-sm);
    padding: 8px 12px;
    text-align: center;
    min-width: 55px;
}

.time-number {
    display: block;
    font-size: 1.3rem;
    font-weight: 800;
    line-height: 1.2;
}

.time-label {
    display: block;
    font-size: 0.65rem;
    color: #aaa;
    margin-top: 2px;
}

.countdown-expired {
    text-align: center;
    color: var(--red);
    font-weight: 700;
    font-size: 0.9rem;
    margin-bottom: 14px;
    padding: 10px;
    background: var(--red-light);
    border-radius: var(--radius-sm);
}

/* ===== DESCRIPTION ===== */
.description {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 16px;
    color: var(--text-secondary);
    font-size: 1rem;
}

.description p + p {
    margin-top: 10px;
}

/* ===== COD BADGES ===== */
.cod-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 20px;
}

.badge {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-pill);
    padding: 10px 16px;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text);
}

.badge .icon {
    font-size: 1.2rem;
}

/* ===== QUANTITY SELECTOR ===== */
.quantity-section {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.quantity-label {
    font-weight: 600;
    font-size: 1rem;
}

.quantity-controls {
    display: flex;
    align-items: center;
    gap: 0;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--card-bg);
}

.quantity-controls button {
    width: 44px;
    height: 44px;
    border: none;
    background: none;
    font-size: 1.4rem;
    font-weight: 700;
    cursor: pointer;
    color: var(--text);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s;
    font-family: var(--font);
}

.quantity-controls button:hover {
    background: #f0f0f0;
}
.quantity-controls button:active {
    background: #e0e0e0;
}
.quantity-controls button:disabled {
    color: #bbb;
    cursor: not-allowed;
}
.quantity-controls button:disabled:hover {
    background: none;
}

.quantity-controls .qty-display {
    width: 56px;
    text-align: center;
    font-size: 1.2rem;
    font-weight: 700;
    border-left: 2px solid var(--border);
    border-right: 2px solid var(--border);
    line-height: 44px;
    user-select: none;
}

.stock-note {
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* ===== RETURN NOTIFICATION ===== */
.return-notification {
    text-align: center;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 12px;
    padding: 8px;
    background: #f9fafb;
    border-radius: var(--radius-sm);
}

/* ===== CTA BUTTON ===== */
.cta-button {
    display: block;
    width: 100%;
    padding: 18px 24px;
    font-size: 1.3rem;
    font-weight: 800;
    color: #ffffff;
    background: var(--green);
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    text-align: center;
    transition: background 0.2s, transform 0.1s;
    box-shadow: 0 4px 14px rgba(22, 163, 74, 0.3);
    font-family: var(--font);
}

.cta-button:hover {
    background: var(--green-hover);
}
.cta-button:active {
    transform: scale(0.98);
}

/* ===== TRUST BADGES ===== */
.trust-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    margin-top: 14px;
    margin-bottom: 8px;
}

.trust-badge {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.78rem;
    color: var(--text-muted);
    font-weight: 500;
}

/* ===== REFUSE POLICY ===== */
.refuse-note {
    text-align: center;
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-top: 12px;
    padding: 0 8px;
}

/* ===== REVIEWS SECTION ===== */
.reviews-section {
    margin: 24px 0;
}

.reviews-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 14px;
    flex-wrap: wrap;
}

.reviews-stars {
    color: var(--yellow);
    font-size: 1.1rem;
    letter-spacing: 2px;
}

.reviews-rating {
    font-weight: 700;
    font-size: 1rem;
}

.reviews-count {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.reviews-grid {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.review-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px 18px;
}

.review-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 6px;
}

.review-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--green-light);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--green);
    flex-shrink: 0;
    overflow: hidden;
}

.review-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.review-name {
    font-weight: 700;
    font-size: 0.9rem;
}

.review-stars-display {
    color: var(--yellow);
    font-size: 0.8rem;
    letter-spacing: 1px;
    margin-bottom: 4px;
}

.review-text {
    font-size: 0.88rem;
    color: var(--text-secondary);
    line-height: 1.7;
}

.review-date {
    font-size: 0.72rem;
    color: var(--text-muted);
    margin-top: 4px;
}

.review-verified {
    display: inline-block;
    font-size: 0.7rem;
    color: var(--green);
    background: var(--green-light);
    border-radius: var(--radius-pill);
    padding: 2px 10px;
    margin-top: 4px;
    font-weight: 500;
}

/* ===== CUSTOMER PHOTOS ===== */
.customer-photos-section {
    margin: 24px 0;
}

.customer-photos-title {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 10px;
}

.customer-photos-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.customer-photos-grid a {
    display: block;
    aspect-ratio: 1 / 1;
    border-radius: var(--radius-sm);
    overflow: hidden;
    border: 1px solid var(--border);
}

.customer-photos-grid img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.2s;
}

.customer-photos-grid img:hover {
    transform: scale(1.05);
}

/* ===== FAQ SECTION ===== */
.faq-section {
    margin: 24px 0;
}

.faq-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 12px;
}

.faq-item {
    border-bottom: 1px solid var(--border);
}

.faq-question {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 0;
    background: none;
    border: none;
    cursor: pointer;
    font-family: var(--font);
    font-size: 0.93rem;
    font-weight: 600;
    color: var(--text);
    text-align: right;
    gap: 12px;
}

.faq-question:hover {
    color: var(--green);
}

.faq-arrow {
    font-size: 0.7rem;
    color: var(--text-muted);
    transition: transform 0.25s;
    flex-shrink: 0;
}

.faq-item.open .faq-arrow {
    transform: rotate(180deg);
}

.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, padding 0.3s ease;
    font-size: 0.88rem;
    color: var(--text-secondary);
    line-height: 1.8;
}

.faq-item.open .faq-answer {
    max-height: 300px;
    padding-bottom: 14px;
}

/* ===== FOOTER ===== */
.footer {
    text-align: center;
    font-size: 0.8rem;
    color: #aaa;
    margin-top: 32px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
    width: 100%;
    max-width: var(--max-width);
}

/* ===== STICKY CTA ===== */
.sticky-cta {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-top: 1px solid var(--border);
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    z-index: 1000;
    transform: translateY(100%);
    transition: transform 0.3s ease;
    box-shadow: 0 -4px 20px rgba(0,0,0,0.08);
}

.sticky-cta.visible {
    transform: translateY(0);
}

.sticky-cta-info {
    flex: 1;
    min-width: 0;
}

.sticky-cta-name {
    font-weight: 700;
    font-size: 0.9rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sticky-cta-price {
    font-weight: 700;
    color: var(--green);
    font-size: 0.85rem;
}

.sticky-cta-btn {
    padding: 10px 20px;
    background: var(--green);
    color: #ffffff;
    border: none;
    border-radius: var(--radius-sm);
    font-weight: 700;
    font-size: 0.9rem;
    cursor: pointer;
    font-family: var(--font);
    white-space: nowrap;
}

.sticky-cta-btn:hover {
    background: var(--green-hover);
}

.sticky-cta-close {
    position: absolute;
    top: -28px;
    right: 12px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #ffffff;
    border: 1px solid var(--border);
    cursor: pointer;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    box-shadow: 0 -2px 8px rgba(0,0,0,0.08);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 480px) {
    .store-header {
        font-size: 1.5rem;
    }
    .product-name {
        font-size: 1.25rem;
    }
    .gallery img {
        width: 90%;
    }
    .cta-button {
        font-size: 1.1rem;
        padding: 16px 20px;
    }
    .badge {
        font-size: 0.78rem;
        padding: 8px 12px;
    }
    .customer-photos-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .sticky-cta {
        padding: 10px 12px;
    }
    .sticky-cta-btn {
        padding: 8px 14px;
        font-size: 0.82rem;
    }
}
