/* ElectroWorldLY CSS - Arabic RTL E-commerce Styling */

/* CSS Reset and Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Cairo', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f8f9fa;
    direction: rtl;
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
.header {
    background: linear-gradient(135deg, rgb(44, 153, 217), rgb(12, 69, 109));
    color: white;
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.nav-brand .logo {
    font-size: 2rem;
    font-weight: 900;
    margin-bottom: 0.2rem;
    background: linear-gradient(45deg, #fff, #e3f2fd);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.nav-brand .slogan {
    font-size: 0.9rem;
    opacity: 0.9;
    font-weight: 300;
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.search-box {
    display: flex;
    background: rgba(255,255,255,0.1);
    border-radius: 25px;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,0.3);
}

.search-box input {
    background: transparent;
    border: none;
    padding: 0.7rem 1rem;
    color: white;
    font-size: 0.9rem;
    width: 250px;
    outline: none;
}

.search-box input::placeholder {
    color: rgba(255,255,255,0.7);
}

.search-box button {
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    padding: 0.7rem 1rem;
    cursor: pointer;
    transition: background-color 0.3s;
}

.search-box button:hover {
    background: rgba(255,255,255,0.3);
}

.cart-btn {
    background: rgba(255,255,255,0.2);
    border: 1px solid rgba(255,255,255,0.3);
    color: white;
    padding: 0.7rem 1rem;
    border-radius: 25px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s;
    position: relative;
}

.cart-btn:hover {
    background: rgba(255,255,255,0.3);
    transform: translateY(-2px);
}

.cart-count {
    background: #ff4757;
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 600;
    position: absolute;
    top: -5px;
    left: -5px;
}

/* Hero Section */
.hero {
    background: linear-gradient(135deg, rgba(44, 153, 217, 0.9), rgba(12, 69, 109, 0.9)),
                url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1000 300"><defs><linearGradient id="grad1" x1="0%" y1="0%" x2="100%" y2="100%"><stop offset="0%" style="stop-color:rgb(44,153,217);stop-opacity:0.1" /><stop offset="100%" style="stop-color:rgb(12,69,109);stop-opacity:0.1" /></linearGradient></defs><rect width="1000" height="300" fill="url(%23grad1)" /><circle cx="100" cy="50" r="3" fill="white" opacity="0.3" /><circle cx="300" cy="120" r="2" fill="white" opacity="0.4" /><circle cx="500" cy="80" r="4" fill="white" opacity="0.2" /><circle cx="700" cy="200" r="3" fill="white" opacity="0.3" /><circle cx="900" cy="150" r="2" fill="white" opacity="0.4" /></svg>');
    color: white;
    padding: 4rem 0;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.1);
}

.hero-content {
    position: relative;
    z-index: 1;
}

.hero-title {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 1rem;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.hero-description {
    font-size: 1.2rem;
    margin-bottom: 2rem;
    opacity: 0.95;
    line-height: 1.8;
}

.hero-btn {
    background: rgba(255,255,255,0.15);
    border: 2px solid rgba(255,255,255,0.3);
    color: white;
    padding: 1rem 2rem;
    border-radius: 50px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    backdrop-filter: blur(10px);
}

.hero-btn:hover {
    background: rgba(255,255,255,0.25);
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.2);
}

/* Categories */
.categories {
    padding: 4rem 0;
    background: white;
}

.section-title {
    font-size: 2.5rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 3rem;
    color: rgb(12, 69, 109);
    position: relative;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 4px;
    background: linear-gradient(90deg, rgb(44, 153, 217), rgb(12, 69, 109));
    border-radius: 2px;
}

.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.category-card {
    background: white;
    border: 2px solid #e9ecef;
    border-radius: 15px;
    padding: 2rem 1rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
}

.category-card:hover {
    border-color: rgb(44, 153, 217);
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(44, 153, 217, 0.15);
}

.category-card.active {
    background: linear-gradient(135deg, rgb(44, 153, 217), rgb(12, 69, 109));
    color: white;
    border-color: transparent;
}

.category-card i {
    font-size: 2.5rem;
    color: rgb(44, 153, 217);
    transition: color 0.3s;
}

.category-card.active i,
.category-card:hover i {
    color: white;
}

.category-card span {
    font-size: 1.1rem;
    font-weight: 600;
}

/* Products */
.products {
    padding: 4rem 0;
    background: #f8f9fa;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 3rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.products-count {
    background: rgb(44, 153, 217);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 25px;
    font-weight: 600;
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2rem;
}

.product-card {
    background: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
    transition: all 0.3s;
    cursor: pointer;
    position: relative;
}

.product-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 35px rgba(0,0,0,0.15);
}

.product-image {
    width: 100%;
    height: 200px;
    background: #f8f9fa;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

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

.product-placeholder {
    color: #adb5bd;
    font-size: 3rem;
}

.product-info {
    padding: 1.5rem;
}

.product-name {
    font-size: 1.3rem;
    font-weight: 600;
    color: rgb(12, 69, 109);
    margin-bottom: 0.5rem;
    line-height: 1.4;
}

.product-description {
    font-size: 0.9rem;
    color: #6c757d;
    margin-bottom: 1rem;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1rem;
}

.product-price {
    font-size: 1.4rem;
    font-weight: 700;
    color: rgb(44, 153, 217);
}

.product-stock {
    font-size: 0.9rem;
    color: #28a745;
    font-weight: 600;
}

.product-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.view-details-btn {
    background: rgba(44, 153, 217, 0.1);
    color: rgb(44, 153, 217);
    border: 1px solid rgba(44, 153, 217, 0.3);
    padding: 0.6rem 1rem;
    border-radius: 20px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    flex: 1;
    justify-content: center;
}

.view-details-btn:hover {
    background: rgba(44, 153, 217, 0.2);
    transform: translateY(-1px);
}

.add-to-cart-btn {
    background: linear-gradient(135deg, rgb(44, 153, 217), rgb(12, 69, 109));
    color: white;
    border: none;
    padding: 0.7rem 1.2rem;
    border-radius: 25px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex: 1;
    justify-content: center;
}

.add-to-cart-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(44, 153, 217, 0.4);
}

.loading {
    text-align: center;
    padding: 3rem;
    color: rgb(44, 153, 217);
}

.loading i {
    font-size: 2rem;
    margin-bottom: 1rem;
    animation: spin 1s linear infinite;
}

.no-products {
    text-align: center;
    padding: 3rem;
    color: #6c757d;
}

.no-products i {
    font-size: 3rem;
    margin-bottom: 1rem;
}

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

/* Trust Elements */
.trust-elements {
    padding: 4rem 0;
    background: white;
}

.trust-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.trust-card {
    text-align: center;
    padding: 2rem 1rem;
    border-radius: 15px;
    background: #f8f9fa;
    transition: all 0.3s;
}

.trust-card:hover {
    background: white;
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
    transform: translateY(-5px);
}

.trust-card i {
    font-size: 3rem;
    color: rgb(44, 153, 217);
    margin-bottom: 1rem;
}

.trust-card h3 {
    font-size: 1.3rem;
    font-weight: 600;
    color: rgb(12, 69, 109);
    margin-bottom: 0.5rem;
}

.trust-card p {
    color: #6c757d;
    line-height: 1.6;
}

/* About Section */
.about {
    padding: 4rem 0;
    background: #f8f9fa;
}

.about-content {
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
}

.about-text {
    font-size: 1.1rem;
    line-height: 1.8;
    color: #495057;
    margin-bottom: 1.5rem;
}

/* Footer */
.footer {
    background: rgb(12, 69, 109);
    color: white;
    padding: 3rem 0 1rem;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-section h3,
.footer-section h4 {
    margin-bottom: 1rem;
    color: rgb(44, 153, 217);
}

.footer-section p {
    line-height: 1.8;
    opacity: 0.9;
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    margin-bottom: 0.5rem;
}

.footer-section ul li a {
    color: rgba(255,255,255,0.8);
    text-decoration: none;
    transition: color 0.3s;
}

.footer-section ul li a:hover {
    color: rgb(44, 153, 217);
}

.footer-section i {
    margin-left: 0.5rem;
    color: rgb(44, 153, 217);
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid rgba(255,255,255,0.1);
    opacity: 0.8;
}

/* Modals */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.7);
    z-index: 2000;
    backdrop-filter: blur(5px);
}

.modal-content {
    background: white;
    margin: 5% auto;
    border-radius: 15px;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    animation: modalSlideIn 0.3s ease-out;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 2rem;
    border-bottom: 1px solid #e9ecef;
    background: linear-gradient(135deg, rgb(44, 153, 217), rgb(12, 69, 109));
    color: white;
    border-radius: 15px 15px 0 0;
}

.modal-header h3 {
    font-size: 1.5rem;
    font-weight: 600;
}

.close-btn {
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.3s;
}

.close-btn:hover {
    background: rgba(255,255,255,0.3);
}

.modal-body {
    padding: 2rem;
}

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

/* Product Modal Specific */
.product-images {
    text-align: center;
    margin-bottom: 2rem;
}

.product-images img {
    max-width: 100%;
    height: auto;
    max-height: 300px;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.product-details h2 {
    font-size: 1.8rem;
    font-weight: 600;
    color: rgb(12, 69, 109);
    margin-bottom: 1rem;
}

.product-details p {
    font-size: 1.1rem;
    color: #495057;
    line-height: 1.6;
    margin-bottom: 1.5rem;
}

.product-price {
    font-size: 2rem !important;
    font-weight: 700;
    color: rgb(44, 153, 217);
    margin-bottom: 1rem;
}

.product-availability {
    font-size: 1rem;
    color: #28a745;
    font-weight: 600;
    margin-bottom: 2rem;
}

/* Cart Modal */
.cart-items {
    max-height: 400px;
    overflow-y: auto;
}

.cart-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    border-bottom: 1px solid #e9ecef;
}

.cart-item:last-child {
    border-bottom: none;
}

.cart-item img {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 8px;
}

.cart-item-info {
    flex: 1;
}

.cart-item-name {
    font-weight: 600;
    color: rgb(12, 69, 109);
    margin-bottom: 0.5rem;
}

.cart-item-price {
    color: rgb(44, 153, 217);
    font-weight: 600;
}

.cart-item-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.quantity-btn {
    background: rgb(44, 153, 217);
    color: white;
    border: none;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
}

.quantity-input {
    width: 50px;
    text-align: center;
    border: 1px solid #ddd;
    border-radius: 5px;
    padding: 0.3rem;
}

.remove-item {
    background: #dc3545;
    color: white;
    border: none;
    padding: 0.3rem 0.6rem;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.8rem;
}

.cart-empty {
    text-align: center;
    padding: 3rem;
    color: #6c757d;
}

.cart-empty i {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.cart-footer {
    border-top: 1px solid #e9ecef;
    padding-top: 1rem;
    margin-top: 1rem;
}

.cart-total {
    text-align: center;
    font-size: 1.3rem;
    margin-bottom: 1rem;
    color: rgb(12, 69, 109);
}

.checkout-btn {
    width: 100%;
    background: linear-gradient(135deg, rgb(44, 153, 217), rgb(12, 69, 109));
    color: white;
    border: none;
    padding: 1rem;
    border-radius: 10px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all 0.3s;
}

.checkout-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(44, 153, 217, 0.4);
}

/* Checkout Form */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: rgb(12, 69, 109);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.8rem;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
    transition: border-color 0.3s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: rgb(44, 153, 217);
}

.order-summary {
    background: #f8f9fa;
    padding: 1.5rem;
    border-radius: 10px;
    margin: 2rem 0;
}

.order-summary h4 {
    color: rgb(12, 69, 109);
    margin-bottom: 1rem;
}

.checkout-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    border-bottom: 1px solid #e9ecef;
}

.checkout-item:last-child {
    border-bottom: none;
}

.checkout-total {
    text-align: center;
    font-size: 1.3rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 2px solid rgb(44, 153, 217);
    color: rgb(12, 69, 109);
}

.submit-order-btn {
    width: 100%;
    background: linear-gradient(135deg, #28a745, #20c997);
    color: white;
    border: none;
    padding: 1rem;
    border-radius: 10px;
    font-size: 1.2rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all 0.3s;
}

.submit-order-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(40, 167, 69, 0.4);
}

/* Success Message */
.message {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.8);
    z-index: 3000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.message-content {
    background: white;
    padding: 3rem;
    border-radius: 15px;
    text-align: center;
    max-width: 400px;
    animation: messageSlideIn 0.5s ease-out;
}

.message-content.success {
    border-top: 5px solid #28a745;
}

.message-content i {
    font-size: 4rem;
    color: #28a745;
    margin-bottom: 1rem;
}

.message-content h3 {
    color: rgb(12, 69, 109);
    margin-bottom: 1rem;
    font-size: 1.5rem;
}

.message-content p {
    color: #6c757d;
    margin-bottom: 2rem;
    line-height: 1.6;
}

.close-message {
    background: rgb(44, 153, 217);
    color: white;
    border: none;
    padding: 0.8rem 2rem;
    border-radius: 25px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.close-message:hover {
    background: rgb(12, 69, 109);
    transform: translateY(-2px);
}

@keyframes messageSlideIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .hero-title {
        font-size: 2rem;
    }
    
    .hero-description {
        font-size: 1rem;
    }
    
    .section-title {
        font-size: 2rem;
    }
    
    .navbar {
        flex-direction: column;
        gap: 1rem;
    }
    
    .nav-actions {
        width: 100%;
        justify-content: center;
    }
    
    .search-box input {
        width: 200px;
    }
    
    .categories-grid {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    }
    
    .products-grid {
        grid-template-columns: 1fr;
    }
    
    .section-header {
        flex-direction: column;
        text-align: center;
    }
    
    .modal-content {
        margin: 2% auto;
        max-width: 95%;
    }
    
    .modal-body {
        padding: 1rem;
    }
    
    .trust-grid {
        grid-template-columns: 1fr;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 15px;
    }
    
    .hero {
        padding: 2rem 0;
    }
    
    .hero-title {
        font-size: 1.8rem;
    }
    
    .categories,
    .products,
    .trust-elements,
    .about {
        padding: 2rem 0;
    }
    
    .cart-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .product-footer {
        flex-direction: column;
        align-items: stretch;
    }
    
    .product-actions {
        width: 100%;
    }
    
    .view-details-btn,
    .add-to-cart-btn {
        width: 100%;
        justify-content: center;
    }
}
