/* Custom styles for MEDIA PHONE website */

/* Category cards on homepage */
.category-card {
    background-color: #f8f9fa;
    border-radius: 10px;
    padding: 20px;
    text-align: center;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.category-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.category-card img {
    width: 120px;
    height: 120px;
    object-fit: contain;
    margin-bottom: 15px;
    transition: all 0.3s ease;
}

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

.category-card h3 {
    color: #333;
    font-weight: 600;
    margin-bottom: 5px;
}

.category-card p {
    color: #6c757d;
    margin-bottom: 0;
}

/* Login page styling */
.auth-container {
    max-width: 400px;
    margin: 50px auto;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    background-color: white;
}

.auth-container h2 {
    margin-bottom: 20px;
    color: #343a40;
    text-align: center;
}

.auth-container .form-group {
    margin-bottom: 20px;
}

.auth-container .btn-primary {
    width: 100%;
    padding: 10px;
    font-weight: 600;
}

.auth-container .form-text {
    text-align: center;
    margin-top: 20px;
}

/* Match login page to main site style */
.auth-page {
    background-color: #f8f9fa;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.auth-container .logo {
    text-align: center;
    margin-bottom: 20px;
}

.auth-container .logo img {
    max-width: 150px;
    margin: 0 auto;
}

/* Product detail page */
.product-detail-img {
    max-height: 400px;
    object-fit: contain;
    margin-bottom: 20px;
}

/* Header styling */
.site-header {
    background: linear-gradient(to right, #0062E6, #33AEFF);
    color: #fff;
    padding: 20px 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

@media (max-width: 768px) {
    .site-header {
        padding: 15px 0;
    }
}

@media (max-width: 576px) {
    .site-header {
        padding: 10px 0;
    }
}

/* Top bar styling */
.bg-primary.text-white.py-2 {
    font-size: 1.05rem;
}

.top-bar-info {
    display: inline-flex;
    align-items: center;
}

.top-bar-info i {
    margin-right: 6px;
}

.site-header .navbar-brand {
    font-weight: bold;
    font-size: 1.5rem;
}

/* Enhanced navbar styling */
.navbar {
    padding: 1.2rem 0;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

.navbar-brand img {
    max-height: 70px;
    object-fit: contain;
    width: auto;
}

.navbar-light .navbar-nav .nav-item {
    position: relative;
    margin: 0 5px;
}

.navbar-light .navbar-nav .nav-link {
    font-weight: 600;
    font-size: 1.1rem;
    transition: all 0.3s ease;
    padding: 0.6rem 1.2rem;
    border-radius: 4px;
}

.navbar-light .navbar-nav .nav-link:hover {
    background-color: rgba(196, 30, 58, 0.05);
    color: #c41e3a;
    transform: translateY(-2px);
}

.navbar-light .navbar-nav .active .nav-link {
    color: #c41e3a;
    font-weight: 700;
}

.navbar-light .navbar-nav .active::after {
    content: '';
    position: absolute;
    bottom: -3px;
    left: 50%;
    transform: translateX(-50%);
    width: 60%;
    height: 3px;
    background-color: #c41e3a;
    border-radius: 2px;
}

/* Search form styling */
.navbar .input-group {
    min-width: 250px;
}

.navbar .form-inline .input-group .form-control {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
    height: calc(1.5em + 0.75rem + 6px);
}

.navbar .form-inline .input-group .btn {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
    height: calc(1.5em + 0.75rem + 6px);
    padding-top: 0.375rem;
    padding-bottom: 0.375rem;
}

/* User account and cart icons */
.navbar .nav-item .nav-link {
    font-size: 1.1rem;
    padding: 0.6rem 1rem;
}

/* Footer styling */
.footer {
    background-color: #343a40;
    color: #fff;
    padding: 40px 0;
    margin-top: 50px;
}

.footer h5 {
    color: #fff;
    font-weight: bold;
    margin-bottom: 20px;
}

.footer-links {
    list-style: none;
    padding: 0;
}

.footer-links li {
    margin-bottom: 10px;
}

.footer-links a {
    color: #ccc;
    text-decoration: none;
    transition: color 0.3s;
}

.footer-links a:hover {
    color: #fff;
}

/* Buttons styling */
.btn-primary {
    background-color: #c41e3a;
    border-color: #c41e3a;
}

.btn-primary:hover {
    background-color: #a01829;
    border-color: #8b1523;
}

.btn-outline-primary {
    color: #c41e3a;
    border-color: #c41e3a;
}

.btn-outline-primary:hover {
    background-color: #c41e3a;
    color: #fff;
}

/* Card styling */
.card {
    border: none;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    margin-bottom: 20px;
}

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

/* Product listing */
.product-card {
    height: 100%;
}

.product-card img {
    height: 200px;
    object-fit: contain;
}

.product-price {
    font-size: 1.25rem;
    font-weight: bold;
    color: #c41e3a;
}

.product-discount {
    text-decoration: line-through;
    color: #6c757d;
    font-size: 0.9rem;
}

/* Cart styling */
.cart-item {
    padding: 15px;
    border-bottom: 1px solid #eee;
}

.cart-item img {
    max-height: 80px;
    object-fit: contain;
}

/* Profile page */
.profile-container {
    background-color: #f8f9fa;
    border-radius: 8px;
    padding: 30px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.profile-image {
    width: 150px;
    height: 150px;
    object-fit: cover;
    border-radius: 50%;
    border: 5px solid #fff;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

/* Checkout form */
.checkout-form label {
    font-weight: bold;
}

.checkout-summary {
    background-color: #f8f9fa;
    border-radius: 8px;
    padding: 20px;
    position: sticky;
    top: 20px;
}

/* Mobile responsiveness */
@media (max-width: 992px) {
    .navbar {
        padding: 0.8rem 0;
    }
    
    .navbar-brand img {
        max-height: 50px;
    }
    
    .navbar .input-group {
        min-width: 180px;
    }
    
    .navbar-light .navbar-nav .nav-link {
        padding: 0.5rem 0.8rem;
        font-size: 1rem;
    }
}

@media (max-width: 768px) {
    .category-card img {
        height: 150px;
    }
    
    .product-detail-img {
        max-height: 300px;
    }
    
    /* Reduce padding in product cards */
    .product-info {
        padding: 10px;
    }
    
    .product-card {
        margin-bottom: 15px;
    }
    
    /* Reduce button gap for better fit */
    .gap-2 {
        gap: 0.5rem !important;
    }
}

@media (min-width: 769px) {
    /* Desktop - HORIZONTAL buttons layout */
    .d-flex.gap-2.flex-wrap {
        flex-direction: row !important;
        gap: 0.5rem !important;
    }
    
    .d-flex.gap-2.flex-wrap .btn {
        flex: 1;
        padding: 0.5rem 0.6rem !important;
        font-size: 0.9rem !important;
    }
}

@media (max-width: 576px) {
    /* Extra small devices - aggressive mobile optimization */
    
    /* Fix category card text wrapping on mobile */
    .category-card {
        padding: 15px 10px;
    }
    
    .category-card h3 {
        font-size: 14px;
        line-height: 1.3;
        word-break: break-word;
        overflow: visible;
        white-space: normal;
        min-height: auto;
    }
    
    .category-card p {
        font-size: 12px;
        overflow: visible;
        white-space: normal;
    }
    
    .category-card img {
        width: 80px;
        height: 80px;
        margin-bottom: 10px;
    }
    
    /* Similar products styling on mobile */
    .row-cols-2 .card {
        margin-bottom: 15px;
    }
    
    .row-cols-2 .card-body {
        padding: 0.8rem !important;
    }
    
    .row-cols-2 .fw-bolder {
        font-size: 14px;
        margin-bottom: 5px;
    }
    
    .row-cols-2 .product-price {
        font-size: 14px;
    }
    
    .row-cols-2 .product-discount {
        font-size: 11px;
        margin-right: 3px;
    }
    
    .row-cols-2 .card-footer {
        padding: 0.8rem !important;
    }
    
    .row-cols-2 .btn-sm {
        padding: 0.35rem 0.4rem;
        font-size: 0.75rem;
    }
    
    .row-cols-2 .btn-sm i {
        margin-right: 3px;
    }
    
    /* Reduce navbar height and spacing */
    .navbar {
        padding: 0.4rem 0;
    }
    
    .navbar-brand {
        margin-right: 0 !important;
    }
    
    .navbar-brand img {
        max-height: 35px;
    }
    
    .navbar-light .navbar-nav .nav-link {
        padding: 0.3rem 0.4rem !important;
        font-size: 0.8rem !important;
        margin: 0 2px !important;
    }
    
    .navbar .input-group {
        min-width: 140px !important;
    }
    
    .navbar .input-group .form-control {
        padding: 0.25rem 0.5rem;
        font-size: 0.85rem;
    }
    
    .navbar .input-group .btn {
        padding: 0.25rem 0.4rem;
    }
    
    /* Product cards - MAXIMIZE SPACE on mobile */
    .product-card {
        margin-bottom: 15px;
        border-radius: 4px;
    }
    
    .product-card img {
        height: 180px;
    }
    
    /* CRITICAL: Reduce card-body padding on mobile to give buttons space */
    .card-body {
        padding: 0.75rem !important;
    }
    
    .product-info {
        padding: 8px;
    }
    
    .product-info h4 {
        font-size: 13px;
        margin-bottom: 3px;
        line-height: 1.2;
        word-break: break-word;
    }
    
    .price {
        margin-bottom: 4px;
    }
    
    .current-price {
        font-size: 15px;
        font-weight: bold;
    }
    
    .original-price {
        font-size: 11px;
    }
    
    .availability {
        font-size: 11px;
        margin-bottom: 6px;
    }
    
    .spec {
        font-size: 11px;
        padding: 2px 4px;
        margin-right: 2px;
    }
    
    /* Button styling for mobile - stack vertically for ALL flex button containers */
    .d-flex.gap-2.flex-wrap {
        display: flex !important;
        flex-direction: column !important;
        gap: 0.5rem !important;
        align-items: stretch !important;
        width: calc(100% + 1.5rem) !important;
        margin-left: -0.75rem !important;
        margin-right: -0.75rem !important;
        padding-left: 0.75rem !important;
        padding-right: 0.75rem !important;
        margin-bottom: 0 !important;
    }
    
    .d-flex.gap-2.flex-wrap .btn {
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        width: 100% !important;
        padding: 0.6rem 0.4rem !important;
        font-size: 0.8rem !important;
        text-align: center;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis;
        margin: 0 !important;
        min-height: 40px;
        line-height: 1.2;
        flex: none !important;
        box-sizing: border-box !important;
    }
    
    .d-flex.gap-2.flex-wrap .btn i {
        display: inline !important;
        margin-right: 3px !important;
        margin-left: 0 !important;
    }
    
    /* Card footer specific styling - GIVE MORE SPACE */
    .card-footer {
        padding: 0.75rem !important;
        margin-top: auto;
    }
    
    .card-footer .d-flex.gap-2.flex-wrap {
        display: flex !important;
        flex-direction: column !important;
        gap: 0.5rem !important;
        align-items: stretch !important;
        width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
    }
    
    .card-footer .d-flex.gap-2.flex-wrap .btn {
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        width: 100% !important;
        padding: 0.6rem 0.4rem !important;
        font-size: 0.8rem !important;
        text-align: center;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis;
        margin: 0 !important;
        min-height: 40px;
        line-height: 1.2;
        flex: none !important;
        box-sizing: border-box !important;
    }
    
    /* All button sizes on mobile */
    .btn-sm {
        padding: 0.5rem 0.4rem !important;
        font-size: 0.8rem !important;
    }
    
    /* Ensure all buttons in flex containers are full width */
    .mt-auto .btn {
        min-width: 0 !important;
        flex-shrink: 1 !important;
    }
    
    /* Card footer buttons full width */
    .card-footer .btn {
        width: 100% !important;
    }
    
/* Section spacing */
    section {
        padding: 2rem 0;
    }
    
    /* Container padding - reasonable amount */
    .container {
        padding-left: 12px;
        padding-right: 12px;
    }
    
    /* Gap utility */
    .gap-2 {
        gap: 0.5rem !important;
    }
}
