/* Modern Frontend Theme - Fashion & Simple */
:root {
    --primary-color: #1a1a1a; /* Fashionable Black */
    --primary-hover: #333333;
    --secondary-color: #f8f9fa;
    --accent-color: #c5a059; /* Elegant Gold */
    --text-main: #2c2c2c;
    --text-muted: #888888;
    --bg-body: #fdfdfd;
    --bg-card: #ffffff;
    --border-color: #eeeeee;
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.1);
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
}

body {
    background-color: var(--bg-body);
    color: var(--text-main);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "PingFang SC", "Microsoft YaHei", sans-serif;
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    color: var(--primary-color);
    letter-spacing: -0.5px;
    margin-bottom: 1rem;
}

a {
    color: var(--primary-color);
    transition: color 0.2s ease;
}

a:hover {
    color: var(--accent-color);
    text-decoration: none;
}

/* Utilities */
.text-small { font-size: 0.875rem; }
.font-weight-bold { font-weight: 600 !important; }

.section-title {
    position: relative;
    padding-bottom: 20px;
    margin-bottom: 40px;
    font-size: 1.5rem;
    font-weight: 700;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 3px;
    background: var(--accent-color);
}

/* Cards - Elegant & Clean */
.card {
    border: none;
    background-color: var(--bg-card);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    overflow: hidden;
    margin-bottom: 20px;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
}

.card-img-top {
    border-radius: var(--radius-md) var(--radius-md) 0 0;
    object-fit: cover;
    height: 240px; /* Taller images for fashion look */
    width: 100%;
    transition: transform 0.6s ease;
}

.card:hover .card-img-top {
    transform: scale(1.03);
}

.card-body {
    padding: 1.25rem;
    background: #fff;
    position: relative;
    z-index: 2;
}

.card-title {
    font-size: 1rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
    height: 2.8rem;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    color: var(--primary-color);
}

/* Buttons - Minimalist */
.btn {
    border-radius: var(--radius-sm); /* More squared off */
    padding: 0.6rem 1.5rem;
    font-weight: 500;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    border: 1px solid transparent;
    letter-spacing: 0.5px;
}

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

.btn-primary:hover, .btn-primary:active, .btn-primary:focus {
    background-color: var(--primary-hover);
    border-color: var(--primary-hover);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    transform: translateY(-1px);
}

.btn-outline-primary {
    color: var(--primary-color);
    border-color: var(--primary-color);
    background: transparent;
}

.btn-outline-primary:hover {
    background-color: var(--primary-color);
    color: white;
}

.btn-danger {
    background-color: var(--accent-color); /* Use accent color for "Add to Cart" */
    border-color: var(--accent-color);
    color: #fff;
}

.btn-danger:hover {
    background-color: #b08d4a; /* Darker Gold */
    border-color: #b08d4a;
}

.btn-sm {
    padding: 0.4rem 1rem;
    font-size: 0.8rem;
}

/* Price Box */
.price-box {
    display: flex;
    align-items: baseline;
    margin-bottom: 1rem;
}

.current-price {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-right: 0.5rem;
}

.original-price {
    font-size: 0.85rem;
    color: var(--text-muted);
    text-decoration: line-through;
}

/* Carousel */
.carousel {
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    margin-bottom: 3rem;
}

.carousel-item img {
    height: 400px; /* Reduced from 500px for better PC fit */
    object-fit: cover;
    object-position: center;
}

/* Navigation */
header {
    background-color: var(--primary-color);
    transition: all 0.3s ease;
}

header.sticky-top {
    position: sticky;
    top: 0;
    z-index: 1030;
}

.bg-fashion-dark {
    background-color: var(--primary-color) !important;
}

.navbar-dark .navbar-nav .nav-link {
    color: rgba(255, 255, 255, 0.85);
    font-weight: 500;
    padding: 0.5rem 1rem;
    transition: color 0.2s;
}

.navbar-dark .navbar-nav .nav-link:hover,
.navbar-dark .navbar-nav .nav-item.active .nav-link {
    color: var(--accent-color);
}

.navbar-brand img {
    transition: transform 0.3s ease;
}
.navbar-brand:hover img {
    transform: scale(1.05);
}

/* Badge */
.distribute-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    background: rgba(255, 255, 255, 0.9);
    color: var(--primary-color);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    z-index: 10;
    backdrop-filter: blur(5px);
}

/* Footer */
footer {
    background-color: #fcfcfc;
    color: var(--text-main);
    padding-top: 4rem;
    padding-bottom: 2rem;
    margin-top: 5rem;
    border-top: 1px solid var(--border-color);
}

footer h5 {
    font-size: 1rem;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    margin-bottom: 1.5rem;
}

footer ul li {
    margin-bottom: 0.8rem;
}

footer a {
    color: var(--text-muted);
}

footer a:hover {
    color: var(--primary-color);
    padding-left: 5px; /* Subtle movement */
}

.social-links a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background-color: #f0f0f0;
    transition: all 0.3s ease;
    color: var(--primary-color) !important;
}

.social-links a:hover {
    background-color: var(--primary-color);
    color: #fff !important;
    transform: translateY(-3px);
}

.copyright {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
    text-align: center;
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .carousel-item img {
        height: 200px; /* Smaller banner on mobile */
    }
    
    .card-img-top {
        height: 160px; /* Adjusted aspect ratio */
    }
    
    .section-title {
        font-size: 1.25rem;
        margin-bottom: 25px;
    }
    
    .btn {
        padding: 0.4rem 0.8rem;
    }
    
    footer {
    padding-top: 3rem;
        text-align: center;
    }
    
    .social-links {
        justify-content: center;
        display: flex;
        margin-bottom: 1.5rem;
    }
}

/* PC Specific Fixes */
@media (min-width: 992px) {
    .container {
        max-width: 1140px; /* Ensure standard container width */
    }
    
    .card-img-top {
        height: 220px; /* Fixed height for consistency */
    }
    
    .navbar-expand-lg .navbar-nav .nav-link {
        padding-right: 1rem;
        padding-left: 1rem;
    }
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translate3d(0, 30px, 0);
    }
    to {
        opacity: 1;
        transform: translate3d(0, 0, 0);
    }
}

.fade-in-up {
    animation: fadeInUp 0.8s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

/* --- Supplementary Styles for Global Consistency --- */

/* Modern Tables */
.table {
    color: var(--text-main);
}
.table thead th {
    border-top: none;
    border-bottom: 2px solid var(--border-color);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
    padding: 1rem;
    background-color: #fafafa;
}
.table td {
    border-top: 1px solid var(--border-color);
    vertical-align: middle;
    padding: 1rem;
}
.table-hover tbody tr:hover {
    background-color: #fcfcfc;
}

/* Modern Forms */
.form-control {
    border: 1px solid #e0e0e0;
    border-radius: var(--radius-sm);
    padding: 0.6rem 1rem;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    background-color: #fdfdfd;
}
.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0,0,0,0.05);
    background-color: #fff;
}

/* Mobile Product Card Button Fix */
@media (max-width: 576px) {
    .product-card .card-body {
        padding: 0.75rem;
    }
    .product-card .card-title {
        font-size: 0.9rem;
        height: 2.4rem;
        margin-bottom: 0.25rem;
}
    .product-card .price-box {
        margin-bottom: 0.5rem;
    }
    .product-card .current-price {
        font-size: 1rem;
    }
    .product-card .btn {
        padding: 0.3rem 0.5rem;
        font-size: 0.75rem;
        display: block;
        width: 100%;
        margin-bottom: 0.25rem;
    }
    .product-card .btn + .btn {
        margin-left: 0;
    }
}

/* Pagination */
.page-item .page-link {
    color: var(--primary-color);
    border: none;
    margin: 0 2px;
    border-radius: 4px;
    font-weight: 500;
}
.page-item.active .page-link {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}
.page-item .page-link:hover {
    background-color: #f0f0f0;
    color: var(--primary-color);
}

/* Product Quantity Fix */
.quantity-group {
    width: 140px;
    display: flex; /* Ensure flex behavior */
}
.quantity-group .btn {
    padding: 0.5rem 0.8rem;
    border-color: #e0e0e0;
    height: 100%; /* Match input height */
    display: flex;
    align-items: center;
    justify-content: center;
}
.quantity-group .form-control.quantity-input {
    border-radius: 0;
    height: auto; /* Allow auto height calculation */
    border-color: #e0e0e0;
    border-left: none;
    border-right: none;
    font-weight: 600;
    color: var(--primary-color);
    padding: 0.5rem;
}
.quantity-group .form-control:focus {
    z-index: 1; /* Keep above buttons */
}
.quantity-group .input-group-prepend .btn {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}
.quantity-group .input-group-append .btn {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
}
/* Ensure product image container has correct aspect ratio */
.product-image-container {
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}
.product-image-container img {
    max-height: 500px;
    object-fit: contain;
}

/* Little Red Book (XHS) Style Video Cards */
.xhs-card {
    transition: transform 0.2s;
    background: #fff;
    cursor: pointer;
}
.xhs-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md) !important;
}
.ratio-3x4 {
    position: relative;
    width: 100%;
    padding-top: 133.33%; /* 3:4 Aspect Ratio */
}
.ratio-3x4 > * {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}
.play-icon-overlay {
    opacity: 0;
    transition: opacity 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,0.2);
}
.xhs-card:hover .play-icon-overlay {
    opacity: 1;
}
.text-truncate-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
