@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@400;600;700&display=swap');

:root {
    --primary-color: #003366;
    --secondary-color: #cc0000;
    --accent-color: #ff9900;
    --light-bg: #f8f9fa;
    --text-color: #212529;
    --card-shadow: 0 4px 6px rgba(0, 0, 0, 0.07);
    --border-radius: 0.75rem;
    --nav-height: 65px;
}

body {
    font-family: 'Cairo', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: var(--text-color);
    background-color: var(--light-bg);
    padding-bottom: 0;
}

/* Mobile Bottom Nav Spacing */
@media (max-width: 991px) {
    body {
        padding-bottom: calc(var(--nav-height) + 20px);
    }
}

/* Typography Fixes */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-weight: 700;
}

/* Card Styling */
.card-custom {
    border: none;
    border-radius: var(--border-radius);
    box-shadow: var(--card-shadow);
    transition: all 0.3s ease;
    background: #fff;
    overflow: hidden;
}

.card-custom:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* Modern Inputs */
.form-control,
.form-select {
    border-radius: 0.5rem;
    padding: 0.75rem 1rem;
    border: 1px solid #e5e7eb;
}

.form-control:focus,
.form-select:focus {
    box-shadow: 0 0 0 3px rgba(13, 44, 82, 0.1);
    border-color: var(--primary-color);
}

/* Bottom Navigation Bar */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: var(--nav-height);
    background-color: #ffffff;
    display: flex;
    justify-content: space-around;
    align-items: center;
    box-shadow: 0 -1px 1px rgba(0, 0, 0, 0.05);
    z-index: 1050;
    border-top-left-radius: 1.5rem;
    /* Modern touch */
    border-top-right-radius: 1.5rem;
}

.nav-item-mobile {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: #9ca3af;
    font-size: 0.75rem;
    flex: 1;
    height: 100%;
    transition: color 0.2s;
}

.nav-item-mobile i {
    font-size: 1.25rem;
    margin-bottom: 4px;
}

.nav-item-mobile.active {
    color: var(--primary-color);
    font-weight: 600;
}

.nav-item-mobile.active i {
    transform: scale(1.1);
}

/* Floating Action Button (Optional Center) */
.fab-center {
    width: 56px;
    height: 56px;
    background-color: var(--secondary-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    box-shadow: 0 4px 10px rgba(214, 34, 34, 0.4);
    transform: translateY(-20px);
    border: 4px solid var(--light-bg);
}

.fab-center i {
    font-size: 1.5rem;
    margin: 0;
}


/* Hero Section */
.hero-section {
    background: linear-gradient(rgba(13, 44, 82, 0.9), rgba(13, 44, 82, 0.7)), url('../images/hero-bg.jpg');
    background-size: cover;
    background-position: center;
    color: #fff;
    padding: 100px 0;
}

/* --- Modern Glass Navbar --- */
.glass-nav {
    background: rgba(13, 44, 82, 0.85);
    /* Semi-transparent Primary */
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    padding-top: 0.8rem;
    padding-bottom: 0.8rem;
}

.nav-link-custom {
    color: rgba(255, 255, 255, 0.85);
    padding: 0.6rem 1rem;
    border-radius: 50px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s ease;
    font-size: 0.95rem;
    white-space: nowrap;
}

.nav-link-custom:hover,
.nav-link-custom.active {
    background: rgba(255, 255, 255, 0.15);
    color: white;
    transform: translateY(-1px);
}

.lang-toggle {
    color: white;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    font-size: 0.85rem;
    transition: all 0.2s;
}

.lang-toggle:hover {
    background: white;
    color: var(--primary-color);
}

/* Mobile Hamburger Icon */
.hamburger-icon {
    width: 30px;
    height: 20px;
    position: relative;
    cursor: pointer;
}

.hamburger-icon span {
    display: block;
    position: absolute;
    height: 3px;
    width: 100%;
    background: #fff;
    border-radius: 9px;
    opacity: 1;
    left: 0;
    transform: rotate(0deg);
    transition: .25s ease-in-out;
}

.hamburger-icon span:nth-child(1) {
    top: 0px;
}

.hamburger-icon span:nth-child(2) {
    top: 8px;
}

.hamburger-icon span:nth-child(3) {
    top: 16px;
}

/* Adjust body padding for fixed nav */
body {
    padding-top: 80px;
}

/* More Dropdown */
.more-dropdown .dropdown-menu {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
}

.more-dropdown .nav-link-custom {
    color: var(--text-color);
    display: block;
}

.more-dropdown .nav-link-custom:hover {
    background: var(--light-bg);
    color: var(--primary-color);
}

/* Select2 Customization */
.select2-container .select2-selection--single {
    height: 38px !important;
    border: 1px solid #ced4da !important;
    border-radius: 0.5rem !important;
    padding: 5px 0;
}

.select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 36px !important;
}

.select2-container--default .select2-selection--single .select2-selection__rendered {
    color: var(--text-color) !important;
    line-height: 28px !important;
    padding-left: 12px;
    padding-right: 12px;
}

.select2-container--default .select2-results__option--highlighted.select2-results__option--selectable {
    background-color: var(--primary-color) !important;
    color: white !important;
}

.select2-dropdown {
    border: 1px solid #ced4da !important;
    border-radius: 0.5rem !important;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

/* RTL Support for Select2 */
[dir='rtl'] .select2-container--default .select2-selection--single .select2-selection__rendered {
    padding-right: 12px;
    padding-left: 20px;
}

[dir='rtl'] .select2-container--default .select2-selection--single .select2-selection__arrow {
    left: 1px;
    right: auto;
}

/* Table Responsive Fixes */
.table td {
    vertical-align: middle;
}

@media (max-width: 768px) {
    .table thead {
        display: none;
    }

    .table,
    .table tbody,
    .table tr,
    .table td {
        display: block;
        width: 100%;
    }

    .table tr {
        margin-bottom: 15px;
        border: 1px solid #ddd;
        border-radius: 8px;
        overflow: hidden;
    }

    .table td {
        text-align: right;
        position: relative;
        padding-left: 50%;
    }

    .table td::before {
        content: attr(data-label);
        position: absolute;
        left: 0;
        width: 50%;
        padding-left: 15px;
        font-weight: bold;
        text-align: left;
    }
}

/* Offcanvas Styling */
.offcanvas {
    background-color: var(--primary-color) !important;
}

.offcanvas .btn-close-white {
    opacity: 0.8;
}

.offcanvas .nav-link {
    font-size: 1.1rem;
    padding: 15px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.offcanvas .nav-link:hover {
    padding-left: 10px;
    background: rgba(255, 255, 255, 0.05);
}

/* Shopping Cart Offcanvas Overrides */
#offcanvasCart {
    background-color: #ffffff !important;
    color: var(--text-color);
}

#offcanvasCart .btn-close {
    filter: none;
    /* Reset white filter for close button on white bg */
}

/* Modern Product Cards */
.product-card {
    border: none;
    background: #fff;
    border-radius: 20px;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.05);
    height: 100%;
    position: relative;
    padding-bottom: 20px;
    display: flex;
    flex-direction: column;
}

.product-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.12);
}

.product-img-wrapper {
    height: 220px;
    padding: 30px;
    background: radial-gradient(circle at center, #f8f9fa 0%, #ffffff 70%);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    flex-shrink: 0;
}

.product-img-wrapper img {
    max-height: 100%;
    max-width: 100%;
    transition: transform 0.5s ease;
    filter: drop-shadow(0 5px 15px rgba(0, 0, 0, 0.1));
}

.product-card:hover .product-img-wrapper img {
    transform: scale(1.1) rotate(2deg);
}

.product-details {
    padding: 20px 25px;
    text-align: center;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.product-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 10px;
    line-height: 1.4;
}

.product-price {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--secondary-color);
    margin-bottom: 20px;
    display: block;
}

.btn-add-cart {
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 50px;
    padding: 10px 25px;
    font-weight: 600;
    width: 100%;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(0, 51, 102, 0.2);
    margin-top: auto;
}

.btn-add-cart:hover {
    background: var(--secondary-color);
    transform: scale(1.05);
    color: white;
    box-shadow: 0 8px 15px rgba(204, 0, 0, 0.2);
}

/* Fix Cart Badge */
.cart-badge {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: bold;
    border-radius: 50%;
    color: white;
    border: 2px solid white;
    /* Optional: adds a nice border to separate from icon */
}

/* Mobile Product Layout Adjustments */
@media (max-width: 768px) {
    .product-img-wrapper {
        height: 150px;
        padding: 15px;
    }

    .product-details {
        padding: 15px 10px;
    }

    .product-title {
        font-size: 0.95rem;
    }

    .product-price {
        font-size: 1.1rem;
        margin-bottom: 10px;
    }

    .btn-add-cart {
        padding: 8px 15px;
        font-size: 0.9rem;
    }
}