/* Main Styles for LIV - Libyan International Vet Company E-commerce Website */

/* General Styles */
body {
    font-family: 'Cairo', sans-serif;
    color: #333;
    background-color: #f8f9fa;
    position: relative;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    background-image: url('../slider/slider_bg.png');
    background-repeat: no-repeat;
    background-position: center center;
    background-size: cover;
    background-attachment: fixed;
    opacity: 0.8;
    z-index: -1;
    pointer-events: none;
}

/* Ensure content appears above watermark */
main, .container, .card, .navbar, footer {
    position: relative;
    z-index: 1;
}

/* Ensure navbar dropdowns appear above hero slider */
.navbar {
    position: relative;
    z-index: 2000;
}

.navbar .dropdown-menu {
    z-index: 2001;
}

/* Keep hero banner below nav for stacking */
.hero-banner,
.hero-banner .carousel {
    position: relative;
    z-index: 0;
}

/* Primary Color Gradient - Matching Business Card Blue */
:root {
    --primary-gradient: linear-gradient(135deg, #1976D2 0%, #1565C0 100%);
    --primary-gradient-hover: linear-gradient(135deg, #1565C0 0%, #0D47A1 100%);
    --primary-color: #1976D2;
    --primary-color-dark: #1565C0;
}

/* Override Bootstrap Primary Colors with Gradient */
.bg-primary {
    background: var(--primary-gradient) !important;
    border: none;
}

.btn-primary {
    background: var(--primary-gradient) !important;
    border: none;
    color: white !important;
    transition: all 0.3s ease;
}

.btn-primary:hover,
.btn-primary:focus,
.btn-primary:active {
    background: var(--primary-gradient-hover) !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(25, 118, 210, 0.4);
}

.btn-outline-primary {
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
    background: transparent;
    transition: all 0.3s ease;
}

.btn-outline-primary:hover {
    background: var(--primary-gradient) !important;
    border-color: transparent;
    color: white !important;
    transform: translateY(-2px);
}

.text-primary {
    color: var(--primary-color) !important;
}

.border-primary {
    border-color: var(--primary-color) !important;
}

.navbar-dark.bg-primary {
    background: var(--primary-gradient) !important;
}

.top-bar.bg-primary {
    background: var(--primary-gradient) !important;
}

.top-bar .current-lang-flag {
    font-size: 1.4rem;
    line-height: 1;
    display: inline-flex;
    transform: scale(1.15);
    transform-origin: center;
}

.ltr-text {
    direction: ltr;
    unicode-bidi: bidi-override;
}

/* RTL Specific Styles */
html[dir="rtl"] .ms-2 {
    margin-right: 0.5rem !important;
    margin-left: 0 !important;
}

html[dir="rtl"] .me-2 {
    margin-left: 0.5rem !important;
    margin-right: 0 !important;
}

html[dir="rtl"] .me-auto {
    margin-left: auto !important;
    margin-right: 0 !important;
}

html[dir="rtl"] .text-end {
    text-align: left !important;
}

html[dir="rtl"] .text-md-end {
    text-align: left !important;
}

/* Header & Navigation */
.top-bar {
    font-size: 0.75rem;
}

header.bg-white {
    font-size: 0.8rem;
}

header.bg-white .btn,
header.bg-white .form-control {
    font-size: 0.8rem;
}

.navbar {
    font-size: 0.8rem;
}

.logo-img {
    height: auto;
    width: auto;
    object-fit: contain;
    transition: transform 0.3s ease;
}

.logo-img:hover {
    transform: scale(1.05);
}

.navbar-dark .navbar-nav .nav-link {
    color: rgba(255, 255, 255, 0.85);
    font-weight: 500;
}

.navbar-dark .navbar-nav .nav-link:hover,
.navbar-dark .navbar-nav .nav-link.active {
    color: #fff;
}

/* Product Cards */
.product-card {
    transition: all 0.3s ease;
    border-radius: 10px;
    overflow: hidden;
    height: 100%;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    border: 1px solid #e9ecef;
}

.product-card:hover {
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.12);
    transform: translateY(-3px);
    border-color: var(--primary-color);
}

.product-image-wrapper {
    width: 100%;
    height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #f8f9fa;
    padding: 0.5rem;
    overflow: hidden;
    position: relative;
}

.product-card .card-img-top {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: transform 0.3s ease;
}

.product-card:hover .card-img-top {
    transform: scale(1.05);
}

.product-card .card-body {
    padding: 1rem;
}

.product-card .product-title {
    font-weight: 600;
    font-size: 0.95rem;
    margin-bottom: 0.5rem;
    height: 42px;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    line-height: 1.4;
}

.product-card .product-title a {
    color: #333;
    text-decoration: none;
    transition: color 0.3s ease;
}

.product-card .product-title a:hover {
    color: var(--primary-color);
}

.product-card .product-price {
    font-weight: 700;
    font-size: 1.1rem;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.5rem;
}

.product-card .product-category {
    font-size: 0.75rem;
    color: #6c757d;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.product-card .card-footer {
    padding: 0.75rem 1rem;
}

.product-card .btn {
    font-size: 0.875rem;
    padding: 0.5rem 1rem;
}

/* Product Detail Page */
.product-gallery {
    margin-bottom: 2rem;
}

.product-gallery .main-image {
    margin-bottom: 1rem;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    overflow: hidden;
}

.product-gallery .main-image img {
    width: 100%;
    height: 400px;
    object-fit: contain;
}

.product-gallery .thumbnails {
    display: flex;
    gap: 0.5rem;
}

.product-gallery .thumbnail {
    width: 80px;
    height: 80px;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    overflow: hidden;
    cursor: pointer;
}

.product-gallery .thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.product-gallery .thumbnail.active {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(25, 118, 210, 0.25);
}

/* Additional Gradient Styles */
.card-header.bg-primary {
    background: var(--primary-gradient) !important;
}

.badge.bg-primary {
    background: var(--primary-gradient) !important;
}

.dropdown-menu .dropdown-item:hover {
    background: var(--primary-gradient);
    color: white;
}

/* Link Colors */
a.text-primary:hover {
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Category Cards */
.category-card {
    transition: all 0.3s ease;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.category-card:hover {
    border-color: var(--primary-color);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.12);
    transform: translateY(-3px);
}

.category-image-wrapper {
    width: 100%;
    height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #f8f9fa;
    padding: 0.5rem;
    overflow: hidden;
}

.category-card .card-img-top {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: transform 0.3s ease;
}

.category-card:hover .card-img-top {
    transform: scale(1.05);
}

.category-card .card-body {
    padding: 0.75rem;
}

.category-card .card-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
    line-height: 1.3;
    min-height: 36px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.category-card .btn-primary {
    background: var(--primary-gradient) !important;
    border: none;
    padding: 0.4rem 1rem;
    font-size: 0.8rem;
}

/* Wholesale Banner */
.wholesale-banner .card.bg-primary {
    background: var(--primary-gradient) !important;
}

/* WhatsApp Float Button */
.whatsapp-float {
    background: var(--primary-gradient);
    transition: all 0.3s ease;
}

.whatsapp-float:hover {
    background: var(--primary-gradient-hover);
    transform: scale(1.1);
}

/* Partners Section */
.partners-carousel {
    padding: 1rem 0;
}

.partner-item {
    padding: 1rem;
    transition: transform 0.3s ease;
}

.partner-item:hover {
    transform: translateY(-5px);
}

.partner-logo {
    transition: all 0.3s ease;
}

.partner-link:hover .partner-logo {
    opacity: 1 !important;
    filter: brightness(0) invert(1) !important;
    transform: scale(1.1);
}

/* Hero Banner / Slider Styles */
.hero-banner {
    margin-top: 0;
    margin-bottom: 3rem;
}

.hero-banner .carousel {
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    direction: ltr !important;
}

.hero-banner .carousel-item {
    position: relative;
    height: 500px;
    overflow: hidden;
    direction: ltr !important;
}

.hero-banner .carousel-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    position: relative;
    z-index: 0;
}

/* Minimal RTL handling: keep carousel content LTR to avoid flipping */
[dir="rtl"] .hero-banner .carousel,
html[dir="rtl"] .hero-banner .carousel,
[dir="rtl"] .hero-banner .carousel-inner,
html[dir="rtl"] .hero-banner .carousel-inner,
[dir="rtl"] .hero-banner .carousel-item,
html[dir="rtl"] .hero-banner .carousel-item {
    direction: ltr !important;
}

.hero-banner .carousel-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 3rem;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.7) 0%, rgba(0, 0, 0, 0.3) 50%, transparent 100%);
    text-align: center;
}

.hero-banner .carousel-caption h2 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    color: white;
}

.hero-banner .carousel-caption p {
    font-size: 1.25rem;
    margin-bottom: 1.5rem;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
    color: rgba(255, 255, 255, 0.95);
}

.hero-banner .carousel-control-prev,
.hero-banner .carousel-control-next {
    width: 50px;
    height: 50px;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    backdrop-filter: blur(5px);
    transition: all 0.3s ease;
}

.hero-banner .carousel-control-prev {
    left: 20px;
}

.hero-banner .carousel-control-next {
    right: 20px;
}

/* Fix RTL positions: swap sides and unset conflicting properties */
[dir="rtl"] .hero-banner .carousel-control-prev {
    right: 20px;
    left: auto;
}
[dir="rtl"] .hero-banner .carousel-control-next {
    left: 20px;
    right: auto;
}

.hero-banner .carousel-control-prev:hover,
.hero-banner .carousel-control-next:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-50%) scale(1.1);
}

.hero-banner .carousel-indicators {
    bottom: 20px;
}

.hero-banner .carousel-indicators button {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.5);
    border: 2px solid rgba(255, 255, 255, 0.8);
    transition: all 0.3s ease;
}

.hero-banner .carousel-indicators button.active {
    background-color: white;
    width: 30px;
    border-radius: 6px;
}

/* Modern Sections Styles */
.section-header {
    margin-bottom: 3rem;
}

.section-title {
    font-size: clamp(2rem, 4vw, 2.5rem);
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.section-subtitle {
    font-size: 1.125rem;
    color: #6c757d;
}

/* Services Section */
.service-card-modern {
    background: white;
    padding: 2.5rem;
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.service-card-modern::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: var(--primary-gradient);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.service-card-modern:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

.service-card-modern:hover::before {
    transform: scaleX(1);
}

.service-number {
    font-size: 3rem;
    font-weight: 700;
    color: var(--primary-color);
    opacity: 0.2;
    margin-bottom: 1rem;
}

.service-image-wrapper {
    width: 66.67%;
    height: 133px;
    overflow: hidden;
    border-radius: 10px;
    background: #f8f9fa;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
}

.service-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: transform 0.3s ease;
}

.service-card-modern:hover .service-image {
    transform: scale(1.05);
}

.service-title-modern {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.service-description-modern {
    color: #6c757d;
    margin-bottom: 1.5rem;
    line-height: 1.8;
}

.service-link-modern {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
}

.service-link-modern:hover {
    color: var(--secondary);
    gap: 0.5rem;
}

/* About Section */
.about-tabs-modern {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 3rem;
    flex-wrap: wrap;
}

.tab-btn-modern {
    padding: 0.875rem 2rem;
    background: #f8f9fa;
    border: 2px solid #dee2e6;
    border-radius: 50px;
    cursor: pointer;
    font-weight: 600;
    color: #333;
    transition: all 0.3s ease;
}

.tab-btn-modern:hover,
.tab-btn-modern.active {
    background: var(--primary-gradient);
    color: white;
    border-color: transparent;
}

.tab-content-modern {
    position: relative;
    min-height: 300px;
}

.tab-pane-modern {
    display: none;
    animation: fadeIn 0.5s ease;
}

.tab-pane-modern.active {
    display: block;
}

.about-content-modern {
    max-width: 900px;
    margin: 0 auto;
}

.about-content-modern h2 {
    font-size: clamp(1.75rem, 3vw, 2.25rem);
    color: var(--primary-color);
    margin-bottom: 1.5rem;
}

.about-content-modern p {
    font-size: 1.125rem;
    color: #6c757d;
    line-height: 1.8;
}

/* Why Us Section */
.feature-card-modern {
    background: white;
    padding: 2.5rem;
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.feature-card-modern:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

.feature-icon-modern {
    margin-bottom: 1rem;
}

.feature-icon-modern i {
    transition: transform 0.3s ease;
}

.feature-card-modern:hover .feature-icon-modern i {
    transform: scale(1.1);
}

.feature-number-modern {
    font-size: 3rem;
    font-weight: 700;
    color: var(--primary-color);
    opacity: 0.2;
    margin-bottom: 1rem;
}

.feature-title-modern {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.feature-text-modern {
    color: #6c757d;
    line-height: 1.8;
}

/* Distribution Section */
.distribution-content-modern h2 {
    color: #ffc107;
    font-size: clamp(1.75rem, 3vw, 2.25rem);
}

.distribution-content-modern h3 {
    font-size: clamp(1.5rem, 2.5vw, 2rem);
    margin-bottom: 1.5rem;
}

.distribution-content-modern p {
    font-size: 1.125rem;
    line-height: 1.8;
    opacity: 0.9;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.hero-modern .hero-content h1 {
    font-size: 2rem;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .hero-banner .carousel-item {
        height: 300px;
    }
    
    .hero-banner .carousel-caption {
        padding: 1.5rem;
    }
    
    .hero-banner .carousel-caption h2 {
        font-size: 1.5rem;
    }
    
    .hero-banner .carousel-caption p {
        font-size: 1rem;
    }
    
    .hero-banner .carousel-control-prev,
    .hero-banner .carousel-control-next {
        width: 40px;
        height: 40px;
    }
    
    .about-tabs-modern {
        flex-direction: column;
    }
    
    .tab-btn-modern {
        width: 100%;
    }
    
    .service-card-modern,
    .feature-card-modern {
        margin-bottom: 1.5rem;
    }

    body {
        overflow-x: hidden;
    }

    img,
    svg,
    video,
    canvas {
        max-width: 100%;
        height: auto;
    }

    header.bg-white .row {
        row-gap: 0.75rem;
    }

    header.bg-white .col-md-3,
    header.bg-white .col-md-6 {
        width: 100%;
    }

    header.bg-white .col-md-3.text-end {
        width: 100%;
        text-align: start !important;
    }

    header.bg-white form.d-flex {
        flex-wrap: nowrap;
        gap: 0.5rem;
    }

    header.bg-white form.d-flex .form-control {
        min-height: 44px;
    }

    header.bg-white form.d-flex .btn {
        min-height: 44px;
        padding-left: 0.9rem;
        padding-right: 0.9rem;
    }

    header.bg-white .btn,
    nav.navbar .btn {
        min-height: 44px;
    }

    .top-bar .list-inline {
        display: flex;
        flex-wrap: wrap;
        row-gap: 0.35rem;
        column-gap: 0.75rem;
        margin-bottom: 0;
    }

    .top-bar .list-inline-item {
        margin: 0 !important;
    }

    .navbar .container {
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }

    .navbar-toggler {
        padding: 0.5rem 0.75rem;
        min-height: 44px;
        min-width: 44px;
    }

    .navbar-collapse {
        padding-top: 0.5rem;
        padding-bottom: 0.75rem;
    }

    .navbar-nav .nav-link {
        padding-top: 0.75rem;
        padding-bottom: 0.75rem;
    }

    .navbar-nav .dropdown-menu {
        width: 100%;
        border-radius: 0.5rem;
    }

    .navbar-nav .dropdown-item {
        padding-top: 0.75rem;
        padding-bottom: 0.75rem;
    }

    .btn-group[role="group"] {
        width: 100%;
    }

    .btn-group[role="group"] .btn {
        width: 50%;
    }

    .product-gallery .main-image img {
        height: 260px;
    }

    .product-gallery .thumbnails {
        flex-wrap: wrap;
    }

    .product-gallery .thumbnail {
        width: 72px;
        height: 72px;
    }

    header.bg-white {
        position: relative;
        z-index: 1;
    }

    .top-bar {
        position: relative;
        z-index: 5000 !important;
        overflow: visible;
    }

    .top-bar .dropdown {
        position: relative;
        z-index: 5100 !important;
    }

    .top-bar .dropdown-menu {
        z-index: 5200 !important;
    }

    .top-bar .dropdown-menu.show {
        z-index: 5300 !important;
    }

    .top-bar .dropdown .d-flex > span {
        pointer-events: none;
    }

    .top-bar .current-lang-flag {
        font-size: 1.4rem !important;
        line-height: 1 !important;
        display: inline-flex;
        transform: scale(1.15);
        transform-origin: center;
    }
}

@media (max-width: 767.98px) {
    .categories-section .categories-cards {
        display: none !important;
    }

    .categories-section .section-title a.btn {
        display: none !important;
    }

    .categories-section .categories-cards > [class*="col-"] {
        display: none !important;
    }

    .categories-section .category-card {
        display: none !important;
    }

    .categories-section .categories-mobile-menu {
        display: block !important;
    }

    .categories-section .categories-mobile-menu .dropdown-menu {
        max-height: 70vh;
        overflow: auto;
    }

    .categories-section .categories-mobile-menu .dropdown-item {
        padding-top: 0.6rem;
        padding-bottom: 0.6rem;
        font-size: 0.95rem;
        line-height: 1.2;
        white-space: normal;
    }

    .categories-section .category-mobile-icon {
        width: 22px;
        height: 22px;
        object-fit: contain;
        border-radius: 4px;
        flex: 0 0 22px;
        background: #f8f9fa;
    }

    .why-us-section {
        display: block !important;
    }

    .distribution-section {
        display: none !important;
    }
}