/* ============================================
   DAT TECHNOLOGIES - MAIN STYLESHEET
   ============================================ */

/* CSS Variables */
:root {
    --primary-color: #007bff;
    --primary-dark: #0056b3;
    --secondary-color: #6c757d;
    --success-color: #28a745;
    --success-dark: #1e7e34;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #17a2b8;
    --light-color: #f8f9fa;
    --dark-color: #343a40;
    --white-color: #ffffff;
    --gray-color: #6c757d;
    --gray-light: #f8f9fa;
    --border-color: #dee2e6;
    --shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
    --shadow-sm: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    --shadow-lg: 0 1rem 3rem rgba(0, 0, 0, 0.175);
    --radius: 0.375rem;
    --radius-lg: 0.5rem;
    --radius-xl: 1rem;
    --transition: all 0.3s ease;
}

/* Reset & Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: var(--dark-color);
    line-height: 1.6;
    background-color: var(--white-color);
    overflow-x: hidden;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.2;
    margin-bottom: 1rem;
}

p {
    margin-bottom: 1rem;
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--primary-dark);
}

/* Utility Classes */
.container {
    max-width: 1200px;
}

.section-padding {
    padding: 5rem 0;
}

.section-title {
    position: relative;
    margin-bottom: 3rem;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 0;
    width: 60px;
    height: 3px;
    background: var(--primary-color);
}

.section-subtitle {
    color: var(--gray-color);
    margin-bottom: 2rem;
}

/* Top Bar */
.top-bar {
    font-size: 0.875rem;
}

.top-bar-contact i {
    width: 16px;
}

/* Header */
.main-header {
    z-index: 1030;
}

.navbar-brand img {
    transition: var(--transition);
}

.navbar-brand img:hover {
    transform: scale(1.05);
}

.nav-link {
    font-weight: 500;
    padding: 0.5rem 1rem;
}

.nav-link.active {
    color: var(--primary-color) !important;
}

.dropdown-menu {
    border: none;
    box-shadow: var(--shadow);
}

.dropdown-submenu {
    position: relative;
}

.dropdown-submenu .dropdown-menu {
    top: 0;
    left: 100%;
    margin-top: -1px;
    display: none;
}

.dropdown-submenu:hover .dropdown-menu {
    display: block;
}

/* Hero Banner */
.hero-banner .carousel-item {
    height: 500px;
}

.hero-banner .carousel-item img {
    height: 100%;
    object-fit: cover;
}

.hero-banner .carousel-caption {
    background: rgba(0, 0, 0, 0.5);
    padding: 2rem;
    border-radius: var(--radius);
    max-width: 600px;
    margin: 0 auto;
}

/* Category Cards */
.category-card {
    transition: var(--transition);
    border: 1px solid var(--border-color);
}

.category-card:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-color);
}

.category-icon {
    height: 80px;
    object-fit: contain;
}

/* Product Cards */
.product-card {
    transition: var(--transition);
    border: 1px solid var(--border-color);
    overflow: hidden;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow);
    border-color: var(--primary-color);
}

.product-image {
    position: relative;
    overflow: hidden;
    height: 200px;
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
}

.product-card:hover .product-image img {
    transform: scale(1.05);
}

.product-badges {
    position: absolute;
    top: 10px;
    left: 10px;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.product-badge {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius);
}

.product-badge.featured {
    background: var(--warning-color);
    color: var(--dark-color);
}

.product-badge.new {
    background: var(--success-color);
    color: white;
}

.product-badge.stock.in-stock {
    background: var(--success-color);
    color: white;
}

.product-badge.stock.out-stock {
    background: var(--danger-color);
    color: white;
}

.product-actions {
    position: absolute;
    top: 10px;
    right: 10px;
    opacity: 0;
    transition: var(--transition);
}

.product-card:hover .product-actions {
    opacity: 1;
}

.product-title {
    font-size: 1rem;
    height: 2.5rem;
    overflow: hidden;
}

.product-desc {
    font-size: 0.875rem;
    height: 3rem;
    overflow: hidden;
}

.product-price .current-price {
    font-size: 1.25rem;
}

.product-price .old-price {
    font-size: 0.875rem;
}

/* Forms */
.form-control:focus,
.form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.25rem rgba(0, 123, 255, 0.25);
}

/* Buttons */
.btn {
    font-weight: 500;
    border-radius: var(--radius);
    padding: 0.5rem 1.5rem;
    transition: var(--transition);
}

.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-primary:hover {
    background-color: var(--primary-dark);
    border-color: var(--primary-dark);
}

.btn-success {
    background-color: var(--success-color);
    border-color: var(--success-color);
}

.btn-success:hover {
    background-color: var(--success-dark);
    border-color: var(--success-dark);
}

.btn-lg {
    padding: 0.75rem 2rem;
}

.btn-sm {
    padding: 0.25rem 0.75rem;
    font-size: 0.875rem;
}

/* Footer */
.footer {
    background: var(--dark-color);
    color: var(--white-color);
}

.footer a {
    color: var(--white-color);
}

.footer a:hover {
    color: var(--primary-color);
}

.footer-links li {
    margin-bottom: 0.5rem;
}

.footer-links a:hover {
    padding-left: 5px;
}

.contact-info li {
    margin-bottom: 1rem;
}

.contact-info i {
    width: 20px;
}

.social-links {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
}

.social-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    transition: var(--transition);
}

.social-link:hover {
    background: var(--primary-color);
    transform: translateY(-3px);
}

/* Features Slider */
.features-slider .feature-item {
    padding: 1rem;
}

.feature-icon {
    font-size: 2.5rem;
    color: var(--primary-color);
}

/* Brands Slider */
.brands-slider .brand-item {
    padding: 1rem;
    background: var(--white-color);
    border-radius: var(--radius);
    text-align: center;
    height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.brands-slider .brand-item img {
    max-height: 60px;
    max-width: 100%;
    object-fit: contain;
}

/* Back to Top */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: var(--primary-color);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
    z-index: 1000;
}

.back-to-top.show {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    background: var(--primary-dark);
    color: white;
}

/* WhatsApp Float */
.whatsapp-float {
    position: fixed;
    bottom: 30px;
    left: 30px;
    z-index: 1000;
}

.whatsapp-link {
    display: flex;
    align-items: center;
    background: var(--success-color);
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 50px;
    text-decoration: none;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.whatsapp-link:hover {
    background: var(--success-dark);
    color: white;
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

.whatsapp-text {
    margin-left: 0.5rem;
    font-weight: 500;
}

/* Product Detail */
.product-detail .main-image {
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 1rem;
    background: var(--white-color);
}

.product-detail .thumbnail {
    cursor: pointer;
    border: 2px solid transparent;
    transition: var(--transition);
}

.product-detail .thumbnail:hover,
.product-detail .thumbnail.active {
    border-color: var(--primary-color);
}

.product-detail .product-title {
    font-size: 1.75rem;
    height: auto;
}

.quick-specs table th {
    background: var(--gray-light);
}

/* Tabs */
.nav-tabs {
    border-bottom: 2px solid var(--border-color);
}

.nav-tabs .nav-link {
    border: none;
    color: var(--gray-color);
    font-weight: 500;
    padding: 0.75rem 1.5rem;
}

.nav-tabs .nav-link.active {
    color: var(--primary-color);
    border-bottom: 3px solid var(--primary-color);
    background: transparent;
}

.tab-content {
    border-radius: 0 0 var(--radius) var(--radius);
}

/* Pagination */
.pagination .page-link {
    color: var(--primary-color);
    border: 1px solid var(--border-color);
}

.pagination .page-link:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.pagination .page-item.active .page-link {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

/* Breadcrumb */
.breadcrumb {
    background: transparent;
    padding: 0;
}

.breadcrumb-item a {
    color: var(--gray-color);
}

.breadcrumb-item.active {
    color: var(--primary-color);
}

/* Alert Messages */
.alert {
    border: none;
    border-radius: var(--radius);
}

.alert-dismissible .btn-close {
    padding: 1rem;
}

/* Modal */
.modal-content {
    border: none;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
}

.modal-header {
    border-bottom: 1px solid var(--border-color);
    background: var(--gray-light);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.modal-footer {
    border-top: 1px solid var(--border-color);
    background: var(--gray-light);
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

/* About Page */
.about-content p {
    font-size: 1.1rem;
}

.mission-card,
.vision-card {
    border: 2px solid transparent;
    transition: var(--transition);
}

.mission-card:hover,
.vision-card:hover {
    border-color: var(--primary-color);
    transform: translateY(-5px);
}

.service-card {
    transition: var(--transition);
}

.service-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow);
}

.service-list {
    padding-left: 1rem;
}

.service-list li {
    margin-bottom: 0.5rem;
    position: relative;
}

.service-list li::before {
    content: '✓';
    color: var(--success-color);
    position: absolute;
    left: -1rem;
}

/* Contact Page */
.contact-item {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
}

.contact-icon {
    flex-shrink: 0;
    width: 40px;
}

.contact-form .card-header {
    background: var(--primary-color);
    color: white;
    border-radius: var(--radius) var(--radius) 0 0;
}

.map-container {
    overflow: hidden;
    border-radius: 0 0 var(--radius) var(--radius);
}

/* Search Page */
.search-form .input-group {
    box-shadow: var(--shadow-sm);
}

.search-suggestions .list-group-item {
    border: none;
    border-bottom: 1px solid var(--border-color);
}

.search-suggestions .list-group-item:last-child {
    border-bottom: none;
}

.highlight {
    background: var(--warning-color);
    padding: 0 2px;
    border-radius: 2px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .section-padding {
        padding: 3rem 0;
    }
    
    .hero-banner .carousel-item {
        height: 300px;
    }
    
    .hero-banner .carousel-caption {
        padding: 1rem;
        font-size: 0.875rem;
    }
    
    .whatsapp-float {
        bottom: 20px;
        left: 20px;
    }
    
    .whatsapp-link {
        padding: 0.5rem 1rem;
        font-size: 0.875rem;
    }
    
    .whatsapp-text {
        display: none;
    }
    
    .product-card .product-image {
        height: 150px;
    }
    
    .footer .col-md-6,
    .footer .col-lg-4,
    .footer .col-lg-3 {
        margin-bottom: 2rem;
    }
}

@media (max-width: 576px) {
    .navbar-nav {
        margin-top: 1rem;
    }
    
    .header-actions {
        margin-top: 1rem;
    }
    
    .product-card .row > div {
        margin-bottom: 1rem;
    }
    
    .back-to-top {
        bottom: 20px;
        right: 20px;
        width: 40px;
        height: 40px;
        font-size: 0.875rem;
    }
}

/* Print Styles */
@media print {
    .navbar,
    .footer,
    .whatsapp-float,
    .back-to-top {
        display: none !important;
    }
    
    body {
        font-size: 12pt;
        line-height: 1.4;
    }
    
    .container {
        max-width: 100%;
        padding: 0;
    }
}

/* Animation Classes */
.animate-on-scroll {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.animate-on-scroll.visible {
    opacity: 1;
    transform: translateY(0);
}

.hover-lift {
    transition: var(--transition);
}

.hover-lift:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow);
}

/* Loading Spinner */
.spinner-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 200px;
}

.spinner {
    width: 3rem;
    height: 3rem;
}

/* Empty States */
.empty-state {
    padding: 3rem;
    text-align: center;
    color: var(--gray-color);
}

.empty-state i {
    font-size: 4rem;
    margin-bottom: 1.5rem;
    opacity: 0.5;
}

/* Badge Variants */
.badge-outline-primary {
    color: var(--primary-color);
    border: 1px solid var(--primary-color);
    background: transparent;
}

.badge-outline-success {
    color: var(--success-color);
    border: 1px solid var(--success-color);
    background: transparent;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: var(--gray-light);
}

::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-dark);
}

/* Button Spacing Fixes */
.header-actions .btn {
    padding: 8px 16px;
    font-size: 0.9rem;
    border-radius: 6px;
    transition: all 0.3s ease;
    white-space: nowrap; /* Prevent button text from wrapping */
}

/* Specific button colors */
.btn-outline-primary {
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
}

.btn-outline-primary:hover {
    background-color: var(--primary-color);
    color: white;
}

.btn-success {
    background-color: var(--success-color);
    border-color: var(--success-color);
}

.btn-success:hover {
    background-color: #1e7e34;
    border-color: #1e7e34;
}

.btn-warning {
    background-color: #ffc107;
    border-color: #ffc107;
    color: #212529;
}

.btn-warning:hover {
    background-color: #e0a800;
    border-color: #d39e00;
}

.btn-info {
    background-color: #17a2b8;
    border-color: #17a2b8;
    color: white;
}

.btn-info:hover {
    background-color: #138496;
    border-color: #117a8b;
}

/* Mobile responsive buttons */
@media (max-width: 992px) {
    .header-actions {
        margin-top: 1rem;
        width: 100%;
    }
    
    .header-actions .d-flex {
        flex-wrap: wrap;
        justify-content: center;
        gap: 0.5rem !important;
    }
    
    .header-actions .btn {
        flex: 1;
        min-width: 120px;
        max-width: 200px;
        margin: 2px;
    }
    
    /* Hide admin button in mobile if there are too many buttons */
    .header-actions .btn-warning,
    .header-actions .btn-info {
        order: 3; /* Move admin button to last position */
    }
}

/* Top bar admin link spacing */
.top-bar-social a {
    margin: 0 5px;
    padding: 2px 8px;
    border-radius: 3px;
    transition: background-color 0.3s ease;
}

.top-bar-social a:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

/* Search form spacing */
.navbar .input-group {
    margin-right: 1rem !important;
}

/* Ensure buttons don't touch each other */
.gap-3 > * {
    margin-right: 1rem;
}

.gap-3 > *:last-child {
    margin-right: 0;
}

/* ==========================================
   DROPDOWN MENU FIXES
   ========================================== */

/* Main dropdown menu styling */
.dropdown-menu {
    border: 1px solid rgba(0,0,0,.15);
    box-shadow: 0 0.5rem 1rem rgba(0,0,0,.175);
    animation: fadeIn 0.3s;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Nested dropdown (submenu) */
.dropdown-submenu {
    position: relative;
}

.dropdown-submenu > .dropdown-menu {
    top: 0;
    left: 100%;
    margin-top: -1px;
    margin-left: -1px;
    display: none;
}

/* Show submenu on hover */
.dropdown-submenu:hover > .dropdown-menu {
    display: block;
}

/* Mobile dropdown fixes */
@media (max-width: 991.98px) {
    .dropdown-submenu {
        position: static;
    }
    
    .dropdown-submenu > .dropdown-menu {
        position: static;
        float: none;
        width: auto;
        margin-top: 0;
        background-color: transparent;
        border: 0;
        box-shadow: none;
        display: block !important;
        padding-left: 20px;
    }
    
    .dropdown-submenu .dropdown-item {
        padding-left: 2.5rem;
    }
    
    .dropdown-submenu .dropdown-toggle::after {
        float: right;
        margin-top: 5px;
    }
}

/* Dropdown item styling */
.dropdown-item {
    padding: 0.5rem 1.5rem;
    transition: all 0.2s;
}

.dropdown-item:hover {
    background-color: #f8f9fa;
    color: #0056b3;
}

/* Active dropdown link */
.nav-link.active {
    font-weight: 600;
    color: #0056b3 !important;
}

/* ==========================================
   MOBILE RESPONSIVENESS
   ========================================== */

@media (max-width: 768px) {
    .header-actions .btn {
        margin-bottom: 0.5rem;
        font-size: 0.9rem;
        padding: 0.375rem 0.75rem;
    }
    
    .header-actions .d-flex {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .navbar-collapse {
        padding-top: 1rem;
        max-height: 80vh;
        overflow-y: auto;
    }
    
    .input-group {
        min-width: 100% !important;
        margin-bottom: 1rem;
    }
}

/* ==========================================
   WHATSAPP FLOAT BUTTON
   ========================================== 

.

.whatsapp-link {
    color: white;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

.whatsapp-text {
    display: none;
}

@media (min-width: 768px) {
    .whatsapp-float {
        width: auto;
        height: auto;
        padding: 10px 20px;
        border-radius: 50px;
    }
    
    .whatsapp-text {
        display: inline;
        font-size: 14px;
        margin-left: 10px;
    } 
    
    
    /* Product Detail Page Styles */
.product-images .main-image {
    background-color: #f8f9fa;
}

.product-images .thumbnail {
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.product-images .thumbnail:hover,
.product-images .thumbnail.active {
    border-color: #007bff;
}

.product-badges {
    position: absolute;
    top: 10px;
    left: 10px;
}

.product-badges .badge {
    margin-right: 5px;
}

.product-actions {
    position: absolute;
    top: 10px;
    right: 10px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.product-card:hover .product-actions {
    opacity: 1;
}

.share-buttons .btn {
    width: 36px;
    height: 36px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* Tab Styles */
.nav-tabs .nav-link {
    border: none;
    color: #6c757d;
    font-weight: 500;
}

.nav-tabs .nav-link:hover {
    color: #007bff;
}

.nav-tabs .nav-link.active {
    color: #007bff;
    border-bottom: 3px solid #007bff;
    background: transparent;
}

/* Related Products */
.product-card {
    transition: transform 0.3s ease;
}

.product-card:hover {
    transform: translateY(-5px);
}

/* Responsive fixes */
@media (max-width: 768px) {
    .product-title {
        font-size: 1.25rem;
    }
    
    .current-price {
        font-size: 1.5rem;
    }
    
    .product-actions .btn {
        padding: 0.5rem;
        font-size: 0.9rem;
    }
}
}