/**
 * Serva Theme - Main Stylesheet
 *
 * @package Serva
 * @since 1.0.0
 */

/* ========================================
   Base Styles
   ======================================== */

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Vazirmatn', sans-serif;
    line-height: 1.7;
    color: #374151;
    background-color: #f9fafb;
    direction: rtl;
    text-align: right;
}

/* ========================================
   Typography
   ======================================== */

h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.3;
    color: #1f2937;
}

a {
    color: inherit;
    text-decoration: none;
    transition: color 0.3s ease;
}

/* ========================================
   Utilities
   ======================================== */

.line-clamp-1 {
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.line-clamp-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ========================================
   Scrollbar
   ======================================== */

::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f5f9;
}

::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* ========================================
   Selection
   ======================================== */

::selection {
    background-color: var(--serva-primary, #3b82f6);
    color: white;
}

/* ========================================
   Forms
   ======================================== */

input,
textarea,
select {
    font-family: inherit;
}

input:focus,
textarea:focus,
select:focus {
    outline: none;
}

/* ========================================
   Buttons
   ======================================== */

button {
    font-family: inherit;
    cursor: pointer;
}

.btn-primary {
    background-color: var(--serva-primary, #3b82f6);
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn-primary:hover {
    background-color: var(--serva-primary-dark, #2563eb);
}

/* ========================================
   Animations
   ======================================== */

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.animate-fadeIn {
    animation: fadeIn 0.5s ease forwards;
}

.animate-slideUp {
    animation: slideUp 0.5s ease forwards;
}

.animate-pulse {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* ========================================
   Loader
   ======================================== */

.serva-loader {
    position: fixed;
    inset: 0;
    background-color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity 0.3s ease;
}

.serva-loader.hidden {
    opacity: 0;
    pointer-events: none;
}

.serva-loader-spinner {
    width: 50px;
    height: 50px;
    border: 3px solid #f3f4f6;
    border-top-color: var(--serva-primary, #3b82f6);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ========================================
   Back to Top
   ======================================== */

#backToTop {
    transition: all 0.3s ease;
}

#backToTop.visible {
    opacity: 1;
    pointer-events: auto;
}

/* ========================================
   Mobile Menu
   ======================================== */

#mobileMenu {
    transition: opacity 0.3s ease;
}

#mobileMenu.active {
    display: block;
}

#mobileMenu > div {
    transform: translateX(100%);
    transition: transform 0.3s ease;
}

#mobileMenu.active > div {
    transform: translateX(0);
}

/* ========================================
   Mini Cart
   ======================================== */

#serva-mini-cart {
    transition: opacity 0.3s ease;
}

#serva-mini-cart.active {
    display: block;
}

#serva-mini-cart .serva-mini-cart-content {
    transform: translateX(-100%);
    transition: transform 0.3s ease;
}

#serva-mini-cart.active .serva-mini-cart-content {
    transform: translateX(0);
}

/* ========================================
   Product Gallery
   ======================================== */

.woocommerce-product-gallery {
    position: relative;
}

.woocommerce-product-gallery__wrapper {
    margin: 0;
}

.woocommerce-product-gallery__image {
    border-radius: 0.75rem;
    overflow: hidden;
}

.woocommerce-product-gallery__image img {
    width: 100%;
    height: auto;
}

.flex-control-thumbs {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
    padding: 0;
    list-style: none;
}

.flex-control-thumbs li {
    flex: 0 0 auto;
    width: 80px;
    height: 80px;
}

.flex-control-thumbs li img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 0.5rem;
    border: 2px solid transparent;
    cursor: pointer;
    transition: border-color 0.3s ease;
}

.flex-control-thumbs li img.flex-active,
.flex-control-thumbs li img:hover {
    border-color: var(--serva-primary, #3b82f6);
}

/* ========================================
   WooCommerce Notices
   ======================================== */

.woocommerce-message,
.woocommerce-info,
.woocommerce-error {
    padding: 1rem 1.5rem;
    margin-bottom: 1.5rem;
    border-radius: 0.5rem;
    border-right: 4px solid;
    background-color: #f9fafb;
}

.woocommerce-message {
    border-right-color: var(--serva-secondary, #10b981);
    background-color: #ecfdf5;
}

.woocommerce-info {
    border-right-color: var(--serva-primary, #3b82f6);
    background-color: #eff6ff;
}

.woocommerce-error {
    border-right-color: #ef4444;
    background-color: #fef2f2;
}

/* ========================================
   Quantity Input
   ======================================== */

.quantity {
    display: flex;
    align-items: center;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    overflow: hidden;
}

.quantity .qty {
    width: 50px;
    text-align: center;
    border: none;
    padding: 0.5rem;
    font-size: 1rem;
}

.quantity .qty::-webkit-inner-spin-button,
.quantity .qty::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* ========================================
   Star Rating
   ======================================== */

.star-rating {
    display: flex;
    gap: 2px;
    direction: ltr;
}

.star-rating span {
    color: #fbbf24;
}

/* ========================================
   Order Status Colors
   ======================================== */

.status-pending {
    background-color: #fef3c7;
    color: #92400e;
}

.status-processing {
    background-color: #dbeafe;
    color: #1e40af;
}

.status-on-hold {
    background-color: #fce7f3;
    color: #9d174d;
}

.status-completed {
    background-color: #d1fae5;
    color: #065f46;
}

.status-cancelled,
.status-refunded,
.status-failed {
    background-color: #fee2e2;
    color: #991b1b;
}

/* ========================================
   Prose (Content Styling)
   ======================================== */

.prose {
    max-width: 65ch;
}

.prose p {
    margin-bottom: 1.25em;
}

.prose h2 {
    font-size: 1.5em;
    margin-top: 2em;
    margin-bottom: 1em;
}

.prose h3 {
    font-size: 1.25em;
    margin-top: 1.6em;
    margin-bottom: 0.6em;
}

.prose ul,
.prose ol {
    padding-right: 1.5em;
    margin-bottom: 1.25em;
}

.prose li {
    margin-bottom: 0.5em;
}

.prose blockquote {
    border-right: 4px solid var(--serva-primary, #3b82f6);
    padding-right: 1rem;
    font-style: italic;
    color: #6b7280;
}

.prose img {
    border-radius: 0.5rem;
    margin: 1.5em 0;
}

.prose a {
    color: var(--serva-primary, #3b82f6);
}

.prose a:hover {
    text-decoration: underline;
}

/* ========================================
   Responsive
   ======================================== */

@media (max-width: 768px) {
    body {
        font-size: 14px;
    }
    
    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }
}

/* ========================================
   Print
   ======================================== */

@media print {
    header,
    footer,
    .sidebar,
    .back-to-top,
    .social-share {
        display: none !important;
    }
    
    body {
        background: white;
    }
    
    a {
        color: inherit;
    }
}





