/**
 * ============================================================
 * SAFA MODEST HOUSE - Custom Styles
 * ============================================================
 * Bootstrap 5 customizations + site-specific styles
 */

/* ============================================================
   CSS Variables (Bootstrap overrides + custom)
   ============================================================ */
:root {
    --bs-primary: #0d6efd;
    --bs-primary-rgb: 13, 110, 253;
    --bs-secondary: #6c757d;
    --bs-success: #198754;
    --bs-danger: #dc3545;
    --bs-warning: #ffc107;
    --bs-info: #0dcaf0;
    
    /* Custom colors */
    --color-bkash: #E2136E;
    --color-nagad: #F6921E;
    --color-whatsapp: #25D366;
    
    /* Font family with Bengali support */
    --bs-font-sans-serif: 'Noto Sans Bengali', system-ui, -apple-system, sans-serif;
    
    /* Spacing */
    --section-padding: 4rem;
}

/* ============================================================
   Base Styles
   ============================================================ */
body {
    font-family: var(--bs-font-sans-serif);
    background-color: #f8f9fa;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

main {
    flex: 1;
}

a {
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

img {
    max-width: 100%;
    height: auto;
}

/* ============================================================
   Global Loader
   ============================================================ */
#global-loader .spinner-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

/* ============================================================
   Navbar Styles
   ============================================================ */
.top-bar {
    font-size: 0.85rem;
}

.navbar-brand img {
    max-height: 50px;
}

.nav-link {
    font-weight: 500;
    padding: 0.75rem 1rem !important;
}

.nav-link:hover {
    color: var(--bs-primary) !important;
}

.dropdown-menu {
    border: none;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

/* ============================================================
   Hero Section
   ============================================================ */
.hero-section {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 5rem 0;
    color: white;
}

.hero-section h1 {
    font-size: 2.5rem;
    font-weight: 700;
}

@media (max-width: 768px) {
    .hero-section {
        padding: 3rem 0;
    }
    .hero-section h1 {
        font-size: 1.75rem;
    }
}

/* ============================================================
   Product Cards
   ============================================================ */
.product-card {
    background: white;
    border-radius: 0.5rem;
    overflow: hidden;
    transition: transform 0.3s, box-shadow 0.3s;
    height: 100%;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

.product-card .product-image {
    position: relative;
    padding-top: 100%; /* 1:1 Aspect ratio */
    overflow: hidden;
}

.product-card .product-image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.product-card:hover .product-image img {
    transform: scale(1.05);
}

.product-card .product-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 1;
}

.product-card .product-actions {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 1;
}

.product-card .product-info {
    padding: 1rem;
}

.product-card .product-title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-card .product-title a {
    color: inherit;
}

.product-card .product-title a:hover {
    color: var(--bs-primary);
    text-decoration: none;
}

.product-card .product-price {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--bs-primary);
}

.product-card .product-price .original-price {
    font-size: 0.9rem;
    color: #999;
    text-decoration: line-through;
    font-weight: normal;
}

.product-card .product-rating {
    color: #ffc107;
    font-size: 0.85rem;
}

/* ============================================================
   Category Cards
   ============================================================ */
.category-card {
    position: relative;
    border-radius: 0.5rem;
    overflow: hidden;
    height: 200px;
}

.category-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.category-card:hover img {
    transform: scale(1.1);
}

.category-card .category-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 1rem;
    background: linear-gradient(transparent, rgba(0,0,0,0.8));
    color: white;
}

.category-card .category-name {
    font-size: 1.1rem;
    font-weight: 600;
}

/* ============================================================
   Cart Page
   ============================================================ */
.cart-item {
    background: white;
    border-radius: 0.5rem;
    padding: 1rem;
    margin-bottom: 1rem;
}

.cart-item-image {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 0.25rem;
}

.qty-input-group {
    max-width: 130px;
}

.qty-input-group .form-control {
    text-align: center;
}

/* ============================================================
   Checkout Page
   ============================================================ */
.checkout-section {
    background: white;
    border-radius: 0.5rem;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.checkout-section h5 {
    border-bottom: 2px solid var(--bs-primary);
    padding-bottom: 0.5rem;
    margin-bottom: 1rem;
}

/* Payment method cards */
.payment-method-card {
    border: 2px solid #dee2e6;
    border-radius: 0.5rem;
    padding: 1rem;
    cursor: pointer;
    transition: border-color 0.3s;
}

.payment-method-card:hover {
    border-color: var(--bs-primary);
}

.payment-method-card.selected {
    border-color: var(--bs-primary);
    background-color: rgba(13, 110, 253, 0.05);
}

.payment-method-card.bkash {
    border-color: var(--color-bkash);
}

.payment-method-card.nagad {
    border-color: var(--color-nagad);
}

.payment-method-card img {
    height: 40px;
}

/* Order Summary */
.order-summary {
    background: white;
    border-radius: 0.5rem;
    padding: 1.5rem;
    position: sticky;
    top: 100px;
}

.order-summary .summary-row {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0;
    border-bottom: 1px solid #eee;
}

.order-summary .summary-row.total {
    font-size: 1.25rem;
    font-weight: 700;
    border-bottom: none;
    color: var(--bs-primary);
}

/* ============================================================
   Dashboard
   ============================================================ */
.dashboard-sidebar {
    background: white;
    border-radius: 0.5rem;
    overflow: hidden;
}

.dashboard-sidebar .nav-link {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid #eee;
    color: #333;
}

.dashboard-sidebar .nav-link:hover,
.dashboard-sidebar .nav-link.active {
    background: var(--bs-primary);
    color: white;
}

.dashboard-content {
    background: white;
    border-radius: 0.5rem;
    padding: 1.5rem;
}

/* Order Status Timeline */
.order-timeline {
    position: relative;
    padding-left: 30px;
}

.order-timeline::before {
    content: '';
    position: absolute;
    left: 10px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: #dee2e6;
}

.order-timeline-item {
    position: relative;
    padding-bottom: 1.5rem;
}

.order-timeline-item::before {
    content: '';
    position: absolute;
    left: -24px;
    top: 0;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #dee2e6;
    border: 2px solid white;
}

.order-timeline-item.completed::before {
    background: var(--bs-success);
}

.order-timeline-item.current::before {
    background: var(--bs-primary);
    box-shadow: 0 0 0 4px rgba(13, 110, 253, 0.2);
}

/* ============================================================
   Star Rating
   ============================================================ */
.star-rating {
    display: inline-flex;
    flex-direction: row-reverse;
}

.star-rating input {
    display: none;
}

.star-rating label {
    color: #ddd;
    font-size: 1.5rem;
    cursor: pointer;
    transition: color 0.2s;
}

.star-rating label:hover,
.star-rating label:hover ~ label,
.star-rating input:checked ~ label {
    color: #ffc107;
}

/* ============================================================
   WhatsApp Floating Button
   ============================================================ */
.whatsapp-float {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 60px;
    height: 60px;
    background: var(--color-whatsapp);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    z-index: 1000;
    transition: transform 0.3s;
    text-decoration: none;
}

.whatsapp-float:hover {
    transform: scale(1.1);
    color: white;
    text-decoration: none;
}

/* ============================================================
   Buttons
   ============================================================ */
.btn-bkash {
    background-color: var(--color-bkash);
    border-color: var(--color-bkash);
    color: white;
}

.btn-bkash:hover {
    background-color: #c41161;
    border-color: #c41161;
    color: white;
}

.btn-nagad {
    background-color: var(--color-nagad);
    border-color: var(--color-nagad);
    color: white;
}

.btn-nagad:hover {
    background-color: #d97c0a;
    border-color: #d97c0a;
    color: white;
}

/* ============================================================
   Utilities
   ============================================================ */
.section-title {
    position: relative;
    display: inline-block;
    margin-bottom: 2rem;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 0;
    width: 60px;
    height: 3px;
    background: var(--bs-primary);
}

.text-taka {
    font-family: 'Arial', sans-serif;
}

.bg-gradient-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

/* ============================================================
   Responsive Adjustments
   ============================================================ */
@media (max-width: 576px) {
    .product-card .product-info {
        padding: 0.75rem;
    }
    
    .checkout-section {
        padding: 1rem;
    }
    
    .whatsapp-float {
        width: 50px;
        height: 50px;
        font-size: 1.5rem;
    }
}

/* ============================================================
   Footer Styles
   ============================================================ */
footer {
    color: white !important;
}

footer .text-muted {
    color: rgba(255, 255, 255, 0.75) !important;
}

footer a {
    color: white !important;
}

footer a:hover {
    color: rgba(255, 255, 255, 0.8) !important;
}

/* ============================================================
   Print Styles
   ============================================================ */
@media print {
    .navbar, .top-bar, footer, .whatsapp-float {
        display: none !important;
    }
}

