/* TokoBandung.com - Main Styles */

:root {
    --primary-color: #0d6efd;
    --secondary-color: #6c757d;
    --success-color: #198754;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #0dcaf0;
    --light-color: #f8f9fa;
    --dark-color: #212529;
}

/* Global Styles */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    overflow-x: hidden; /* Prevent horizontal scroll */
}

/* Prevent layout shift */
* {
    box-sizing: border-box;
}

/* Smooth transitions for specific elements only */
.card, .btn, .form-control, .nav-link, .badge, .alert {
    transition: all 0.3s ease;
}

/* Disable transitions during page load */
.preload * {
    transition: none !important;
}

/* Image styles */
.object-fit-cover {
    object-fit: cover;
    object-position: center;
}

/* Square product images - Force square aspect ratio */
.product-image-container {
    width: 100% !important;
    height: 250px !important;
    overflow: hidden !important;
    background-color: #f8f9fa !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

/* Global Product Card Styling - Consistent across all pages */
.card {
    display: flex !important;
    flex-direction: column !important;
    height: 100% !important;
    border: 1px solid #e9ecef !important;
    border-radius: 12px !important;
    overflow: hidden !important;
    transition: all 0.3s ease !important;
}

.card:hover {
    transform: translateY(-5px) !important;
    box-shadow: 0 8px 25px rgba(0,0,0,0.15) !important;
}

.card-body {
    display: flex !important;
    flex-direction: column !important;
    flex-grow: 1 !important;
    padding: 1.25rem !important;
}

.card-title {
    font-size: 1.1rem !important;
    font-weight: 600 !important;
    margin-bottom: 0.75rem !important;
    line-height: 1.4 !important;
    flex-grow: 1 !important;
}

.card-text {
    margin-bottom: 1rem !important;
    color: #6c757d !important;
    font-size: 0.9rem !important;
    line-height: 1.5 !important;
}

/* Product Actions - Consistent button layout */
.d-grid.gap-2 {
    margin-top: auto !important;
}

.d-grid.gap-2 .btn {
    min-height: 38px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-weight: 500 !important;
    border-radius: 8px !important;
}

/* Price styling */
.h5.mb-0 {
    font-weight: 700 !important;
    color: #1e3a8a !important;
}

/* Badge styling */
.badge {
    font-size: 0.75rem !important;
    padding: 0.5rem 0.75rem !important;
    border-radius: 6px !important;
}

/* Product image styling */
.product-image-container img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    object-position: center !important;
    transition: transform 0.3s ease !important;
}

.card:hover .product-image-container img {
    transform: scale(1.05) !important;
}
    position: relative !important;
}

.product-image-container img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    object-position: center !important;
    max-width: 100% !important;
    max-height: 100% !important;
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
}

/* Fallback for browsers that don't support aspect-ratio */
@supports not (aspect-ratio: 1) {
    .product-image-container {
        height: 200px;
    }
}

/* Responsive container improvements */
.container-fluid .container {
    max-width: 1200px;
    margin: 0 auto;
}

/* Ensure product cards have consistent height - Only for product cards */
.product-card {
    height: 100%;
}

/* Regular cards should not have fixed height */
.card {
    height: auto;
}

.card-img-top {
    flex-shrink: 0;
}

/* Product Detail Page Styles */
.product-detail-image-container {
    position: relative;
}

.main-image-container {
    width: 100%;
    aspect-ratio: 1;
    overflow: hidden;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    background-color: #f8f9fa;
    display: flex;
    align-items: center;
    justify-content: center;
}

.main-product-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    transition: transform 0.3s ease;
}

.main-product-image:hover {
    transform: scale(1.05);
}

.thumbnail-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
    gap: 10px;
    margin-top: 15px;
}

.thumbnail-item {
    aspect-ratio: 1;
    overflow: hidden;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.thumbnail-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.thumbnail-item.active {
    border-color: #007bff;
    box-shadow: 0 0 0 2px rgba(0,123,255,0.25);
}

.thumbnail-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

.product-details {
    padding: 20px;
}

/* Better spacing for product sections */
.product-section {
    margin-bottom: 3rem;
}

/* Force uniform margins for product page */
.container {
    max-width: 1140px !important;
    margin: 0 auto !important;
    padding-left: 15px !important;
    padding-right: 15px !important;
}

/* Ensure all sections use same container */
.product-page .container {
    max-width: 1140px !important;
    margin: 0 auto !important;
    padding-left: 15px !important;
    padding-right: 15px !important;
}

/* Responsive adjustments for product detail */
@media (max-width: 768px) {
    .main-image-container {
        aspect-ratio: 4/3;
    }
    
    .thumbnail-gallery {
        grid-template-columns: repeat(4, 1fr);
        gap: 8px;
    }
    
    .thumbnail-item {
        aspect-ratio: 1;
    }
    
    .product-details {
        padding: 15px;
    }
}

@media (max-width: 576px) {
    .main-image-container {
        aspect-ratio: 1;
    }
    
    .thumbnail-gallery {
        grid-template-columns: repeat(3, 1fr);
        gap: 6px;
    }
}

@media (max-width: 1400px) {
    .container-fluid .container {
        max-width: 1140px;
    }
}

@media (max-width: 1200px) {
    .container-fluid .container {
        max-width: 960px;
    }
}

@media (max-width: 992px) {
    .container-fluid .container {
        max-width: 720px;
    }
}

@media (max-width: 768px) {
    .container-fluid .container {
        max-width: 540px;
    }
    
    .product-image-container {
        height: 250px;
    }
    
    .card-body {
        padding: 1rem;
    }
    
    .card-title {
        font-size: 1rem;
    }
    
    .card-text {
        font-size: 0.875rem;
    }
}

@media (max-width: 576px) {
    .container-fluid .container {
        max-width: 100%;
        padding-left: 15px;
        padding-right: 15px;
    }
    
    .product-image-container {
        height: 200px;
    }
}

/* Header Styles */
.navbar-brand {
    font-weight: 700;
    font-size: 1.5rem;
}

.navbar-nav .nav-link {
    font-weight: 500;
    transition: color 0.3s ease;
}

.navbar-nav .nav-link:hover {
    color: rgba(255, 255, 255, 0.8) !important;
}

/* Hero Section */
.hero-section {
    background: linear-gradient(135deg, var(--primary-color) 0%, #0056b3 100%);
    min-height: 500px;
}

.hero-section h1 {
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

/* Card Styles */
.card {
    border: none;
    border-radius: 10px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

.card-img-top {
    border-radius: 10px 10px 0 0;
    height: 200px;
    object-fit: cover;
}

/* Button Styles */
.btn {
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn:hover {
    transform: translateY(-2px);
}

.btn-primary {
    background: linear-gradient(45deg, var(--primary-color), #0056b3);
    border: none;
}

.btn-primary:hover {
    background: linear-gradient(45deg, #0056b3, var(--primary-color));
}

/* Product Cards */
.product-card {
    height: 100%;
}

.product-card .card-body {
    display: flex;
    flex-direction: column;
}

.product-card .card-text {
    flex-grow: 1;
}

/* Badge Styles */
.badge {
    font-size: 0.75rem;
    padding: 0.5em 0.75em;
}

/* Footer Styles */
footer {
    margin-top: auto;
}

footer a {
    color: #fff !important;
}

/* Form Styles */
.form-control {
    border-radius: 8px;
    border: 1px solid #dee2e6;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
}

/* Alert Styles */
.alert {
    border: none;
    border-radius: 8px;
}

/* Table Styles */
.table {
    border-radius: 8px;
    overflow: hidden;
}

.table thead th {
    background-color: var(--light-color);
    border-bottom: 2px solid var(--primary-color);
    font-weight: 600;
}

/* Loading Animation */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    /* Animation removed for better performance */
}

/* Responsive Design */
@media (max-width: 768px) {
    .hero-section {
        min-height: 400px;
        text-align: center;
    }
    
    .hero-section h1 {
        font-size: 2rem;
    }
    
    .card-img-top {
        height: 150px;
    }
}

/* Custom Utilities */
.text-shadow {
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.bg-gradient-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, #0056b3 100%);
}

.border-left-primary {
    border-left: 4px solid var(--primary-color) !important;
}

.border-left-success {
    border-left: 4px solid var(--success-color) !important;
}

.border-left-info {
    border-left: 4px solid var(--info-color) !important;
}

.border-left-warning {
    border-left: 4px solid var(--warning-color) !important;
}

/* Animation Classes */
.fade-in {
    animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.slide-in-left {
    animation: slideInLeft 0.5s ease-out;
}

@keyframes slideInLeft {
    from { opacity: 0; transform: translateX(-30px); }
    to { opacity: 1; transform: translateX(0); }
}

.slide-in-right {
    animation: slideInRight 0.5s ease-out;
}

@keyframes slideInRight {
    from { opacity: 0; transform: translateX(30px); }
    to { opacity: 1; transform: translateX(0); }
}

/* Product Detail Page Styles */
.product-image-container {
    position: relative;
}

.main-image {
    position: relative;
    overflow: hidden;
    border-radius: 12px;
}

.main-image img {
    cursor: pointer;
    transition: all 0.3s ease;
    border-radius: 12px;
    width: 100%;
    height: auto;
    display: block;
    opacity: 1;
}

.main-image img:hover {
    transform: scale(1.02);
}

.thumbnail-images .thumbnail-img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    border-radius: 8px;
}

.thumbnail-images .thumbnail-img:hover {
    border-color: var(--primary-color);
    transform: scale(1.05);
}

.thumbnail-images .thumbnail-img.active {
    border-color: var(--primary-color);
    border-width: 3px;
    box-shadow: 0 0 10px rgba(13, 110, 253, 0.3);
}

.thumbnail-images .thumbnail-img.active:hover {
    transform: scale(1.02);
}

.product-details {
    padding-left: 2rem;
}

.price-section .h2 {
    font-size: 2.5rem;
    font-weight: 700;
}

.stock-status .badge {
    font-size: 1rem;
    padding: 0.75rem 1rem;
}

.feature-item {
    padding: 0.5rem 0;
}

.feature-item i {
    width: 20px;
    text-align: center;
}

.purchase-section .input-group {
    max-width: 200px;
}

.purchase-section .input-group .btn {
    border-radius: 0;
}

.purchase-section .input-group .btn:first-child {
    border-top-left-radius: 8px;
    border-bottom-left-radius: 8px;
}

.purchase-section .input-group .btn:last-child {
    border-top-right-radius: 8px;
    border-bottom-right-radius: 8px;
}

/* Product Tabs */
.nav-tabs {
    border-bottom: 2px solid #dee2e6;
}

.nav-tabs .nav-link {
    border: none;
    border-radius: 0;
    color: var(--secondary-color);
    font-weight: 500;
    padding: 1rem 1.5rem;
    transition: all 0.3s ease;
}

.nav-tabs .nav-link:hover {
    border-color: transparent;
    color: var(--primary-color);
    background-color: rgba(13, 110, 253, 0.1);
}

.nav-tabs .nav-link.active {
    color: var(--primary-color);
    background-color: transparent;
    border-bottom: 3px solid var(--primary-color);
    font-weight: 600;
}

.tab-content .card {
    border-top: none;
    border-radius: 0 0 12px 12px;
}

/* Related Products */
.product-card {
    transition: all 0.3s ease;
    border-radius: 12px;
    overflow: hidden;
}

.product-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
}

.product-card .card-img-top {
    height: 200px;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.product-card:hover .card-img-top {
    transform: scale(1.05);
}

/* Breadcrumb */
.breadcrumb {
    background-color: transparent;
    padding: 0;
    margin: 0;
}

.breadcrumb-item + .breadcrumb-item::before {
    content: "›";
    color: var(--secondary-color);
    font-weight: bold;
}

/* Alert Styles for Product Page */
.alert-info {
    background: linear-gradient(135deg, #d1ecf1 0%, #bee5eb 100%);
    border-left: 4px solid var(--info-color);
}

.alert-warning {
    background: linear-gradient(135deg, #fff3cd 0%, #ffeaa7 100%);
    border-left: 4px solid var(--warning-color);
}

/* Quantity Input Styling */
.input-group .form-control {
    text-align: center;
    font-weight: 600;
    font-size: 1.1rem;
}

/* Button Hover Effects */
.btn-outline-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(13, 110, 253, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(13, 110, 253, 0.4);
}

/* Responsive Design for Product Detail */
@media (max-width: 992px) {
    .product-details {
        padding-left: 0;
        margin-top: 2rem;
    }
    
    .price-section .h2 {
        font-size: 2rem;
    }
}

@media (max-width: 768px) {
    .main-image img {
        border-radius: 8px;
    }
    
    .thumbnail-images {
        justify-content: center;
    }
    
    .thumbnail-images .thumbnail-img {
        width: 60px;
        height: 60px;
    }
    
    .price-section .h2 {
        font-size: 1.75rem;
    }
    
    .purchase-section .input-group {
        max-width: 150px;
    }
    
    .nav-tabs .nav-link {
        padding: 0.75rem 1rem;
        font-size: 0.9rem;
    }
}

@media (max-width: 576px) {
    .product-details h1 {
        font-size: 1.5rem;
    }
    
    .price-section .h2 {
        font-size: 1.5rem;
    }
    
    .feature-item {
        font-size: 0.9rem;
    }
    
    .purchase-section .btn {
        font-size: 0.9rem;
        padding: 0.75rem 1rem;
    }
}