/* Main Website Styles */

:root {
    --primary-color: #0d6efd;
    --secondary-color: #6c757d;
    --success-color: #198754;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #0dcaf0;
    --dark-color: #212529;
    --light-color: #f8f9fa;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    overflow-x: hidden;
}

/* ===================================
   NAVIGATION
=================================== */
.navbar {
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.navbar-brand {
    font-weight: bold;
    font-size: 1.5rem;
}

/* Touch-friendly navigation */
@media (max-width: 991px) {
    .navbar-nav .nav-link {
        padding: 0.75rem 1rem;
        min-height: 44px;
        display: flex;
        align-items: center;
    }
    
    .navbar-collapse {
        background: white;
        padding: 1rem;
        margin-top: 0.5rem;
        border-radius: 8px;
        box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    }
}

/* ===================================
   HERO SECTION - Mobile First
=================================== */
.hero {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 40px 0;
    text-align: center;
}

.hero h1 {
    font-size: 1.75rem;
    font-weight: bold;
    margin-bottom: 15px;
}

.hero p {
    font-size: 1rem;
    margin-bottom: 20px;
}

.hero .btn {
    margin: 0.5rem;
}

/* Tablet */
@media (min-width: 768px) {
    .hero {
        padding: 60px 0;
    }
    
    .hero h1 {
        font-size: 2.5rem;
        margin-bottom: 20px;
    }
    
    .hero p {
        font-size: 1.2rem;
        margin-bottom: 25px;
    }
}

/* Desktop */
@media (min-width: 1200px) {
    .hero {
        padding: 80px 0;
    }
    
    .hero h1 {
        font-size: 3rem;
        margin-bottom: 20px;
    }
    
    .hero p {
        font-size: 1.2rem;
        margin-bottom: 30px;
    }
}

/* ===================================
   PRODUCT CARDS - Responsive
=================================== */
.product-card {
    border: none;
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    height: 100%;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.15);
}

@media (min-width: 992px) {
    .product-card:hover {
        transform: translateY(-10px);
    }
}

.product-card img {
    height: 200px;
    object-fit: cover;
    width: 100%;
}

@media (max-width: 576px) {
    .product-card img {
        height: 180px;
    }
}

.product-card .card-body {
    padding: 20px;
}

@media (max-width: 576px) {
    .product-card .card-body {
        padding: 15px;
    }
}

.product-card .product-title {
    font-weight: 600;
    font-size: 1.1rem;
    margin-bottom: 10px;
    min-height: 2.4em;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

@media (max-width: 576px) {
    .product-card .product-title {
        font-size: 1rem;
    }
}

.product-card .product-price {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--primary-color);
}

@media (max-width: 576px) {
    .product-card .product-price {
        font-size: 1.25rem;
    }
}

.product-card .old-price {
    text-decoration: line-through;
    color: #999;
    font-size: 1rem;
    margin-right: 10px;
}

.product-card .discount-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background-color: var(--danger-color);
    color: white;
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: bold;
    z-index: 1;
}

/* ===================================
   CATEGORY BADGES - Responsive
=================================== */
.category-badge {
    display: inline-block;
    padding: 10px 20px;
    background-color: white;
    border-radius: 30px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    margin: 10px;
    transition: all 0.3s;
    text-decoration: none;
    color: #333;
    min-height: 44px;
    min-width: 44px;
}

@media (max-width: 576px) {
    .category-badge {
        padding: 8px 15px;
        margin: 5px;
        font-size: 0.9rem;
    }
}

.category-badge:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    color: var(--primary-color);
}

.category-badge i {
    margin-right: 8px;
}

/* ===================================
   TABLES - Mobile Responsive
=================================== */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

@media (max-width: 768px) {
    .table {
        font-size: 0.875rem;
    }
    
    .table thead {
        display: none;
    }
    
    .table tr {
        display: block;
        margin-bottom: 1rem;
        border: 1px solid #dee2e6;
        border-radius: 8px;
        padding: 0.5rem;
        background: white;
    }
    
    .table td {
        display: flex;
        justify-content: space-between;
        padding: 0.5rem !important;
        border: none;
        border-bottom: 1px solid #f0f0f0;
    }
    
    .table td:last-child {
        border-bottom: none;
    }
    
    .table td::before {
        content: attr(data-label);
        font-weight: bold;
        margin-right: 1rem;
    }
}

/* ===================================
   FOOTER - Responsive
=================================== */
.footer {
    background-color: #212529;
    color: white;
    padding: 40px 0 20px;
    margin-top: 60px;
}

.footer h5 {
    font-weight: bold;
    margin-bottom: 20px;
}

@media (max-width: 768px) {
    .footer {
        padding: 30px 0 15px;
        text-align: center;
    }
    
    .footer .col-md-4, .footer .col-md-3 {
        margin-bottom: 2rem;
    }
}

.footer ul {
    list-style: none;
    padding: 0;
}

.footer ul li {
    margin-bottom: 10px;
}

.footer ul li a {
    color: #adb5bd;
    text-decoration: none;
    transition: color 0.3s;
}

.footer ul li a:hover {
    color: white;
}

.footer .social-links a {
    display: inline-block;
    width: 40px;
    height: 40px;
    background-color: rgba(255,255,255,0.1);
    border-radius: 50%;
    text-align: center;
    line-height: 40px;
    margin-right: 10px;
    color: white;
    transition: all 0.3s;
    min-width: 44px;
    min-height: 44px;
}

.footer .social-links a:hover {
    background-color: var(--primary-color);
    transform: translateY(-3px);
}

/* ===================================
   BUTTONS - Touch Friendly
=================================== */
.btn {
    border-radius: 8px;
    padding: 10px 24px;
    font-weight: 500;
    transition: all 0.3s;
    min-height: 44px;
    min-width: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

@media (max-width: 576px) {
    .btn {
        padding: 10px 20px;
        font-size: 0.9rem;
    }
    
    .btn-lg {
        padding: 12px 24px;
        font-size: 1rem;
    }
}

.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-primary:hover {
    background-color: #0b5ed7;
    border-color: #0a58ca;
    transform: translateY(-2px);
}

/* ===================================
   FORMS - Mobile Optimized
=================================== */
.form-control, .form-select {
    border-radius: 8px;
    padding: 12px;
    border: 1px solid #dee2e6;
    min-height: 44px;
    font-size: 1rem;
}

@media (max-width: 576px) {
    .form-control, .form-select {
        font-size: 16px; /* Prevents zoom on iOS */
    }
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
}

/* ===================================
   BADGES
=================================== */
.badge {
    padding: 6px 12px;
    font-weight: 500;
    border-radius: 6px;
}

/* ===================================
   ALERTS
=================================== */
.alert {
    border-radius: 8px;
    border: none;
}

/* ===================================
   CARDS - Responsive
=================================== */
.card {
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

@media (max-width: 576px) {
    .card-body {
        padding: 1rem;
    }
}

/* ===================================
   UTILITY CLASSES
=================================== */
.text-truncate-2 {
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.text-truncate-3 {
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
}

/* ===================================
   LOADING SPINNER
=================================== */
.spinner-border-sm {
    width: 1rem;
    height: 1rem;
    border-width: 0.15em;
}

/* ===================================
   RESPONSIVE SPACING
=================================== */
@media (max-width: 576px) {
    .container {
        padding-left: 15px;
        padding-right: 15px;
    }
    
    h1 {
        font-size: 1.75rem;
    }
    
    h2 {
        font-size: 1.5rem;
    }
    
    h3 {
        font-size: 1.25rem;
    }
}

/* ===================================
   ADMIN PANEL RESPONSIVE
=================================== */
@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        top: 0;
        left: -100%;
        width: 280px;
        height: 100vh;
        background: white;
        transition: left 0.3s;
        z-index: 1050;
        overflow-y: auto;
    }
    
    .sidebar.show {
        left: 0;
        box-shadow: 2px 0 10px rgba(0,0,0,0.2);
    }
    
    .sidebar-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0,0,0,0.5);
        z-index: 1040;
        display: none;
    }
    
    .sidebar-overlay.show {
        display: block;
    }
}

/* ===================================
   ACCESSIBILITY
=================================== */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--primary-color);
    color: white;
    padding: 8px;
    text-decoration: none;
    z-index: 100;
}

.skip-link:focus {
    top: 0;
}

/* Focus visible for keyboard navigation */
*:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* ===================================
   PRINT STYLES
=================================== */
@media print {
    .navbar, .footer, .btn, .alert {
        display: none;
    }
    
    body {
        font-size: 12pt;
    }
    
    .card {
        box-shadow: none;
        border: 1px solid #ddd;
    }
}
