/* Gadgets BD - Premium E-Commerce Styles */

:root {
    --primary: #4f46e5;
    --primary-dark: #4338ca;
    --secondary: #06b6d4;
    --accent: #f59e0b;
    --success: #10b981;
    --danger: #ef4444;
    --dark: #111827;
    --gray-900: #1f2937;
    --gray-700: #374151;
    --gray-500: #6b7280;
    --gray-300: #d1d5db;
    --gray-100: #f3f4f6;
    --gray-50: #f9fafb;
    --white: #ffffff;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
    --radius: 12px;
    --radius-lg: 16px;
    --transition: 0.25s ease;
}

*, *::before, *::after {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: 'Inter', 'Hind Siliguri', sans-serif;
    color: var(--gray-900);
    background: var(--gray-50);
    line-height: 1.6;
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

a {
    color: inherit;
    text-decoration: none;
}

img {
    max-width: 100%;
    display: block;
}

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

/* Flash messages */
.flash {
    position: fixed;
    top: 80px;
    right: 20px;
    padding: 14px 22px;
    border-radius: var(--radius);
    color: var(--white);
    font-weight: 500;
    box-shadow: var(--shadow-lg);
    z-index: 9999;
    animation: slideIn 0.3s ease;
}

.flash-success { background: var(--success); }
.flash-error { background: var(--danger); }

@keyframes slideIn {
    from { transform: translateX(120%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* Header */
.site-header {
    background: var(--white);
    border-bottom: 1px solid var(--gray-100);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.nav-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 70px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    font-size: 1.25rem;
    color: var(--gray-900);
}

.logo-icon {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: var(--white);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
}

.nav-list {
    display: flex;
    align-items: center;
    gap: 32px;
}

.nav-list a {
    font-weight: 500;
    color: var(--gray-700);
    transition: color var(--transition);
}

.nav-list a:hover,
.nav-list a.active {
    color: var(--primary);
}

.nav-cta {
    background: var(--primary);
    color: var(--white) !important;
    padding: 8px 18px;
    border-radius: 20px;
}

.admin-link {
    color: var(--accent) !important;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 20px;
}

.cart-icon {
    position: relative;
    color: var(--gray-900);
    transition: color var(--transition);
}

.cart-icon:hover {
    color: var(--primary);
}

.cart-count {
    position: absolute;
    top: -8px;
    right: -8px;
    background: var(--primary);
    color: var(--white);
    width: 18px;
    height: 18px;
    font-size: 0.7rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hamburger {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
}

.hamburger span {
    width: 24px;
    height: 2px;
    background: var(--gray-900);
    border-radius: 2px;
    transition: 0.3s ease;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: 10px;
    border: none;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
}

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

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

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

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

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

.btn-success:hover {
    opacity: 0.9;
}

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

.btn-danger:hover {
    opacity: 0.9;
}

.btn-block {
    width: 100%;
}

/* Hero */
.hero {
    background: linear-gradient(135deg, #f5f3ff, #ecfeff);
    padding: 80px 0;
    text-align: center;
}

.hero h1 {
    font-size: 2.75rem;
    margin: 0 0 16px;
    color: var(--gray-900);
}

.hero p {
    font-size: 1.15rem;
    color: var(--gray-500);
    max-width: 600px;
    margin: 0 auto 30px;
}

/* Section */
.section {
    padding: 60px 0;
}

.section-title {
    font-size: 1.75rem;
    margin: 0 0 32px;
    text-align: center;
}

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

.product-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: transform var(--transition), box-shadow var(--transition);
    border: 1px solid var(--gray-100);
}

.product-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-xl);
}

.product-image {
    position: relative;
    height: 220px;
    overflow: hidden;
    background: var(--gray-100);
}

.product-image img,
.product-image .image-placeholder {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.product-image .image-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gray-500);
    font-size: 1.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, #f5f3ff, #ecfeff);
}

.product-info {
    padding: 22px;
}

.product-info h3 {
    margin: 0 0 8px;
    font-size: 1.1rem;
    color: var(--gray-900);
}

.product-info p {
    margin: 0 0 14px;
    color: var(--gray-500);
    font-size: 0.9rem;
    line-height: 1.5;
}

.product-price {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 14px;
    display: block;
}

.product-actions {
    display: flex;
    gap: 10px;
}

.product-actions .btn {
    flex: 1;
    padding: 10px 14px;
    font-size: 0.85rem;
}

/* Product detail */
.product-detail {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 50px;
    padding: 50px 0;
    align-items: start;
}

.detail-image {
    background: var(--gray-100);
    border-radius: var(--radius-lg);
    overflow: hidden;
    height: 480px;
}

.detail-image img,
.detail-image .image-placeholder {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.detail-content h1 {
    font-size: 2rem;
    margin: 0 0 12px;
}

.detail-content .price {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 20px;
    display: block;
}

.detail-content .description {
    color: var(--gray-700);
    margin-bottom: 24px;
    line-height: 1.7;
}

.quantity-selector {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 22px;
}

.quantity-selector button {
    width: 36px;
    height: 36px;
    border: 1px solid var(--gray-300);
    background: var(--white);
    border-radius: 8px;
    cursor: pointer;
    font-size: 1.1rem;
}

.quantity-selector input {
    width: 60px;
    text-align: center;
    height: 36px;
    border: 1px solid var(--gray-300);
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
}

/* Order form */
.order-section {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 32px;
    box-shadow: var(--shadow);
    margin-top: 40px;
}

.order-section h2 {
    margin-top: 0;
    margin-bottom: 24px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    color: var(--gray-700);
}

.form-control {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--gray-300);
    border-radius: 10px;
    font-size: 1rem;
    font-family: inherit;
    transition: border-color var(--transition);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgb(79 70 229 / 0.1);
}

.payment-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 24px;
}

.payment-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px;
    border: 1px solid var(--gray-300);
    border-radius: 10px;
    cursor: pointer;
    transition: border-color var(--transition);
}

.payment-option:hover,
.payment-option input:checked + label,
.payment-option:has(input:checked) {
    border-color: var(--primary);
}

.payment-option input {
    width: 18px;
    height: 18px;
    accent-color: var(--primary);
}

/* Auth forms */
.auth-container {
    min-height: calc(100vh - 70px - 280px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
}

.auth-card {
    background: var(--white);
    width: 100%;
    max-width: 460px;
    padding: 42px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
}

.auth-card h1 {
    margin: 0 0 8px;
    text-align: center;
}

.auth-card p {
    text-align: center;
    color: var(--gray-500);
    margin-bottom: 28px;
}

.auth-card .btn {
    width: 100%;
    margin-top: 10px;
}

/* Cart */
.cart-container {
    padding: 50px 0;
}

.cart-layout {
    display: grid;
    grid-template-columns: 1.4fr 0.6fr;
    gap: 40px;
    align-items: start;
}

.cart-items {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow);
}

.cart-item {
    display: grid;
    grid-template-columns: 80px 1fr auto;
    gap: 20px;
    align-items: center;
    padding: 20px 0;
    border-bottom: 1px solid var(--gray-100);
}

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

.cart-item-image {
    width: 80px;
    height: 80px;
    border-radius: 10px;
    overflow: hidden;
    background: var(--gray-100);
}

.cart-item-image img,
.cart-item-image .image-placeholder {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.cart-item-info h4 {
    margin: 0 0 4px;
}

.cart-item-info .price {
    color: var(--primary);
    font-weight: 600;
}

.cart-item-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.cart-item-actions .quantity-input {
    width: 50px;
    text-align: center;
    border: 1px solid var(--gray-300);
    border-radius: 6px;
    padding: 6px;
}

.cart-summary {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow);
}

.cart-summary h3 {
    margin-top: 0;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 14px;
    color: var(--gray-700);
}

.summary-row.total {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--gray-900);
    border-top: 1px solid var(--gray-100);
    padding-top: 14px;
    margin-top: 14px;
}

.empty-cart {
    text-align: center;
    padding: 80px 20px;
}

.empty-cart h2 {
    margin-bottom: 16px;
}

/* Modals */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal-overlay.active {
    display: flex;
    opacity: 1;
}

.modal {
    background: var(--white);
    width: 100%;
    max-width: 560px;
    max-height: 90vh;
    overflow-y: auto;
    border-radius: var(--radius-lg);
    padding: 34px;
    box-shadow: var(--shadow-xl);
    transform: scale(0.96);
    transition: transform 0.3s ease;
}

.modal-overlay.active .modal {
    transform: scale(1);
}

.modal h2 {
    margin: 0 0 22px;
}

.modal-summary {
    background: var(--gray-50);
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 22px;
}

.modal-summary img {
    width: 80px;
    height: 80px;
    border-radius: 10px;
    object-fit: cover;
    margin-bottom: 14px;
}

.modal-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    font-size: 0.95rem;
}

.modal-actions {
    display: flex;
    gap: 12px;
    margin-top: 24px;
}

.modal-actions .btn {
    flex: 1;
}

/* Profile */
.profile-grid {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 30px;
    padding: 40px 0;
    align-items: start;
}

.sidebar {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow);
}

.sidebar a {
    display: block;
    padding: 12px 16px;
    border-radius: 10px;
    color: var(--gray-700);
    font-weight: 500;
    margin-bottom: 6px;
    transition: all var(--transition);
}

.sidebar a:hover,
.sidebar a.active {
    background: var(--gray-100);
    color: var(--primary);
}

.profile-content {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 32px;
    box-shadow: var(--shadow);
}

/* Admin */
.admin-layout {
    display: grid;
    grid-template-columns: 260px 1fr;
    min-height: calc(100vh - 70px);
}

.admin-sidebar {
    background: var(--gray-900);
    color: var(--white);
    padding: 28px;
}

.admin-sidebar a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    border-radius: 10px;
    margin-bottom: 8px;
    color: var(--gray-300);
    transition: all var(--transition);
}

.admin-sidebar a:hover,
.admin-sidebar a.active {
    background: var(--gray-700);
    color: var(--white);
}

.admin-main {
    padding: 32px;
}

.table-responsive {
    overflow-x: auto;
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 700px;
}

.admin-table th,
.admin-table td {
    padding: 16px;
    text-align: left;
    border-bottom: 1px solid var(--gray-100);
}

.admin-table th {
    background: var(--gray-50);
    font-weight: 600;
    color: var(--gray-700);
}

.admin-table tr:last-child td {
    border-bottom: none;
}

.badge {
    display: inline-flex;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: capitalize;
}

.badge-pending { background: #fef3c7; color: #92400e; }
.badge-confirmed { background: #d1fae5; color: #065f46; }
.badge-processing { background: #e0f2fe; color: #075985; }
.badge-shipped { background: #c7d2fe; color: #3730a3; }
.badge-delivered { background: #d1fae5; color: #065f46; }
.badge-cancelled { background: #fee2e2; color: #991b1b; }

/* Footer */
.site-footer {
    background: var(--gray-900);
    color: var(--gray-300);
    padding: 60px 0 24px;
}

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

.footer-col h4 {
    color: var(--white);
    margin-bottom: 16px;
}

.footer-col a {
    display: block;
    color: var(--gray-400);
    margin-bottom: 8px;
    transition: color var(--transition);
}

.footer-col a:hover {
    color: var(--white);
}

.footer-bottom {
    text-align: center;
    border-top: 1px solid var(--gray-700);
    padding-top: 24px;
    font-size: 0.9rem;
}

/* Responsive */
@media (max-width: 1024px) {
    .product-detail {
        grid-template-columns: 1fr;
    }

    .detail-image {
        height: 360px;
    }

    .cart-layout,
    .profile-grid,
    .admin-layout {
        grid-template-columns: 1fr;
    }

    .admin-sidebar {
        display: flex;
        gap: 8px;
        overflow-x: auto;
        padding: 16px;
    }

    .admin-sidebar a {
        white-space: nowrap;
    }
}

@media (max-width: 768px) {
    .main-nav {
        position: fixed;
        top: 70px;
        left: 0;
        right: 0;
        background: var(--white);
        padding: 20px;
        box-shadow: var(--shadow-lg);
        transform: translateY(-120%);
        opacity: 0;
        pointer-events: none;
        transition: all 0.3s ease;
        z-index: 999;
    }

    .main-nav.open {
        transform: translateY(0);
        opacity: 1;
        pointer-events: all;
    }

    .nav-list {
        flex-direction: column;
        gap: 18px;
        align-items: flex-start;
    }

    .hamburger {
        display: flex;
    }

    .hero h1 {
        font-size: 2rem;
    }

    .product-grid {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    }

    .cart-item {
        grid-template-columns: 60px 1fr;
    }

    .cart-item-actions {
        grid-column: span 2;
        justify-content: flex-end;
    }

    .auth-card {
        padding: 28px;
    }
}
