/* ---- Gallery ---- */
.product-gallery-wrap { position:relative; }
.main-img-container {
    border-radius:20px; overflow:hidden;
    background:linear-gradient(135deg,#FFF5F7,#F0FFFE);
    aspect-ratio:1; display:flex; align-items:center; justify-content:center;
    position:relative; cursor:zoom-in;
    box-shadow:0 8px 30px rgba(255,107,138,.12);
}
.main-img-container img { width:100%; height:100%; object-fit:cover; transition:transform .4s; }
.main-img-container:hover img { transform:scale(1.08); }
.current-color-label {
    position:absolute; bottom:12px; right:12px;
    background:rgba(0,0,0,.55); color:white;
    padding:4px 12px; border-radius:50px; font-size:12px; font-weight:700;
    backdrop-filter:blur(6px); display:none;
}
.thumb-gallery { display:flex; gap:10px; flex-wrap:wrap; margin-top:15px; justify-content: flex-start; }
.thumb-item {
    width:80px; height:80px; border-radius:12px; overflow:hidden;
    border:2px solid var(--border); cursor:pointer; transition:all .25s;
    background:var(--bg-light); display: flex; align-items: center; justify-content: center;
}
.thumb-item:hover { border-color:var(--primary); }
.thumb-item.active { border-color:var(--primary); box-shadow:0 0 0 3px rgba(255,107,138,.25); }
.thumb-item img { width:100%; height:100%; object-fit:cover; }
.thumb-emoji { display:flex; align-items:center; justify-content:center; font-size:30px; height:100%; }

/* ---- Title & Price ---- */
.product-title { font-size:24px; font-weight:900; font-family:'Tajawal',sans-serif; color:var(--dark); margin-bottom:8px; line-height:1.3; }
.price-block { display:flex; align-items:center; gap:10px; flex-wrap:wrap; padding:14px 18px; background:linear-gradient(135deg,#FFF5F7,#FFF9F0); border-radius:14px; }
.price-main { font-size:30px; font-weight:900; color:var(--primary); font-family:'Tajawal',sans-serif; }
.price-range-sep { color:var(--text-light); font-size:18px; }
.price-max { font-size:20px; font-weight:700; color:var(--text-light); }
.price-original { font-size:16px; color:var(--text-light); text-decoration:line-through; }
.discount-tag { background:var(--primary); color:white; padding:3px 10px; border-radius:50px; font-size:13px; font-weight:700; }

/* ---- Options ---- */
.option-group { margin-bottom:22px; }
.option-label { font-weight:700; color:var(--dark); font-size:15px; margin-bottom:10px; display:flex; align-items:center; gap:6px; flex-wrap:wrap; }
.option-selected { color:var(--primary); font-weight:900; }
.size-guide-link { font-size:12px; color:var(--secondary); font-weight:600; cursor:pointer; }
.option-error { color:#E74C3C; font-size:13px; margin-top:6px; font-weight:600; }

/* ---- Color Swatches ---- */
.color-selector { display:flex; gap:10px; flex-wrap:wrap; align-items:center; }
.color-swatch {
    width:40px; height:40px; border-radius:50%;
    border:3px solid transparent; cursor:pointer;
    transition:all .25s; position:relative;
    box-shadow:0 2px 8px rgba(0,0,0,.2);
}
.color-swatch:hover { transform:scale(1.15); box-shadow:0 4px 12px rgba(0,0,0,.25); }
.color-swatch.selected {
    border-color:#333 !important;
    transform:scale(1.1);
    box-shadow:0 0 0 4px rgba(255,107,138,.35);
}
.color-swatch.out-of-stock { opacity:0.45; cursor:not-allowed; }
.color-swatch.out-of-stock::after {
    content:''; position:absolute; inset:0; border-radius:50%;
    background:repeating-linear-gradient(-45deg,transparent,transparent 3px,rgba(0,0,0,.3) 3px,rgba(0,0,0,.3) 4px);
}
.swatch-cross { position:absolute; inset:0; display:flex; align-items:center; justify-content:center; color:rgba(255,255,255,.8); font-size:14px; font-weight:900; }

/* ---- Size Buttons ---- */
.size-selector { display:flex; gap:8px; flex-wrap:wrap; }
.size-btn {
    padding:8px 16px; border:2px solid var(--border);
    border-radius:10px; font-weight:700; font-size:13px;
    cursor:pointer; transition:all .2s; background:var(--white);
    color:var(--text); white-space:nowrap;
}
.size-btn:hover:not(.disabled) { border-color:var(--primary); color:var(--primary); }
.size-btn.selected { background:var(--primary); color:white; border-color:var(--primary); }
.size-btn.out-of-stock { opacity:.45; cursor:not-allowed; text-decoration:line-through; background:var(--bg-gray); }
.size-btn.low-stock { border-color:#FF9500; color:#FF9500; }
.size-btn.size-btn-shoe {
    min-width: 76px; padding: 8px 10px; white-space: normal;
    display: inline-flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 3px; line-height: 1.15; text-align: center;
}
.size-shoe-eu { font-weight: 800; font-size: 15px; display: block; }
.size-shoe-cm { font-size: 11px; font-weight: 600; opacity: 0.82; display: block; }
.size-btn.size-btn-shoe.selected .size-shoe-cm { opacity: 0.95; }
.shoe-size-tip, .age-size-tip { background: linear-gradient(135deg, #f0f9ff, #fff8f0); border-radius: 10px; padding: 8px 12px; border: 1px solid var(--border); }
.shoe-size-guide-table td { vertical-align: middle; }
[data-theme="dark"] .shoe-size-tip, [data-theme="dark"] .age-size-tip { background: #252840; border-color: #3A3F58; }
.size-btn.size-btn-age { min-width: 58px; }

/* ---- Quantity ---- */
.qty-row { display:flex; align-items:center; gap:14px; }
.stock-hint { font-size:12px; font-weight:600; }

/* ---- Action Buttons ---- */
.action-btns { display:flex; gap:12px; flex-wrap:wrap; }
.btn-add-main {
    flex:1; padding:14px; background:linear-gradient(135deg,var(--primary),#e0547a);
    color:white; border:none; border-radius:14px;
    font-family:'Cairo',sans-serif; font-size:16px; font-weight:700;
    cursor:pointer; transition:all .25s; min-width:160px;
}
.btn-add-main:hover { transform:translateY(-2px); box-shadow:0 8px 25px rgba(255,107,138,.4); }
.btn-add-main:disabled { background:#ccc; cursor:not-allowed; transform:none; box-shadow:none; }
.btn-buy-now {
    flex:1; padding:14px; background:linear-gradient(135deg,#FF9500,#FF6B00);
    color:white; border:none; border-radius:14px;
    font-family:'Cairo',sans-serif; font-size:16px; font-weight:700;
    cursor:pointer; transition:all .25s; min-width:160px;
}
.btn-buy-now:hover { transform:translateY(-2px); box-shadow:0 8px 25px rgba(255,150,0,.4); }
.btn-wishlist {
    background:transparent; border:2px solid var(--border); color:var(--text);
    padding:10px 20px; border-radius:12px;
    font-family:'Cairo',sans-serif; font-weight:700; font-size:14px;
    cursor:pointer; transition:all .25s;
}
.btn-wishlist:hover { border-color:var(--primary); color:var(--primary); }
.btn-wishlist.active { background:#FFF5F7; border-color:var(--primary); color:var(--primary); }
.btn-whatsapp {
    background:transparent; border:2px solid #25D366; color:#25D366;
    padding:10px 20px; border-radius:12px;
    font-family:'Cairo',sans-serif; font-weight:700; font-size:14px;
    cursor:pointer; transition:all .25s; text-decoration:none; display:inline-block;
}
.btn-whatsapp:hover { background:#25D366; color:white; }

/* ---- Variant info chips ---- */
.variant-info { margin-top:8px; }
.info-chip { padding:5px 14px; border-radius:50px; font-size:12px; font-weight:700; background:var(--bg-light); color:var(--text); }

/* ---- Features ---- */
.product-features { display:flex; flex-direction:column; gap:8px; padding:16px; background:var(--bg-light); border-radius:14px; }
.feat-row { display:flex; align-items:center; gap:10px; font-size:13px; color:var(--text); }
.feat-row i { color:var(--primary); width:18px; text-align:center; font-size:15px; }

/* ---- Description ---- */
.product-desc-block { border:1px solid var(--border); border-radius:14px; overflow:hidden; }
.desc-toggle {
    width:100%; padding:14px 18px; background:var(--bg-light);
    border:none; cursor:pointer; font-family:'Cairo',sans-serif;
    font-weight:700; font-size:15px; color:var(--dark);
    display:flex; justify-content:space-between; align-items:center;
    transition:all .2s;
}
.desc-toggle:hover { background:var(--border); }
.desc-toggle i { transition:transform .3s; }
.desc-toggle.open i { transform:rotate(180deg); }
.desc-content { padding:30px 0; color:var(--text); line-height:1.9; font-size:14px; display:block; }

/* Rich text styles for description */
.desc-content h1, .desc-content h2, .desc-content h3, .desc-content h4, .desc-content h5, .desc-content h6 {
    font-family: 'Tajawal', sans-serif;
    font-weight: 900;
    color: var(--dark);
    margin-top: 24px;
    margin-bottom: 12px;
}
.desc-content h1 { font-size: 26px; }
.desc-content h2 { font-size: 22px; }
.desc-content h3 { font-size: 20px; }
.desc-content h4 { font-size: 18px; }
.desc-content h5, .desc-content h6 { font-size: 16px; }

.desc-content p { margin-bottom: 14px; }

.desc-content ul, .desc-content ol {
    margin: 16px 0;
    padding-right: 30px;
}
.desc-content ul { list-style-type: disc; }
.desc-content ol { list-style-type: decimal; }
.desc-content li { margin-bottom: 8px; }

.desc-content img {
    max-width: 100%;
    height: auto;
    border-radius: 12px;
    margin: 16px 0;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.desc-content blockquote {
    border-right: 4px solid var(--primary);
    padding: 14px 20px;
    margin: 20px 0;
    background: var(--bg-light);
    border-radius: 8px;
    color: var(--text);
    font-style: italic;
}

.desc-content a {
    color: var(--primary);
    text-decoration: underline;
    font-weight: 600;
}

.desc-content code {
    background: var(--bg-light);
    padding: 2px 8px;
    border-radius: 4px;
    font-family: monospace;
    font-size: 13px;
}

.desc-content pre {
    background: var(--bg-light);
    padding: 14px 18px;
    border-radius: 8px;
    overflow-x: auto;
    margin: 16px 0;
}

.desc-content pre code {
    padding: 0;
    background: transparent;
}

/* ---- Sticky gallery for large screens only ---- */
@media (min-width: 992px) {
    .product-gallery-wrap.sticky-top {
        position: sticky;
        align-self: flex-start;
        z-index: 100;
    }
    /* Add margin below product details to separate from description */
    .product-detail-wrap {
        margin-bottom: 40px;
    }
}

/* ---- Responsive behavior for all screen sizes ---- */
@media (max-width: 991px) {
    /* Disable sticky on small screens */
    .product-gallery-wrap.sticky-top {
        position: relative !important;
        top: 0 !important;
    }
}

/* ---- Responsive Design for Mobile ---- */
@media (max-width: 991px) {
    .product-gallery-wrap.sticky-top,
    .product-detail-wrap.sticky-top { position: relative !important; top: 0 !important; }
}

@media (max-width: 768px) {
    /* Gallery adjustments */
    .main-img-container {
        border-radius: 16px;
    }
    
    .thumb-gallery {
        gap: 8px;
        justify-content: center;
    }
    
    .thumb-item {
        width: 60px;
        height: 60px;
        border-radius: 10px;
    }
    
    .thumb-emoji {
        font-size: 24px;
    }
    
    /* Product title */
    .product-title {
        font-size: 20px;
    }
    
    /* Price block */
    .price-main {
        font-size: 24px;
    }
    
    .price-original {
        font-size: 14px;
    }
    
    .price-max {
        font-size: 16px;
    }
    
    /* Color swatches */
    .color-swatch {
        width: 36px;
        height: 36px;
    }
    
    /* Size buttons */
    .size-btn {
        padding: 7px 14px;
        font-size: 12px;
    }
    
    /* Action buttons */
    .action-btns {
        flex-direction: column;
    }
    
    .btn-add-main, .btn-buy-now {
        width: 100%;
        min-width: 100%;
    }
    
    /* Features */
    .product-features {
        padding: 12px;
    }
    
    .feat-row {
        font-size: 12px;
    }
}

@media (max-width: 576px) {
    /* Even smaller gallery thumbs */
    .thumb-item {
        width: 50px;
        height: 50px;
        border-radius: 8px;
    }
    
    .thumb-gallery {
        gap: 6px;
    }
    
    /* Product title even smaller */
    .product-title {
        font-size: 18px;
    }
    
    /* Price adjustments */
    .price-main {
        font-size: 22px;
    }
    
    .price-block {
        padding: 12px 14px;
    }
}

/* ---- Dark mode ---- */
[data-theme="dark"] .main-img-container { background:linear-gradient(135deg,#2A1530,#0A2020); }
[data-theme="dark"] .price-block { background:linear-gradient(135deg,#2A0A15,#1A1000); }
[data-theme="dark"] .size-btn { background:#252840; border-color:#3A3F58; color:#D0D4E8; }
[data-theme="dark"] .product-features { background:#252840; }
[data-theme="dark"] .desc-toggle { background:#252840; color:#E8ECF8; }
[data-theme="dark"] .info-chip { background:#252840; }
[data-theme="dark"] .thumb-item { background:#252840; border-color:#3A3F58; }

/* ---- Floating Sticky Widget ---- */
.floating-add-widget {
    position: fixed;
    top: 120px;
    right: 0;
    left: auto;
    background: linear-gradient(145deg, #ffffff, #fff8fa);
    border-radius: 20px;
    box-shadow: 
        0 10px 30px rgba(255,107,138,.15),
        0 0 0 1px rgba(255,107,138,.08);
    padding: 18px;
    z-index: 999;
    max-width: 290px;
    opacity: 0;
    transform: translateY(30px) scale(0.95);
    transition: all .4s cubic-bezier(0.25, 0.8, 0.25, 1);
    pointer-events: none;
    overflow: hidden;
}

.floating-add-widget::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
}

.floating-add-widget.show {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

.floating-content {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.floating-product-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--text);
    line-height: 1.4;
    margin-bottom: 2px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.floating-price {
    display: flex;
    align-items: center;
    gap: 10px;
}

.floating-price-main {
    font-size: 24px;
    font-weight: 900;
    color: var(--primary);
    font-family: 'Tajawal', sans-serif;
}

.floating-price-original {
    font-size: 15px;
    color: var(--text-light);
    text-decoration: line-through;
    display: none;
}

.floating-price.has-discount .floating-price-original {
    display: block;
}

.floating-divider {
    height: 1px;
    background: var(--border);
    margin: 2px 0;
}

.floating-btns {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.floating-btn-cart {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, var(--primary), #e0547a);
    color: white;
    border: none;
    border-radius: 14px;
    font-family: 'Cairo', sans-serif;
    font-size: 15px;
    font-weight: 800;
    cursor: pointer;
    transition: all .25s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 4px 12px rgba(255,107,138,.35);
}

.floating-btn-cart:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(255,107,138,.5);
}

.floating-btn-cart:active {
    transform: translateY(-1px);
}

.floating-btn-cart:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

.floating-sub-btns {
    display: flex;
    gap: 8px;
}

.floating-btn-sub {
    flex: 1;
    padding: 10px;
    background: transparent;
    border: 2px solid var(--border);
    color: var(--text);
    border-radius: 12px;
    font-family: 'Cairo', sans-serif;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: all .2s;
}

.floating-btn-sub:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: rgba(255,107,138,.05);
}

/* Disable floating widget on small screens */
@media (max-width: 991px) {
    .floating-add-widget {
        display: none !important;
    }
}

/* Dark mode for floating widget */
[data-theme="dark"] .floating-add-widget {
    background: linear-gradient(145deg, #252840, #1a1d2e);
    box-shadow: 
        0 10px 30px rgba(0,0,0,.4),
        0 0 0 1px rgba(255,107,138,.15);
}
[data-theme="dark"] .floating-divider {
    background: #3a3f58;
}

/* ============ تقيمات المنتجات ============ */
.reviews-summary-card {
    background: #fff;
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
}

.rating-display {
    text-align: center;
}

.rating-number {
    font-size: 48px;
    font-weight: 900;
    color: var(--primary);
    display: block;
    line-height: 1;
}

.stars-display {
    display: flex;
    justify-content: center;
    gap: 4px;
    margin: 8px 0;
}

.stars-display i {
    color: #ffc107;
    font-size: 18px;
}

.total-reviews {
    color: var(--text-light);
    font-size: 14px;
}

.rating-bar-item {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.rating-bar-label {
    font-size: 13px;
    min-width: 50px;
}

.rating-bar-track {
    flex: 1;
    height: 8px;
    background: #f0f0f0;
    border-radius: 4px;
    overflow: hidden;
}

.rating-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #ffc107, #ff9800);
    border-radius: 4px;
    transition: width 0.5s ease;
}

.rating-bar-count {
    font-size: 13px;
    color: var(--text-light);
    min-width: 30px;
    text-align: left;
}

.btn-add-review {
    background: linear-gradient(135deg, var(--primary), #e0547a);
    color: white;
    border: none;
    padding: 12px;
    border-radius: 12px;
    font-family: 'Cairo', sans-serif;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-add-review:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255,107,138,.4);
}

/* قائمة التقيمات */
.review-card {
    background: #fff;
    border-radius: 14px;
    padding: 20px;
    margin-bottom: 16px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
    border: 1px solid #f0f0f0;
}

.review-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.review-user {
    display: flex;
    align-items: center;
    gap: 10px;
}

.review-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 800;
    font-size: 18px;
}

.review-user-name {
    font-weight: 700;
    color: var(--dark);
}

.review-rating {
    display: flex;
    gap: 2px;
}

.review-rating i {
    color: #ffc107;
    font-size: 14px;
}

.review-title {
    font-weight: 700;
    color: var(--dark);
    margin-bottom: 6px;
}

.review-text {
    color: var(--text);
    line-height: 1.7;
    font-size: 14px;
}

.review-date {
    font-size: 12px;
    color: var(--text-light);
    margin-top: 8px;
}

/* مودال التقيم */
.rating-input {
    display: flex;
    gap: 8px;
    justify-content: flex-start;
}

.rating-star {
    font-size: 32px;
    cursor: pointer;
    color: #ddd;
    transition: all 0.2s;
}

.rating-star:hover,
.rating-star.active {
    color: #ffc107;
    transform: scale(1.1);
}

.reviews-empty {
    text-align: center;
    padding: 40px 0;
}

.reviews-empty i {
    font-size: 60px;
    color: var(--text-light);
    margin-bottom: 16px;
}

.reviews-empty h4 {
    color: var(--text);
    margin-bottom: 8px;
}

/* Own review highlight */
.review-card.border-primary {
    border: 2px solid var(--primary) !important;
}

/* Dark mode للقيمات */
[data-theme="dark"] .reviews-summary-card {
    background: #252840;
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
    border: 1px solid #3a3f58;
}

[data-theme="dark"] .review-card {
    background: #252840;
    border: 1px solid #3a3f58;
}

[data-theme="dark"] .review-card.border-primary {
    border: 2px solid var(--primary) !important;
}

[data-theme="dark"] .rating-bar-track {
    background: #1e2130;
}

[data-theme="dark"] .review-user-name,
[data-theme="dark"] .review-title {
    color: #f0f0f0;
}

[data-theme="dark"] .review-text {
    color: #ccc;
}

[data-theme="dark"] .rating-bar-label,
[data-theme="dark"] .rating-bar-count {
    color: #aaa;
}

/* ---- Product Specifications Card Grid ---- */
.product-specs-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
    margin: 20px 0;
    direction: rtl;
}
.spec-card {
    background: var(--bg-light, #f8fafc);
    border: 1px solid var(--border, #e2e8f0);
    border-radius: 12px;
    padding: 14px 16px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    gap: 4px;
    position: relative;
    overflow: hidden;
    text-align: right;
}
[data-theme="dark"] .spec-card {
    background: #252840;
    border-color: #3a3f58;
}
.spec-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
    border-color: var(--primary);
}
.spec-card-prop {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-light, #64748b);
    text-transform: uppercase;
}
[data-theme="dark"] .spec-card-prop {
    color: #a0a8c0;
}
.spec-card-val {
    font-size: 13.5px;
    font-weight: 600;
    color: var(--dark, #0f172a);
    line-height: 1.4;
}
[data-theme="dark"] .spec-card-val {
    color: #cbd5e1;
}

/* For English specific layouts */
.product-specs-cards-en {
    direction: ltr !important;
}
.product-specs-cards-en .spec-card {
    text-align: left !important;
}


