/* JES E-Commerce - Modern Design System */

:root {
    /* Primary Colors - Deep Blue Industrial */
    --primary: #1a365d;
    --primary-light: #2d4a7c;
    --primary-dark: #0f2442;

    /* Accent Colors - Vibrant Orange */
    --accent: #ed8936;
    --accent-light: #f6ad55;
    --accent-dark: #dd6b20;

    /* Neutral Colors */
    --dark: #1a202c;
    --gray-900: #171923;
    --gray-800: #2d3748;
    --gray-700: #4a5568;
    --gray-600: #718096;
    --gray-500: #a0aec0;
    --gray-400: #cbd5e0;
    --gray-300: #e2e8f0;
    --gray-200: #edf2f7;
    --gray-100: #f7fafc;
    --white: #ffffff;

    /* Status Colors */
    --success: #38a169;
    --warning: #d69e2e;
    --danger: #e53e3e;
    --info: #3182ce;

    /* Gradients */
    --gradient-primary: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    --gradient-accent: linear-gradient(135deg, var(--accent) 0%, var(--accent-light) 100%);
    --gradient-dark: linear-gradient(135deg, var(--gray-900) 0%, var(--gray-800) 100%);

    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 25px 50px -12px rgba(0, 0, 0, 0.25);

    /* Border Radius */
    --radius-sm: 0.25rem;
    --radius: 0.5rem;
    --radius-md: 0.75rem;
    --radius-lg: 1rem;
    --radius-xl: 1.5rem;

    /* Transitions */
    --transition: all 0.3s ease;
    --transition-fast: all 0.15s ease;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: var(--gray-800);
    background-color: var(--gray-100);
    line-height: 1.6;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-weight: 700;
    color: var(--dark);
    line-height: 1.2;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: var(--transition-fast);
}

a:hover {
    color: var(--accent);
}

/* Navbar */
.navbar {
    background: var(--white);
    box-shadow: var(--shadow);
    padding: 0.75rem 0;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.navbar-brand {
    font-weight: 800;
    font-size: 1.5rem;
    color: var(--primary) !important;
}

.navbar-brand span {
    color: var(--accent);
}

.nav-link {
    color: var(--gray-700) !important;
    font-weight: 500;
    padding: 0.5rem 1rem !important;
    border-radius: var(--radius);
    transition: var(--transition-fast);
}

.nav-link:hover {
    color: var(--primary) !important;
    background-color: var(--gray-100);
}

.nav-link.active {
    color: var(--primary) !important;
    background-color: var(--gray-200);
}

/* Top Bar */
.top-bar {
    background: var(--gradient-primary);
    color: var(--white);
    padding: 0.5rem 0;
    font-size: 0.875rem;
}

.top-bar a {
    color: var(--white);
    opacity: 0.9;
}

.top-bar a:hover {
    opacity: 1;
}

/* Buttons */
.btn {
    font-weight: 600;
    padding: 0.625rem 1.5rem;
    border-radius: var(--radius);
    transition: var(--transition);
    border: none;
}

.btn-primary {
    background: var(--gradient-primary);
    color: var(--white);
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-accent {
    background: var(--gradient-accent);
    color: var(--white);
}

.btn-accent:hover {
    background: var(--accent-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-outline-primary {
    border: 2px solid var(--primary);
    color: var(--primary);
    background: transparent;
}

.btn-outline-primary:hover {
    background: var(--primary);
    color: var(--white);
}

/* Cards */
.card {
    background: var(--white);
    border: none;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    transition: var(--transition);
    overflow: hidden;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

/* Product Card */
.product-card {
    position: relative;
}

.product-card .product-image {
    height: 200px;
    padding: 1rem;
    overflow: hidden;
    background: var(--gray-100);
    display: flex;
    align-items: center;
    justify-content: center;
}

.product-card .product-image img {
    max-height: 100%;
    max-width: 100%;
    object-fit: contain;
    transition: var(--transition);
}

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

.product-card .product-body {
    padding: 1.25rem;
}

.product-card .product-category {
    font-size: 0.75rem;
    color: var(--gray-600);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.product-card .product-title {
    font-size: 1rem;
    font-weight: 600;
    margin: 0.5rem 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    height: 3.2rem;
    /* Fixed height for 2 lines */
}

.text-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-card .product-price {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary);
}

.product-card .product-price .original-price {
    font-size: 0.875rem;
    color: var(--gray-500);
    text-decoration: line-through;
    margin-left: 0.5rem;
    font-weight: 400;
}

.product-card .badge-featured {
    position: absolute;
    top: 1rem;
    left: 1rem;
    background: var(--accent);
    color: var(--white);
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius);
    font-size: 0.75rem;
    font-weight: 600;
}

.product-card .badge-discount {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: var(--danger);
    color: var(--white);
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius);
    font-size: 0.75rem;
    font-weight: 600;
}

/* Hero Section */
.hero {
    background: var(--gradient-primary);
    color: var(--white);
    padding: 5rem 0;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 40%;
    height: 100%;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><circle cx="50" cy="50" r="40" fill="rgba(255,255,255,0.05)"/></svg>');
    background-size: 200px;
}

.hero h1 {
    font-size: 3rem;
    font-weight: 800;
    color: var(--white);
    margin-bottom: 1.5rem;
}

.hero p {
    font-size: 1.25rem;
    opacity: 0.9;
    margin-bottom: 2rem;
}

/* Category Card */
.category-card {
    text-align: center;
    padding: 2rem 1.5rem;
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.category-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.category-card .icon {
    width: 80px;
    height: 80px;
    background: var(--gray-100);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
    font-size: 2rem;
    color: var(--primary);
    transition: var(--transition);
}

.category-card:hover .icon {
    background: var(--primary);
    color: var(--white);
}

.category-card h5 {
    font-size: 1rem;
    margin-bottom: 0.5rem;
}

.category-card p {
    font-size: 0.875rem;
    color: var(--gray-600);
    margin: 0;
}

/* Section Styles */
.section {
    padding: 4rem 0;
}

.section-title {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.section-subtitle {
    color: var(--gray-600);
    margin-bottom: 2.5rem;
}

/* Footer */
.footer {
    background: var(--gradient-dark);
    color: var(--white);
    padding: 4rem 0 2rem;
}

.footer h5 {
    color: var(--white);
    font-size: 1.125rem;
    margin-bottom: 1.5rem;
}

.footer ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

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

.footer ul li a {
    color: var(--gray-400);
    transition: var(--transition-fast);
}

.footer ul li a:hover {
    color: var(--accent);
    padding-left: 5px;
}

.footer-bottom {
    border-top: 1px solid var(--gray-700);
    padding-top: 2rem;
    margin-top: 3rem;
    color: var(--gray-500);
    font-size: 0.875rem;
}

/* Cart Badge */
.cart-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: var(--accent);
    color: var(--white);
    font-size: 0.7rem;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
}

/* Search Box */
.search-box {
    position: relative;
    max-width: 400px;
}

.search-box input {
    width: 100%;
    padding: 0.75rem 1rem 0.75rem 3rem;
    border: 2px solid var(--gray-300);
    border-radius: var(--radius-lg);
    font-size: 0.875rem;
    transition: var(--transition-fast);
}

.search-box input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(26, 54, 93, 0.1);
}

.search-box .search-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--gray-500);
}

/* Breadcrumb */
.breadcrumb {
    background: transparent;
    padding: 1rem 0;
    margin: 0;
}

.breadcrumb-item a {
    color: var(--gray-600);
}

.breadcrumb-item.active {
    color: var(--primary);
    font-weight: 500;
}

/* Form Controls */
.form-control,
.form-select {
    padding: 0.75rem 1rem;
    border: 2px solid var(--gray-300);
    border-radius: var(--radius);
    transition: var(--transition-fast);
}

.form-control:focus,
.form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(26, 54, 93, 0.1);
}

.form-label {
    font-weight: 500;
    color: var(--gray-700);
    margin-bottom: 0.5rem;
}

/* Alerts */
.alert {
    border: none;
    border-radius: var(--radius);
    padding: 1rem 1.25rem;
}

/* Pagination */
.pagination .page-link {
    border: none;
    color: var(--gray-700);
    padding: 0.75rem 1rem;
    margin: 0 0.25rem;
    border-radius: var(--radius);
}

.pagination .page-link:hover {
    background: var(--gray-200);
}

.pagination .page-item.active .page-link {
    background: var(--primary);
    color: var(--white);
}

/* Specs Table */
.specs-table {
    width: 100%;
}

.specs-table tr:nth-child(even) {
    background: var(--gray-100);
}

.specs-table td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--gray-200);
}

.specs-table td:first-child {
    font-weight: 600;
    color: var(--gray-700);
    width: 40%;
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 9999;
}

/* Loading Spinner */
.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--gray-300);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Responsive */
@media (max-width: 768px) {
    .hero h1 {
        font-size: 2rem;
    }

    .section {
        padding: 2.5rem 0;
    }

    .section-title {
        font-size: 1.5rem;
    }

    .product-card .product-image {
        height: 180px;
    }
}

/* Utilities */
.text-accent-light {
    color: var(--accent-light) !important;
}

/* Add to Cart Animation */
@keyframes addToCart {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.2);
    }

    100% {
        transform: scale(1);
    }
}

.btn-add-cart.added {
    animation: addToCart 0.3s ease;
}

/* Stock Status */
.stock-status {
    font-size: 0.875rem;
    font-weight: 500;
}

.stock-status.in-stock {
    color: var(--success);
}

.stock-status.low-stock {
    color: var(--warning);
}

.stock-status.out-of-stock {
    color: var(--danger);
}

/* Quantity Selector */
.qty-selector {
    display: flex;
    align-items: center;
    border: 2px solid var(--gray-300);
    border-radius: var(--radius);
    overflow: hidden;
    width: fit-content;
}

.qty-selector button {
    width: 40px;
    height: 40px;
    border: none;
    background: var(--gray-100);
    color: var(--gray-700);
    cursor: pointer;
    transition: var(--transition-fast);
}

.qty-selector button:hover {
    background: var(--gray-200);
}

.qty-selector input {
    width: 60px;
    height: 40px;
    border: none;
    text-align: center;
    font-weight: 600;
}

.qty-selector input:focus {
    outline: none;
}