* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Vazirmatn', sans-serif;
}

@font-face {
    font-family: 'Vazirmatn';
    src: url('../fonts/Vazirmatn/Vazirmatn-Regular.woff2') format('woff2');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Vazirmatn';
    src: url('../fonts/Vazirmatn/Vazirmatn-Medium.woff2') format('woff2');
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Vazirmatn';
    src: url('../fonts/Vazirmatn/Vazirmatn-Bold.woff2') format('woff2');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

body {
    font-family: 'Vazirmatn', system-ui, sans-serif;
    background-color: #f8f9fa;
    color: #333;
}

/* Category Management Styles */
.draggable {
    cursor: grab;
    transition: all 0.3s;
            }
.draggable:active {
    cursor: grabbing;
                }
.drag-handle {
    cursor: move;
    color: #667eea;
    margin-right: 10px;
    font-weight: bold;
            }
.category-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.5rem;
                }
.category-edit-form {
    width: 100%;
                }
.category-edit-form .form-group {
    margin-bottom: 1rem;
                }
.category-edit-form input {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 4px;
                }

/* Adjust existing styles for better category display */
.category-item {
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 8px;
    margin-bottom: 0.5rem;
    border: 1px solid #e0e0e0;
}
.category-item:hover {
    background: #f1f3f4;
    border-color: #667eea;
}
.category-name {
    font-weight: 600;
    margin-right: 10px;
}
.category-icon {
    margin-left: 10px;
    font-size: 1.5em;
}
/* Drag and drop visual feedback */
[draggable=true] {
    user-select: none;
}

.drag-over {
    border: 2px dashed #667eea !important;
}


.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header Styles */
header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.8rem;
    font-weight: 700;
    color: white;
    text-decoration: none;
}

.logo span {
    color: #ff6b6b;
}

.nav-links {
    display: flex;
    gap: 2rem;
    list-style: none;
}

.nav-links a {
    color: white;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s;
}

.nav-links a:hover {
    color: #ff6b6b;
}

.header-icons {
    display: flex;
    gap: 1.5rem;
    align-items: center;
}

.header-icons button {
    background: none;
    border: none;
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
    transition: color 0.3s;
}

.header-icons button:hover {
    color: #ff6b6b;
}

.admin-panel-btn {
    background: #ff6b6b;
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    border: none;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.admin-panel-btn:hover {
    background: #ff5252;
    transform: scale(1.05);
}

.search-container {
    position: relative;
    display: flex;
    align-items: center;
}

.search-input {
    padding: 0.6rem 1rem;
    border-radius: 20px;
    border: none;
    width: 220px;
    transition: width 0.3s;
}

.search-input:focus {
    width: 280px;
    outline: none;
}

.search-btn {
    background: none;
    border: none;
    color: white;
    margin-left: -30px;
    z-index: 10;
    cursor: pointer;
}

/* Hero Section */
.hero {
    background: linear-gradient(rgba(102, 126, 234, 0.9), rgba(118, 75, 162, 0.9)), url('../images/hero-bg.jpg') center/cover;
    color: white;
    text-align: center;
    padding: 6rem 0;
    margin-bottom: 3rem;
}

.hero h1 {
    font-size: 3rem;
    margin-bottom: 1rem;
    animation: slideInDown 1s ease-out;
}

.hero p {
    font-size: 1.2rem;
    margin-bottom: 2rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.btn {
    display: inline-block;
    background: #ff6b6b;
    color: white;
    padding: 0.8rem 2rem;
    border-radius: 30px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s;
    border: 2px solid #ff6b6b;
}

.btn:hover {
    background: transparent;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 107, 107, 0.4);
}

.btn-outline {
    background: transparent;
    margin-left: 1rem;
}

.btn-outline:hover {
    background: #ff6b6b;
}

/* Products Section */
.section-title {
    text-align: center;
    margin-bottom: 3rem;
    font-size: 2.5rem;
    color: #333;
    position: relative;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 4px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 2px;
}

.products {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 4rem;
}

.product-card {
    display: flex;
    flex-direction: column;
    height: 100%;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 6px 18px rgba(0,0,0,0.1);
    transition: all 0.35s ease;
}

.product-card:hover {
    transform: translateY(-12px) scale(1.02);
    box-shadow: 0 20px 40px rgba(0,0,0,0.18);
}

.product-image {
    height: 250px;
    width: 100%;
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
}

.product-info {
    flex: 1;
    padding: 1.5rem;
}

.product-title {
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
    color: #333;
}

.product-price {
    font-size: 1.3rem;
    font-weight: 700;
    color: #667eea;
    margin-bottom: 1rem;
}

.product-id {
    font-size: 1.3rem;
    font-weight: 700;
    color: #569a35;
    margin-bottom: 1rem;
}

.product-description {
    color: #666;
    margin-bottom: 0.1rem;
    font-size: 0.9rem;
    line-height: 1.5;
        text-align: justify;
}

.add-to-cart {
    width: 100%;
    padding: 0.8rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.3s;
}

.add-to-cart:hover {
    opacity: 0.9;
}
.product-card:hover .add-to-cart {
    background: linear-gradient(135deg, #764ba2, #667eea);
    box-shadow: 0 12px 30px rgba(118,75,162,0.6);
    transform: translateY(-2px);
}

.product-exists {
    margin: 1rem;
    padding: 0.9rem;
    width: calc(50% - 2rem);
    background: linear-gradient(135deg,#667eea,#764ba2);
    color: #fff;
    border: none;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
}

.product-exists:hover {
    background: linear-gradient(135deg, #764ba2, #667eea);
    box-shadow: 0 12px 30px rgba(118,75,162,0.6);
    transform: translateY(-2px);
}

.product-gallery {
    margin: 1rem;
    padding: 0.9rem;
    width: calc(50% - 2rem);
    background: linear-gradient(135deg,#667eea,#764ba2);
    color: #fff;
    border: none;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
}

.product-gallery:hover {
    background: linear-gradient(135deg, #764ba2, #667eea);
    box-shadow: 0 12px 30px rgba(118,75,162,0.6);
    transform: translateY(-2px);
}

.product-actions {
    display: flex;
    gap: 0.1rem;         
        margin: 0.1rem;
}

.product-actions button {
    flex: 1;              
      padding: 0.8rem;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    border: none;
}

.product-card.discounted {
    border: 2px solid #ff9900;
}

.discount-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    background: #ff9900;
    color: #111;
    font-weight: bold;
    font-size: .8rem;
    padding: 6px 10px;
    border-radius: 20px;
    animation: pulse 1.6s infinite;
}

@keyframes pulse {
    0%   { transform: scale(1);   box-shadow: 0 0 0 0 rgba(255,153,0,.6); }
    70%  { transform: scale(1.05); box-shadow: 0 0 0 12px rgba(255,153,0,0); }
    100% { transform: scale(1); }
}

.old-price {
    text-decoration: line-through;
    color: #888;
    font-size: .85rem;
    display: block;
}

.new-price {
    color: #b12704; /* Amazon red */
    font-weight: 700;
    font-size: 1.1rem;
}

.normal-price {
    font-weight: 700;
    font-size: 1.1rem;
}

.sold-out {
    position: absolute;
    top: 10px;
    right: 10px;
    background: #ff6b6b;
    color: white;
    padding: 0.3rem 0.6rem;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: 600;
}

/* Search Results & Filters */
.search-results-section {
    padding: 3rem 0;
    display: none;
}

.filter-container {
    background: white;
    padding: 1.5rem;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    margin-bottom: 2rem;
}

.filter-title {
    font-size: 1.3rem;
    margin-bottom: 1rem;
    color: #333;
    font-weight: 600;
}

.filter-group {
    margin-bottom: 1.5rem;
}

.filter-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: #555;
}

.filter-options {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.filter-option {
    display: flex;
    align-items: center;
    margin-left: 1rem;
}

.filter-option input {
    margin-left: 0.5rem;
}

.price-range {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.price-range input {
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 5px;
    width: 120px;
}

.apply-filters {
    background: #667eea;
    color: white;
    border: none;
    padding: 0.6rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s;
}

.apply-filters:hover {
    background: #5a6fd8;
}

.no-results {
    text-align: center;
    padding: 3rem 0;
    font-size: 1.3rem;
    color: #666;
}

/* Categories Section */
.categories {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1.5rem;
    margin-bottom: 4rem;
}

.category-card {
    text-align: center;
    padding: 2rem 1rem;
    background: white;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    transition: all 0.3s;
    cursor: pointer;
}

.category-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
}

.category-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: #667eea;
}

.category-name {
    font-weight: 600;
    color: #333;
}

/* Content Pages */
.content-page {
    padding: 3rem 0;
}

.page-header {
    text-align: center;
    margin-bottom: 2rem;
}

.page-header h1 {
    font-size: 2.5rem;
    color: #333;
    margin-bottom: 1rem;
}

.page-content {
    line-height: 1.8;
    font-size: 1.1rem;
}

.category-products {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

/* Newests Section */
.newests {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1.5rem;
    margin-bottom: 4rem;
}

.newests-card {
    text-align: center;
    padding: 2rem 1rem;
    background: white;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    transition: all 0.3s;
    cursor: pointer;
}

.newests-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
}

.newests-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: #667eea;
}

.newests-name {
    font-weight: 600;
    color: #333;
}


/* Footer */
footer {
    background: #333;
    color: white;
    padding: 3rem 0 1.5rem;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-column h3 {
    margin-bottom: 1.5rem;
    font-size: 1.2rem;
    color: #ff6b6b;
}

.footer-links {
    list-style: none;
}

.footer-links li {
    margin-bottom: 0.8rem;
}

.footer-links a {
    color: #ccc;
    text-decoration: none;
    transition: color 0.3s;
}

.footer-links a:hover {
    color: white;
}

.social-links {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
}

.social-links a {
    display: inline-block;
    width: 40px;
    height: 40px;
    background: #444;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    text-decoration: none;
    transition: background 0.3s;
}

.social-links a:hover {
    background: #ff6b6b;
}

.copyright {
    text-align: center;
    padding-top: 1.5rem;
    border-top: 1px solid #444;
    color: #aaa;
    font-size: 0.9rem;
}

/* Admin Panel Modal */
.admin-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.admin-panel {
    background: white;
    width: 90%;
    max-width: 800px;
    border-radius: 20px;
    overflow: hidden;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
}

.admin-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.admin-header h2 {
    font-size: 1.5rem;
}

.close-admin {
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
}

.admin-tabs {
    display: flex;
    background: #f1f3f4;
    border-bottom: 1px solid #e0e0e0;
}

.admin-tab {
    padding: 1rem 2rem;
    background: none;
    border: none;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.admin-tab.active {
    background: white;
    border-bottom: 3px solid #667eea;
}

.admin-content {
    padding: 2rem;
    overflow-y: auto;
    flex: 1;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #555;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.8rem;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #667eea;
}

.form-actions {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
}

.submit-btn {
    padding: 0.8rem 2rem;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.save-btn {
    background: #667eea;
    color: white;
}

.save-btn:hover {
    background: #5a6fd8;
}

.cancel-btn {
    background: #f1f3f4;
    color: #555;
}

.cancel-btn:hover {
    background: #e0e0e0;
}

.delete-btn {
    background: #ff6b6b;
    color: white;
    padding: 0.4rem 0.8rem;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.8rem;
    transition: background 0.3s;
}

.delete-btn:hover {
    background: #ff5252;
}

.product-list {
    margin-top: 1rem;
}

.product-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    margin-bottom: 0.5rem;
}

.product-item-info {
    flex: 1;
}

.product-item-title {
    font-weight: 600;
    margin-bottom: 0.3rem;
}

.product-item-price {
    color: #667eea;
    font-weight: 600;
}

/* Animations */
@keyframes slideInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        gap: 1rem;
    }
    
    .nav-links {
        gap: 1rem;
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .hero h1 {
        font-size: 2rem;
    }
    
    .hero p {
        font-size: 1rem;
    }
    
    .btn {
        margin: 0.5rem;
    }
    
    .btn-outline {
        margin-left: 0;
    }
    
    .admin-tabs {
        flex-wrap: wrap;
    }
    
    .admin-tab {
        padding: 0.8rem 1rem;
    }
    
    .search-input {
        width: 180px;
    }
    
    .search-input:focus {
        width: 220px;
    }
}

@media (max-width: 480px) {
    .hero {
        padding: 3rem 0;
    }
    
    .hero h1 {
        font-size: 1.5rem;
    }
    
    .section-title {
        font-size: 2rem;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .search-container {
        width: 100%;
    }
    
    .search-input {
        width: 100%;
    }
    
    .search-input:focus {
        width: 100%;
    }
    
    .price-range {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .product-actions {
        flex-direction: column;
    }
}