/* Single Product Page - RTL (Right-to-Left) Persian */

/* Apply RTL direction to product page */
.product-detail-page {
    direction: rtl;
    text-align: right;
}

.sp {
    direction: rtl;
}

.sp__wrapper {
    grid-template-columns: 1fr 1.1fr;
    flex-direction: row-reverse;
}

/* Gallery */
.sp__gallery {
    margin-left: 80px;
    margin-right: 0;
}

.sp__badges {
    left: auto;
    right: 16px;
}

.sp__zoom-hint {
    left: 16px;
    right: auto;
}

.sp__thumbs-wrapper {
    flex-direction: row-reverse;
}

.sp__thumbs-nav--prev {
    order: 2;
}

.sp__thumbs-nav--next {
    order: 1;
}

.sp__thumbs {
    direction: rtl;
}

/* Product Info */
.sp__info {
    margin-right: 0;
    margin-left: 0;
}

/* Category, Title, Price */
.sp__category,
.sp__title,
.sp__price,
.sp__short-desc {
    text-align: right;
}

/* Rating */
.sp__rating {
    flex-direction: row-reverse;
}

.sp__stars {
    flex-direction: row-reverse;
}

/* Stock */
.sp__stock {
    flex-direction: row-reverse;
    justify-content: flex-end;
}

/* Add to Cart */
.sp__cart {
    direction: rtl;
}

.sp__cart form.cart {
    direction: rtl;
}

.sp__cart .variations tr {
    direction: rtl;
    text-align: right;
}

.sp__cart .variations label {
    text-align: right;
}

.sp__cart .variations select {
    direction: rtl;
    text-align: right;
    background-position: left 16px center;
}

.sp__cart .quantity {
    direction: rtl;
    flex-direction: row-reverse;
}

.sp__cart .quantity .qty {
    text-align: center;
}

/* Variations Radio Buttons RTL */
.sp__cart .variations {
    direction: rtl !important;
}

.sp__cart .variations tr {
    direction: rtl !important;
}

.sp__cart .variations label {
    text-align: right !important;
}

.sp__cart .variations .variation-radios {
    flex-direction: row-reverse !important;
    justify-content: flex-end !important;
}

.sp__cart .variations .variation-radio input[type="radio"]:checked + .variation-radio-label::before {
    right: auto !important;
    left: -8px !important;
}

.sp__cart .variations .variation-radio.variation-color input[type="radio"]:checked + .variation-radio-label::before {
    left: 50% !important;
    right: auto !important;
    transform: translate(-50%, -50%) !important;
}

.sp__cart .reset_variations {
    text-align: right !important;
}

/* Short Description RTL */
.sp__short-desc {
    border-left: none !important;
    border-right: 4px solid #000 !important;
    padding: 28px 24px 28px 28px !important;
    text-align: right !important;
}

.sp__short-desc::before {
    right: auto !important;
    left: 0 !important;
    transform: translate(-30%, -30%) !important;
}

.sp__short-desc::after {
    right: auto !important;
    left: 16px !important;
}

/* Action Buttons */
.sp__actions {
    flex-direction: row-reverse;
}

.sp__action {
    flex-direction: row-reverse;
}

.sp__action:nth-child(3) {
    justify-content: center;
    text-align: center;
}

.sp__action svg {
    order: 2;
    margin-left: 8px;
    margin-right: 0;
}

.sp__action span {
    order: 1;
}

/* Product Meta */
.sp__meta-row {
    flex-direction: row-reverse;
    justify-content: flex-start;
}

.sp__meta-label {
    margin-left: 8px;
    margin-right: 0;
}

/* Guarantees */
.sp__guarantees {
    direction: rtl;
    justify-content: flex-end;
}

.sp__guarantee {
    flex-direction: row-reverse;
    justify-content: flex-end;
}

.sp__guarantee svg {
    margin-left: 10px;
    margin-right: 0;
    order: 2;
}

.sp__guarantee span {
    order: 1;
}

/* Product Details/Tabs */
.sp__details {
    direction: rtl;
    text-align: right;
}

.sp__tabs-nav {
    justify-content: flex-end;
    flex-direction: row-reverse;
}

.sp__tab-btn {
    text-align: right;
}

.sp__tab-content {
    text-align: right;
}

/* Specifications Table */
.sp__specs-table {
    text-align: right;
}

.sp__specs-table th,
.sp__specs-table td {
    text-align: right;
}

/* Modal */
.sp__modal {
    direction: rtl;
}

.sp__modal-content {
    direction: rtl;
    text-align: center;
}

.sp__modal-close {
    left: 16px;
    right: auto;
}

.sp__modal-title {
    text-align: center;
}

.sp__share-links {
    justify-content: center;
}

.sp__share-link {
    direction: rtl;
}

/* Lightbox */
.sp__lightbox {
    direction: ltr;
}

.sp__lightbox-nav--prev {
    left: auto;
    right: 24px;
}

.sp__lightbox-nav--next {
    right: auto;
    left: 24px;
}

.sp__lightbox-close {
    left: 24px;
    right: auto;
}

/* Stock Status */
.sp__stock--instock::before,
.sp__stock--outofstock::before,
.sp__stock--onbackorder::before {
    margin-left: 0;
    margin-right: 8px;
}

/* Comments/Reviews */
.woocommerce-Reviews {
    direction: rtl;
    text-align: right;
}

.comment-form {
    direction: rtl;
}

.comment-form label,
.comment-form textarea,
.comment-form input {
    direction: rtl;
    text-align: right;
}

/* WooCommerce Elements */
.woocommerce .col2-set .col-1,
.woocommerce .col2-set .col-2 {
    direction: rtl;
    text-align: right;
}

.woocommerce table th {
    text-align: right;
}

.woocommerce table td {
    text-align: right;
}

/* Links in RTL context */
.sp__category a,
.sp__meta-value a,
a {
    direction: inherit;
}

/* Flexbox RTL adjustments */
.sp__guarantee {
    justify-content: flex-end;
}

/* Mobile adjustments */
@media (max-width: 767.98px) {
    .sp__action {
        justify-content: center;
    }
}

@media (max-width: 479.98px) {
    .sp__action {
        justify-content: center;
    }
}

/* Input fields */
input[type=\"text\"],
input[type=\"email\"],
input[type=\"number\"],
textarea,
select {
    direction: rtl;
    text-align: right;
}

input[type=\"text\"]::placeholder,
textarea::placeholder {
    text-align: right;
}

/* ============================================
   RESPONSIVE RTL ADJUSTMENTS
   ============================================ */

/* Tablet Landscape (992px - 1024px) */
@media (max-width: 1024px) {
    .sp__wrapper {
        grid-template-columns: 1fr;
    }
    
    .sp__gallery {
        margin-left: 0;
        margin-right: 0;
        max-width: 700px;
        margin-left: auto;
        margin-right: auto;
    }
}

/* Tablet Portrait (768px - 991px) */
@media (max-width: 991.98px) {
    .sp__gallery {
        margin-left: 0;
        margin-right: 0;
    }
}

/* Mobile Landscape & Portrait (480px - 767px) */
@media (max-width: 767.98px) {
    .sp__action {
        flex-direction: row-reverse;
    }
    
    .sp__action span {
        display: none;
    }
    
    .sp__guarantee {
        flex: 1 1 100%;
        justify-content: flex-start;
    }
    
    .sp__tabs-nav {
        flex-direction: row-reverse;
        justify-content: flex-start;
    }
    
    .sp__actions {
        flex-wrap: wrap;
    }
}

/* Mobile Small (320px - 479px) */
@media (max-width: 479.98px) {
    .sp__guarantee {
        flex: 1 1 100%;
        justify-content: flex-start;
    }
    
    .sp__modal-content {
        width: 95%;
        padding: 28px 20px;
    }
    
    .sp__modal-close {
        left: 16px;
        right: auto;
    }
    
    .sp__actions {
        flex-wrap: wrap;
    }
}

/* ============================================
   RELATED PRODUCTS RTL
   ============================================ */

.sp__related {
    direction: rtl;
}

.sp__related-grid {
    direction: rtl;
}

.sp__related-badge {
    left: auto;
    right: 15px;
}

.sp__related-content {
    text-align: center;
    direction: rtl;
}

.sp__related-price {
    flex-direction: row-reverse;
    justify-content: center;
}

.sp__related-price del {
    margin-right: 0;
    margin-left: 5px;
}

/* Responsive RTL adjustments for related products */
@media (max-width: 1199.98px) {
    .sp__related-image-wrapper {
        height: 350px !important;
    }
    
    .sp__related-view {
        font-size: 12px !important;
        padding: 10px 20px !important;
    }
}

@media (max-width: 991.98px) {
    .sp__related-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }
    
    .sp__related-image-wrapper {
        height: 360px !important;
    }
    
    .sp__related-view {
        font-size: 12px !important;
        padding: 10px 20px !important;
    }
}

@media (max-width: 767.98px) {
    .sp__related-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }
    
    .sp__related-image-wrapper {
        height: 280px !important;
    }
    
    .sp__related-view {
        font-size: 12px !important;
        padding: 10px 20px !important;
    }
}

@media (max-width: 480px) {
    .sp__related-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }
    
    .sp__related-image-wrapper {
        height: 240px !important;
    }
    
    .sp__related-view {
        font-size: 11px !important;
        padding: 8px 16px !important;
    }
}
