/* Product Page Styles - Modern & Appealing Design */
:root {
    --primary-color: #0B4270;
    --secondary-color: #2A7D3D;
    --accent-color: #84C341;
    --success-color: #28a745;
    --warning-color: #ffc107;
    --danger-color: #dc3545;
    --info-color: #17a2b8;
    --light-color: #f8f9fa;
    --dark-color: #343a40;
    --text-color: #333;
    --text-muted: #6c757d;
    --border-color: #dee2e6;
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.15);
    --shadow-lg: 0 8px 25px rgba(0, 0, 0, 0.2);
    --shadow-xl: 0 15px 35px rgba(0, 0, 0, 0.25);
    --transition-fast: all 0.2s ease;
    --transition-base: all 0.3s ease;
    --transition-slow: all 0.5s ease;
    --border-radius: 12px;
    --border-radius-sm: 8px;
    --border-radius-lg: 16px;
}

/* ===== PAGE HEADER ===== */
.page-header {
    text-align: center;
    padding: 3rem 0 2rem;
    color: white;
    position: relative;
    z-index: 1;
    background: linear-gradient(135deg, rgba(11, 66, 112, 0.9) 0%, rgba(42, 125, 61, 0.9) 100%);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 2rem;
}

.page-title {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 1rem;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
    background: linear-gradient(45deg, #ffffff, #f8f9fa);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: titleGlow 3s ease-in-out infinite alternate;
}

@keyframes titleGlow {
    from { filter: drop-shadow(0 0 20px rgba(255, 255, 255, 0.3)); }
    to { filter: drop-shadow(0 0 30px rgba(255, 255, 255, 0.6)); }
}

.page-subtitle {
    font-size: 1.2rem;
    opacity: 0.9;
    max-width: 600px;
    margin: 0 auto;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}

/* ===== PRODUCT CONTAINER ===== */
.product-container {
    position: relative;
    z-index: 1;
    padding: 2rem 0;
}

/* ===== PRODUCT GRID HEADER ===== */
.product-grid-header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: var(--border-radius-lg);
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow-md);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.section-title {
    color: var(--primary-color);
    font-weight: 700;
    font-size: 2rem;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
}

.section-subtitle {
    color: var(--text-muted);
    font-size: 1.1rem;
    margin-bottom: 0;
}

.product-count .badge {
    background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
    border: none;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    border-radius: 25px;
    box-shadow: var(--shadow-sm);
}

/* ===== PRODUCT GRID ===== */
.product-grid {
    margin-bottom: 2.5rem;
}

.product-card {
    background: white;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-md);
    overflow: hidden;
    transition: var(--transition-base);
    position: relative;
    height: 100%;
    display: flex;
    flex-direction: column;
    border: 1px solid rgba(255, 255, 255, 0.2);
    max-width: 380px;
    margin: 0 auto;
}

.product-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-lg);
    border-color: var(--accent-color);
}

.product-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color), var(--accent-color));
    opacity: 0;
    transition: var(--transition-base);
}

.product-card:hover::before {
    opacity: 1;
}

/* ===== PRODUCT IMAGE ===== */
.product-image-container {
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
}

.product-image-wrapper {
    position: relative;
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.25rem;
}

.product-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: var(--transition-base);
    border-radius: var(--border-radius-sm);
}

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

.product-card:hover .overlay-buttons {
    transform: translateY(0);
}

/* ===== PRODUCT PRICE DISPLAY ===== */
.price-tags {
    position: absolute;
    bottom: 1.6rem;
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    padding: 0 1rem;
    z-index: 3;
    gap: 0.5rem;
    opacity: 0.8;
}

.price-tag {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0.4rem 0.6rem;
    border-radius: 8px;
    font-size: 0.7rem;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    min-width: 60px;
}

.member-price-tag {
    background: linear-gradient(135deg, rgba(5, 150, 105, 0.95), rgba(16, 185, 129, 0.9));
    color: white;
    order: 2; /* Position on the right */
}

.regular-price-tag {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.95), rgba(220, 38, 38, 0.9));
    color: white;
    order: 1; /* Position on the left */
}

.regular-price-tag .tag-value {
    font-size: 0.75rem;
    font-weight: 700;
    line-height: 1;
    text-decoration: line-through;
}

.tag-label {
    font-size: 0.6rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.2rem;
    opacity: 0.9;
}

.tag-value {
    font-size: 0.75rem;
    font-weight: 700;
    line-height: 1;
}

/* Responsive adjustments for price tags */
@media (max-width: 575.98px) {
    .price-tags {
        bottom: 2rem;
        padding: 0 0.75rem;
        gap: 0.4rem;
    }
    
    .price-tag {
        padding: 0.3rem 0.5rem;
        min-width: 55px;
    }
    
    .tag-label {
        font-size: 0.55rem;
    }
    
    .tag-value {
        font-size: 0.7rem;
    }
}

.btn-overlay {
    width: 50px;
    height: 50px;
    border: none;
    border-radius: 50%;
    background: white;
    color: var(--primary-color);
    font-size: 1.2rem;
    cursor: pointer;
    transition: var(--transition-base);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-md);
}

.btn-overlay:hover {
    background: var(--primary-color);
    color: white;
    transform: scale(1.1);
}

.btn-quick-view:hover {
    background: var(--info-color);
    color: white;
}

.btn-wishlist:hover {
    background: var(--danger-color);
    color: white;
}

/* ===== PRODUCT BADGE ===== */
.product-badge {
    position: absolute;
    top: 1rem;
    right: 1rem;
    z-index: 2;
}

.badge-new {
    background: linear-gradient(45deg, var(--success-color), var(--accent-color));
    color: white;
    padding: 0.4rem 1rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: var(--shadow-sm);
    animation: pulse 2s infinite;
}

.badge-outofstock {
    background: linear-gradient(45deg, #dc3545, #e74c3c) !important;
    color: white !important;
    padding: 0.4rem 1rem !important;
    border-radius: 20px !important;
    font-size: 0.8rem !important;
    font-weight: 600 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1) !important;
    animation: shake 1.5s infinite !important;
    display: inline-block !important;
    position: relative !important;
    z-index: 2 !important;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

/* ===== PRODUCT INFO ===== */
.product-info {
    padding: 1.25rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.product-title {
    line-height: 1.3;
    text-align: center;
}

.product-title a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    font-size: 1.1rem;
    transition: var(--transition-base);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

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

.description-box {
    position: relative;
    max-height: 100px;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
    padding-bottom: 25px;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    border-radius: 12px;
    padding: 1rem;
    border: 1px solid rgba(0, 0, 0, 0.08);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
    backdrop-filter: blur(8px);
}

.description-box.expanded {
    max-height: 300px;
}

.description-text {
    white-space: initial;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 5px;
    transition: all 0.3s ease-out;
    font-size: 0.9rem;
    color: #495057;
    line-height: 1.5;
}

.description-box.expanded .description-text {
    -webkit-line-clamp: unset;
    overflow: visible;
}

.show-more-btn {
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    font-size: 12px;
    cursor: pointer;
    padding: 2px 5px;
    background: linear-gradient(to top, white 50%, transparent);
    width: 100%;
    text-align: center;
}

.show-more-btn:hover {
    text-decoration: underline;
}

/* ===== PRODUCT ACTIONS ===== */
.product-actions {
    display: flex;
    flex-direction: row;
    gap: 0.75rem;
    margin-top: auto;
}

.btn-add-to-cart,
.btn-view-detail {
    flex: 1;
    padding: 0.5rem 0;
    border: none;
    border-radius: var(--border-radius-sm);
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-base);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    text-decoration: none;
    font-size: 0.8rem;
    min-width: 0;
}

.btn-add-to-cart {
    background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
    color: white;
    box-shadow: var(--shadow-sm);
}

.btn-add-to-cart:hover {
    background: linear-gradient(45deg, var(--secondary-color), var(--primary-color));
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    color: white;
}

.btn-add-to-cart.adding {
    background: var(--success-color);
    pointer-events: none;
}

.btn-view-detail {
    background: transparent;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
}

.btn-view-detail:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-2px);
}

/* ===== EMPTY STATE ===== */
.empty-state {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border-radius: var(--border-radius-lg);
    padding: 3rem;
    box-shadow: var(--shadow-md);
}

.empty-icon {
    color: var(--text-muted);
}

/* ===== CAROUSEL ENHANCEMENTS ===== */
.carousel-banner {
    margin-bottom: 3rem;
    box-shadow: var(--shadow-lg);
    border-radius: var(--border-radius-lg);
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.carousel-banner .carousel-item {
    position: relative;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.carousel-banner .carousel-item img {
    width: 100%;
    height: auto;
    object-fit: cover;
    will-change: transform;
}

.carousel-banner .carousel-control-prev,
.carousel-banner .carousel-control-next {
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    top: 50%;
    transform: translateY(-50%);
    opacity: 0;
    transition: var(--transition-base);
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.carousel-banner:hover .carousel-control-prev,
.carousel-banner:hover .carousel-control-next {
    opacity: 1;
}

.carousel-banner .carousel-control-prev {
    left: 20px;
}

.carousel-banner .carousel-control-next {
    right: 20px;
}

.carousel-banner .carousel-control-prev:hover,
.carousel-banner .carousel-control-next:hover {
    background: white;
    transform: translateY(-50%) scale(1.1);
}

.carousel-banner .carousel-control-prev-icon,
.carousel-banner .carousel-control-next-icon {
    width: 24px;
    height: 24px;
    filter: invert(1) grayscale(100);
}

.carousel-banner .carousel-indicators {
    bottom: 20px;
    gap: 10px;
}

.carousel-banner .carousel-indicators button {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.5);
    border: 2px solid white;
    transition: var(--transition-base);
    cursor: pointer;
}

.carousel-banner .carousel-indicators button.active {
    background-color: white;
    transform: scale(1.3);
}

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 575.98px) {
    .page-title {
        font-size: 2rem;
    }
    
    .page-subtitle {
        font-size: 1rem;
    }
    
    .product-grid-header {
        padding: 1.5rem;
        text-align: center;
    }
    
    .section-title {
        font-size: 1.5rem;
        justify-content: center;
    }
    
    .btn-add-to-cart,
    .btn-view-detail {
        padding: 0.6rem 0.8rem;
        font-size: 0.8rem;
    }
}

@media (min-width: 576px) and (max-width: 767.98px) {
    .product-card {
        margin-bottom: 1rem;
    }
}

@media (min-width: 768px) and (max-width: 991.98px) {
    .product-grid-header {
        padding: 1.5rem;
    }
    
    .section-title {
        font-size: 1.75rem;
    }
}

@media (min-width: 992px) {
    .product-card:hover {
        transform: translateY(-12px);
    }
}

/* ===== ANIMATIONS ===== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.product-card {
    animation: fadeInUp 0.6s ease-out;
}

/* ===== LOADING STATES ===== */
.product-card.loading {
    opacity: 0.7;
    pointer-events: none;
}

.product-card.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 40px;
    height: 40px;
    margin: -20px 0 0 -20px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ===== ACCESSIBILITY ===== */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ===== PRINT STYLES ===== */
@media print {
    .product-card {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ccc;
    }
}
