@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@400;500;600;700;800&display=swap');

:root { 
    --primary: #FF6F15;       
    --primary-hover: #e86513; 
    --accent: #3D4658;        
    --bg-main: #e1e1df;       
    --bg-card: #FFFFFF; 
    --text-main: #3D4658; 
    --border: #c3c6cb;        
    --radius-md: 16px; 
}

* { box-sizing: border-box; margin: 0; padding: 0; font-family: 'Cairo', sans-serif; -webkit-tap-highlight-color: transparent; }

body { 
    background: var(--bg-main); 
    color: var(--text-main); 
    display: flex; 
    flex-direction: column; 
    min-height: 100dvh; 
    padding-bottom: 54px;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch; 
}

.main-wrapper { 
    width: 100%; 
    padding: 40px 20px; 
    display: flex; 
    justify-content: center; 
    flex: 1; 
    min-height: 0; 
}

.container { 
    width: 100%; 
    max-width: 800px; 
    background: var(--bg-card); 
    padding: 40px; 
    border-radius: var(--radius-md); 
    box-shadow: 0 10px 30px rgba(61,70,88,0.08); 
    position: relative; 
}

header { text-align: center; margin-bottom: 32px; }
header h1 { font-size: clamp(28px, 5vw, 36px); margin-bottom: 8px; font-weight: 800; color: var(--primary); }
header p { color: #646b79; font-size: clamp(14px, 3vw, 16px); margin-bottom: 30px; font-weight: 500; }

/* --- Carousel UI --- */
.carousel-nav { display: flex; align-items: center; justify-content: center; gap: 16px; margin-bottom: 16px; }
.nav-btn { background: #fff; border: 1px solid var(--border); border-radius: 50%; width: 36px; height: 36px; display: flex; align-items: center; justify-content: center; cursor: pointer; color: var(--text-main); font-weight: bold; transition: all 0.2s; box-shadow: 0 2px 4px rgba(0,0,0,0.05); }
.nav-btn:hover { border-color: var(--primary); color: var(--primary); transform: scale(1.05); }
.nav-btn:active { transform: scale(0.95); }
.counter-text { font-size: 14px; font-weight: 700; color: #646b79; letter-spacing: 0.05em; text-transform: uppercase; }

.section-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.section-header h3 { font-size: 20px; font-weight: 700; color: var(--text-main); }
.mt-2 { margin-top: 32px; }

.badge { background: var(--bg-main); padding: 4px 12px; border-radius: 20px; font-weight: 700; font-size: 13px; border: 1px solid var(--border); color: var(--accent); }

/* --- Product & Reviews UI --- */
.product-card { display: flex; gap: 20px; padding: 20px; background: #F7F7F5; border-radius: 12px; border: 1px solid var(--border); transition: all 0.3s ease; }
.product-image-placeholder { width: 140px; height: 100px; border-radius: 8px; display: flex; align-items: center; justify-content: center; font-size: 40px; flex-shrink: 0; box-shadow: inset 0 2px 8px rgba(0,0,0,0.1); }
.product-details h2 { font-size: 18px; font-weight: 800; color: var(--text-main); margin-bottom: 4px; line-height: 1.3; }
.product-details .rating { color: #f5a623; font-size: 15px; margin-bottom: 4px; }
.product-details .rating span { color: #646b79; font-size: 13px; }
.product-details .price { font-size: 22px; font-weight: 800; color: #10B981; }

.reviews-list { display: flex; flex-direction: column; gap: 12px; max-height: 350px; overflow-y: auto; padding-right: 8px; scroll-behavior: smooth; }
.reviews-list::-webkit-scrollbar { width: 6px; }
.reviews-list::-webkit-scrollbar-thumb { background: var(--border); border-radius: 10px; }
.review-item { padding: 16px; border: 1px solid var(--border); border-radius: 12px; background: #fff; box-shadow: 0 2px 6px rgba(0,0,0,0.03); animation: fadeIn 0.3s ease; }
.review-meta { display: flex; justify-content: space-between; margin-bottom: 6px; }
.review-meta .author { font-weight: 700; font-size: 14px; color: var(--text-main); }
.review-meta .date { font-size: 12px; color: #a6aab2; font-weight: 600; }
.review-body { font-size: 14px; line-height: 1.6; color: #646b79; font-weight: 500; }

/* --- Action Bar & Results --- */
.action-bar { margin-top: 32px; text-align: center; }
.primary-btn { border: none; padding: 16px 32px; font-size: 18px; font-weight: 800; border-radius: 30px; cursor: pointer; transition: 0.2s; width: 100%; max-width: 400px; background: var(--primary); color: #fff; box-shadow: 0 4px 15px rgba(255,111,21,0.3); }
.primary-btn:disabled { background: var(--border); color: #fff; cursor: not-allowed; box-shadow: none; }
.primary-btn:active:not(:disabled) { transform: scale(0.98); }

.result-container { margin-top: 32px; border-top: 1px solid var(--border); padding-top: 32px; }

.loading-state { text-align: center; padding: 20px; }
.loading-state p { font-size: 14px; font-weight: 600; color: #646b79; margin-bottom: 12px; }
.progress-bar-bg { width: 100%; max-width: 400px; height: 8px; background: var(--border); border-radius: 10px; margin: 0 auto; overflow: hidden; }
.progress-bar-fill { width: 0%; height: 100%; background: var(--primary); transition: width 0.3s ease-out; }
.loader { width: 40px; height: 40px; border: 4px solid var(--border); border-top: 4px solid var(--primary); border-radius: 50%; animation: spin 1s linear infinite; margin: 0 auto 12px; }
.loading-state p.loading-hint { font-size: 13px; color: #a6aab2; margin-top: 16px; margin-bottom: 0; font-weight: 500; max-width: 400px; margin-inline: auto; line-height: 1.5; }

.summary-box { background: rgba(255,111,21,0.05); border: 1px solid rgba(255,111,21,0.2); border-left: 4px solid var(--primary); border-radius: 8px; padding: 20px; text-align: left; }
.summary-box p { font-size: 15px; font-weight: 500; line-height: 1.7; color: var(--text-main); white-space: pre-wrap; }

.hidden { display: none !important; }

@keyframes spin { 100% { transform: rotate(360deg); } }
@keyframes popIn { 0% { transform: scale(0.9); opacity: 0;} 100% { transform: scale(1); opacity: 1;} }
@keyframes fadeIn { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: none; } }
.shadow-pop { animation: popIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275); }

/* --- Mobile Responsiveness --- */
@media (max-width: 600px) {
    .main-wrapper { padding: 0; }
    .container { padding: 24px 20px 100px 20px; border-radius: 0; box-shadow: none; }
    .product-card { flex-direction: column; text-align: center; align-items: center; }
    .product-image-placeholder { width: 100%; height: 140px; }
    .primary-btn { max-width: 100%; }
}
