/* AffiliateStore — Professional E-Commerce Theme layered over Bootstrap 5 */

:root {
    --brand-primary: #0f172a;
    --brand-secondary: #1e293b;
    --brand-accent: #f97316;
    --brand-accent-dark: #ea580c;
    --brand-success: #16a34a;
    --brand-danger: #dc2626;
    --brand-light: #f8fafc;
    --brand-muted: #64748b;
    --brand-border: #e2e8f0;
    --brand-card: #ffffff;
    --brand-shadow: 0 12px 30px rgba(15, 23, 42, 0.08);
    --brand-shadow-hover: 0 18px 45px rgba(15, 23, 42, 0.14);
    --brand-radius: 18px;
}

body {
    font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
    background: #f8fafc;
    color: #0f172a;
    line-height: 1.6;
}

/* Global links */
a {
    color: var(--brand-primary);
    text-decoration: none;
}

    a:hover {
        color: var(--brand-accent);
    }

/* Bootstrap button enhancement */
.btn {
    border-radius: 999px;
    font-weight: 600;
    padding: 0.6rem 1.2rem;
    transition: all 0.2s ease;
}

.btn-primary {
    background: var(--brand-primary);
    border-color: var(--brand-primary);
}

    .btn-primary:hover {
        background: var(--brand-secondary);
        border-color: var(--brand-secondary);
        transform: translateY(-1px);
    }

.btn-warning,
.btn-accent {
    background: var(--brand-accent);
    border-color: var(--brand-accent);
    color: #fff;
}

    .btn-warning:hover,
    .btn-accent:hover {
        background: var(--brand-accent-dark);
        border-color: var(--brand-accent-dark);
        color: #fff;
    }

/* Navbar */
.navbar {
    background: #ffffff !important;
    border-bottom: 1px solid var(--brand-border);
    box-shadow: 0 6px 20px rgba(15, 23, 42, 0.04);
}

.navbar-brand {
    font-weight: 800;
    letter-spacing: -0.03em;
    color: var(--brand-primary) !important;
}

    .navbar-brand span,
    .navbar-brand .text-primary {
        color: var(--brand-accent) !important;
    }

.navbar .nav-link {
    color: #334155 !important;
    font-weight: 600;
    border-radius: 999px;
    padding: 0.5rem 0.9rem !important;
}

    .navbar .nav-link:hover,
    .navbar .nav-link.active {
        color: var(--brand-accent) !important;
        background: #fff7ed;
    }

/* Hero on the home page */
.hero {
    position: relative;
    overflow: hidden;
    border-radius: 0 0 42px 42px;
    background: radial-gradient(circle at top left, rgba(249, 115, 22, 0.30), transparent 34%), radial-gradient(circle at bottom right, rgba(14, 165, 233, 0.22), transparent 35%), linear-gradient(135deg, #020617 0%, #0f172a 48%, #1e293b 100%);
    color: #ffffff;
    padding: 4.5rem 0;
}

    .hero::after {
        content: "";
        position: absolute;
        inset: 0;
        background-image: linear-gradient(rgba(255,255,255,0.04) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,0.04) 1px, transparent 1px);
        background-size: 42px 42px;
        pointer-events: none;
    }

    .hero > * {
        position: relative;
        z-index: 1;
    }

    .hero h1 {
        font-weight: 850;
        letter-spacing: -0.05em;
    }

    .hero p {
        color: #cbd5e1;
        font-size: 1.08rem;
    }

    .hero .btn {
        box-shadow: 0 12px 24px rgba(249, 115, 22, 0.26);
    }

/* Section headings */
.section-title,
h2, h3 {
    color: var(--brand-primary);
    font-weight: 800;
    letter-spacing: -0.035em;
}

.section-subtitle {
    color: var(--brand-muted);
}

/* Product cards */
.product-card {
    overflow: hidden;
    border: 1px solid var(--brand-border);
    border-radius: var(--brand-radius);
    background: var(--brand-card);
    transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
}

    .product-card:hover {
        transform: translateY(-6px);
        border-color: rgba(249, 115, 22, 0.35);
        box-shadow: var(--brand-shadow-hover) !important;
    }

    .product-card .card-body {
        padding: 1.1rem;
    }

    .product-card .card-img-top {
        object-fit: cover;
        height: 220px;
        background: linear-gradient(135deg, #f8fafc, #e2e8f0);
        transition: transform 0.28s ease;
    }

    .product-card:hover .card-img-top {
        transform: scale(1.04);
    }

/* Product image wrapper */
.product-img-wrap {
    position: relative;
    overflow: hidden;
    background: #f8fafc;
}

    .product-img-wrap::after {
        content: "";
        position: absolute;
        inset: auto 0 0 0;
        height: 45%;
        background: linear-gradient(to top, rgba(15, 23, 42, 0.25), transparent);
        pointer-events: none;
    }

    /* Discount / featured badges positioned over the image */
    .product-img-wrap .discount-badge {
        position: absolute;
        top: 0.75rem;
        left: 0.75rem;
        z-index: 2;
        font-size: 0.78rem;
        font-weight: 800;
        letter-spacing: 0.02em;
        background: var(--brand-danger) !important;
        color: #ffffff;
        border-radius: 999px;
        padding: 0.35rem 0.65rem;
        box-shadow: 0 8px 18px rgba(220, 38, 38, 0.28);
    }

    .product-img-wrap .featured-badge {
        position: absolute;
        top: 0.75rem;
        right: 0.75rem;
        z-index: 2;
        font-size: 0.78rem;
        font-weight: 800;
        background: var(--brand-accent) !important;
        color: #ffffff;
        border-radius: 999px;
        padding: 0.35rem 0.65rem;
        box-shadow: 0 8px 18px rgba(249, 115, 22, 0.28);
    }

/* Product content */
.product-card .card-title,
.product-card h5 {
    font-size: 1rem;
    font-weight: 750;
    color: #0f172a;
}

.product-card .card-text {
    color: var(--brand-muted);
}

.product-card .price,
.product-card .fw-bold {
    color: var(--brand-primary);
}

.product-card .text-success {
    color: var(--brand-success) !important;
}

.product-card .text-danger {
    color: var(--brand-danger) !important;
}

/* 2-line title clamp */
.text-truncate-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    min-height: 2.9em;
}

/* Category tiles */
.category-card {
    position: relative;
    overflow: hidden;
    border: 1px solid var(--brand-border);
    border-radius: var(--brand-radius);
    background: #ffffff;
    transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
}

    .category-card::before {
        content: "";
        position: absolute;
        inset: 0;
        background: linear-gradient(135deg, rgba(249, 115, 22, 0.08), transparent 55%);
        opacity: 0;
        transition: opacity 0.22s ease;
    }

    .category-card:hover {
        transform: translateY(-5px);
        border-color: rgba(249, 115, 22, 0.35);
        box-shadow: var(--brand-shadow-hover) !important;
    }

        .category-card:hover::before {
            opacity: 1;
        }

    .category-card .card-body {
        position: relative;
        z-index: 1;
    }

    .category-card h5,
    .category-card .card-title {
        font-weight: 800;
        color: var(--brand-primary);
    }

/* Forms and filters */
.form-control,
.form-select {
    border-radius: 999px;
    border: 1px solid var(--brand-border);
    padding: 0.65rem 1rem;
    box-shadow: none;
}

    .form-control:focus,
    .form-select:focus {
        border-color: var(--brand-accent);
        box-shadow: 0 0 0 0.2rem rgba(249, 115, 22, 0.16);
    }

/* Search / filter panel */
.filter-box,
.search-box,
.card {
    border-radius: var(--brand-radius);
    border-color: var(--brand-border);
}

/* Badges */
.badge {
    border-radius: 999px;
    font-weight: 700;
    padding: 0.45em 0.7em;
}

    .badge.bg-primary {
        background: var(--brand-primary) !important;
    }

    .badge.bg-warning {
        background: var(--brand-accent) !important;
        color: #ffffff !important;
    }

    .badge.bg-danger {
        background: var(--brand-danger) !important;
    }

/* Admin sidebar */
aside {
    background: #ffffff;
    border-right: 1px solid var(--brand-border);
}

    aside .nav-link {
        color: #475569;
        border-radius: 12px;
        padding: 0.65rem 0.85rem;
        font-weight: 600;
        transition: all 0.18s ease;
    }

        aside .nav-link.active {
            background: #fff7ed;
            color: var(--brand-accent);
            box-shadow: inset 3px 0 0 var(--brand-accent);
        }

        aside .nav-link:hover {
            background: #f8fafc;
            color: var(--brand-primary);
        }

/* Tables for admin/product list */
.table {
    vertical-align: middle;
}

    .table thead th {
        background: #f8fafc;
        color: #334155;
        font-size: 0.85rem;
        text-transform: uppercase;
        letter-spacing: 0.04em;
        border-bottom: 1px solid var(--brand-border);
    }

    .table tbody tr:hover {
        background: #fff7ed;
    }

/* Footer */
footer {
    background: #020617;
    color: #cbd5e1;
    border-top: 1px solid rgba(255,255,255,0.08);
}

    footer a {
        color: #e2e8f0;
    }

        footer a:hover {
            color: var(--brand-accent);
        }

/* Utility enhancements */
.shadow-sm {
    box-shadow: var(--brand-shadow) !important;
}

.rounded {
    border-radius: var(--brand-radius) !important;
}

.text-muted {
    color: var(--brand-muted) !important;
}

/* Responsive improvements */
@media (max-width: 768px) {
    .hero {
        padding: 3rem 0;
        border-radius: 0 0 28px 28px;
    }

        .hero h1 {
            font-size: 2rem;
        }

    .product-card .card-img-top {
        height: 190px;
    }

    .navbar .nav-link {
        padding: 0.65rem 0.75rem !important;
    }
}
