/* Common Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Page Loading Styles */
.page-loading {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #8B4513, #A0522D);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

.page-loading.hidden {
    opacity: 0;
    visibility: hidden;
}

.loading-spinner {
    width: 60px;
    height: 60px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top: 4px solid #FFD700;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

.loading-text {
    color: white;
    font-size: 1.2rem;
    font-weight: 600;
    text-align: center;
    margin-bottom: 10px;
}

.loading-subtitle {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.9rem;
    text-align: center;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Loading dots animation */
.loading-dots {
    display: inline-block;
    position: relative;
    width: 80px;
    height: 20px;
}

.loading-dots div {
    position: absolute;
    top: 0;
    width: 13px;
    height: 13px;
    border-radius: 50%;
    background: #FFD700;
    animation-timing-function: cubic-bezier(0, 1, 1, 0);
}

.loading-dots div:nth-child(1) {
    left: 8px;
    animation: loading-dots1 0.6s infinite;
}

.loading-dots div:nth-child(2) {
    left: 8px;
    animation: loading-dots2 0.6s infinite;
}

.loading-dots div:nth-child(3) {
    left: 32px;
    animation: loading-dots2 0.6s infinite;
}

.loading-dots div:nth-child(4) {
    left: 56px;
    animation: loading-dots3 0.6s infinite;
}

@keyframes loading-dots1 {
    0% { transform: scale(0); }
    100% { transform: scale(1); }
}

@keyframes loading-dots3 {
    0% { transform: scale(1); }
    100% { transform: scale(0); }
}

@keyframes loading-dots2 {
    0% { transform: translate(0, 0); }
    100% { transform: translate(24px, 0); }
}

/* Policy Modal Styles */
.policy-modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
}

.policy-modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

.policy-modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 0;
    border-radius: 15px;
    width: 90%;
    max-width: 800px;
    max-height: 80vh;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideIn 0.3s ease;
}

.policy-modal-header {
    background: linear-gradient(135deg, #8B4513, #A0522D);
    color: white;
    padding: 20px 30px;
    border-radius: 15px 15px 0 0;
    position: relative;
}

.policy-modal-header h3 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: bold;
}

.policy-modal-close {
    position: absolute;
    top: 15px;
    left: 20px;
    color: white;
    font-size: 2rem;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s ease;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
}

.policy-modal-close:hover {
    color: #FFD700;
    background: rgba(255, 255, 255, 0.2);
}

.policy-modal-body {
    padding: 30px;
    max-height: 60vh;
    overflow-y: auto;
    line-height: 1.8;
}

.policy-modal-body h4 {
    color: #8B4513;
    margin-top: 25px;
    margin-bottom: 15px;
    font-size: 1.2rem;
    font-weight: bold;
}

.policy-modal-body h4:first-child {
    margin-top: 0;
}

.policy-modal-body p {
    margin-bottom: 15px;
    color: #555;
    text-align: justify;
}

.policy-modal-body ul {
    margin-bottom: 15px;
    padding-right: 20px;
}

.policy-modal-body li {
    margin-bottom: 8px;
    color: #555;
}

.policy-modal-body strong {
    color: #8B4513;
    font-weight: bold;
}

.policy-modal-footer {
    padding: 20px 30px;
    background: #f8f9fa;
    border-radius: 0 0 15px 15px;
    text-align: center;
}

.policy-modal-footer .btn {
    padding: 10px 30px;
    font-weight: 600;
    border-radius: 25px;
}

/* Responsive Modal */
@media (max-width: 768px) {
    .policy-modal-content {
        width: 95%;
        margin: 2% auto;
        max-height: 90vh;
    }
    
    .policy-modal-header {
        padding: 15px 20px;
    }
    
    .policy-modal-header h3 {
        font-size: 1.3rem;
    }
    
    .policy-modal-body {
        padding: 20px;
        max-height: 70vh;
    }
    
    .policy-modal-footer {
        padding: 15px 20px;
    }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideIn {
    from { 
        opacity: 0;
        transform: translateY(-50px) scale(0.9);
    }
    to { 
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

body {
    font-family: 'Arial', sans-serif;
    line-height: 1.6;
    color: #333;
    direction: rtl;
    text-align: right;
}

/* Navigation Styles */
.navbar {
    background: linear-gradient(135deg, #8B4513, #A0522D);
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.navbar-brand img {
    height: 40px;
    width: auto;
}

.navbar-nav .nav-link {
    color: white !important;
    font-weight: 500;
    margin: 0 10px;
    transition: color 0.3s ease;
}

.navbar-nav .nav-link:hover {
    color: #FFD700 !important;
}

.navbar-toggler {
    border: none;
    color: white;
}

/* Cart and Wishlist Icons */
.cart-icon, .wishlist-icon {
    position: relative;
    color: white;
    font-size: 1.2rem;
    text-decoration: none;
    margin: 0 5px;
}

.cart-icon:hover, .wishlist-icon:hover {
    color: #FFD700;
}

.badge {
    position: absolute;
    top: -8px;
    right: -8px;
    background: #dc3545;
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    font-size: 0.7rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Footer Styles */
footer {
    background: linear-gradient(135deg, #2c3e50, #34495e);
    color: white;
    padding: 40px 0 20px;
    margin-top: 50px;
}

footer h5 {
    color: #FFD700;
    margin-bottom: 20px;
}

footer a {
    color: #bdc3c7;
    text-decoration: none;
    transition: color 0.3s ease;
}

footer a:hover {
    color: #FFD700;
}

.social-links a {
    display: inline-block;
    margin: 0 10px;
    font-size: 1.5rem;
}

/* Button Styles */
.btn-primary {
    background: linear-gradient(135deg, #8B4513, #A0522D);
    border: none;
    border-radius: 25px;
    padding: 10px 25px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #A0522D, #8B4513);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.btn-outline-primary {
    border: 2px solid #8B4513;
    color: #8B4513;
    border-radius: 25px;
    padding: 8px 20px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn-outline-primary:hover {
    background: #8B4513;
    color: white;
    transform: translateY(-2px);
}

/* Card Styles */
.card {
    border: none;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    overflow: hidden;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.15);
}

.card-img-top {
    height: 250px;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.card:hover .card-img-top {
    transform: scale(1.05);
}

/* Product Grid */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 30px;
    padding: 20px 0;
}

/* Mobile Grid */
@media (max-width: 768px) {
    .product-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
    
    .card-img-top {
        height: 200px;
    }
}

/* Price Styles */
.price {
    font-size: 1.2rem;
    font-weight: bold;
    color: #8B4513;
}

.original-price {
    text-decoration: line-through;
    color: #999;
    font-size: 1rem;
    margin-left: 10px;
}

.discount-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: #dc3545;
    color: white;
    padding: 5px 10px;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: bold;
}

/* Loading Spinner */
.loading {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 200px;
}

.spinner-border {
    color: #8B4513;
}

/* Alert Styles */
.alert {
    border-radius: 10px;
    border: none;
}

.alert-success {
    background: linear-gradient(135deg, #d4edda, #c3e6cb);
    color: #155724;
}

.alert-danger {
    background: linear-gradient(135deg, #f8d7da, #f5c6cb);
    color: #721c24;
}

.alert-info {
    background: linear-gradient(135deg, #d1ecf1, #bee5eb);
    color: #0c5460;
}

/* Modal Styles */
.modal-content {
    border-radius: 15px;
    border: none;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

.modal-header {
    background: linear-gradient(135deg, #8B4513, #A0522D);
    color: white;
    border-radius: 15px 15px 0 0;
}

.modal-header .btn-close {
    filter: invert(1);
}

/* Form Styles */
.form-control {
    border-radius: 10px;
    border: 2px solid #e9ecef;
    padding: 12px 15px;
    transition: all 0.3s ease;
}

.form-control:focus {
    border-color: #8B4513;
    box-shadow: 0 0 0 0.2rem rgba(139, 69, 19, 0.25);
}

.form-label {
    font-weight: 500;
    color: #555;
    margin-bottom: 8px;
}

/* Product Quick-Add Modal Enhancements */
#productModal .modal-dialog { max-width: 800px; }
#productModal .modal-body { padding: 20px; }
#productModal .modal-title { color: #8B4513; font-weight: 600; }
#productModal #modalProductImage { width: 100%; height: auto; border-radius: 12px; }
#productModal .thumbnail-gallery { display: flex; gap: 8px; margin-top: 10px; overflow-x: auto; padding: 5px 0; }
#productModal .thumbnail { width: 60px; height: 60px; object-fit: cover; border-radius: 8px; cursor: pointer; border: 2px solid transparent; transition: all 0.3s ease; flex-shrink: 0; }
#productModal .thumbnail:hover { border-color: #8B4513; transform: scale(1.05); }
#productModal .thumbnail.active { border-color: #8B4513; box-shadow: 0 0 0 2px rgba(139,69,19,0.2); }
#productModal .quantity-controls { max-width: 170px; }
#productModal .quantity-controls .btn { width: 40px; height: 40px; display: flex; align-items: center; justify-content: center; border-radius: 8px; }
#productModal .quantity-controls input { border-radius: 8px; border: 2px solid #e9ecef; font-weight: 600; }
#productModal .quantity-controls input:focus { border-color: #8B4513; box-shadow: 0 0 0 0.2rem rgba(139,69,19,0.25); }
#productModal .form-select { border-radius: 8px; border: 2px solid #e9ecef; padding: 12px 15px; font-size: 16px; }
#productModal .form-select:focus { border-color: #8B4513; box-shadow: 0 0 0 0.2rem rgba(139,69,19,0.25); }

@media (max-width: 576px) {
    #productModal .modal-dialog { max-width: 95%; margin: 10px auto; }
    #productModal .modal-body { padding: 12px; }
    #productModal .modal-header, #productModal .modal-footer { padding: 12px 14px; }
    #productModal .thumbnail { width: 48px; height: 48px; }
    #productModal .quantity-controls { max-width: 150px; }
}

/* Utility Classes */
.text-brown {
    color: #8B4513 !important;
}

.bg-brown {
    background-color: #8B4513 !important;
}

.border-brown {
    border-color: #8B4513 !important;
}

/* Animation Classes */
.fade-in {
    animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.slide-in {
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from { transform: translateX(100%); }
    to { transform: translateX(0); }
}

/* Responsive Design */
@media (max-width: 576px) {
    .container {
        padding: 0 15px;
    }
    
    .navbar-brand {
        font-size: 1.2rem;
    }
    
    .btn {
        font-size: 0.9rem;
        padding: 8px 16px;
    }
    
    .card-body {
        padding: 15px;
    }
    
    .price {
        font-size: 1.1rem;
    }
}

/* Print Styles */
@media print {
    .navbar, footer, .btn, .modal {
        display: none !important;
    }
    
    body {
        font-size: 12pt;
        line-height: 1.4;
    }
}
