/* Shopee Malaysia Style - PHP Version */
:root {
    --primary: #EE4D2D;
    --primary-dark: #d73211;
    --primary-light: #ff6b4a;
    --background: #f5f5f5;
    --card-bg: #ffffff;
    --text-primary: #222222;
    --text-secondary: #666666;
    --text-muted: #999999;
    --border: #e8e8e8;
    --success: #22c55e;
    --warning: #ffbf00;
    --danger: #ef4444;
    --shadow: 0 1px 4px rgba(0,0,0,0.08);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--background);
    color: var(--text-primary);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 16px;
}

/* Marquee Banner */
.marquee-banner {
    background: linear-gradient(90deg, var(--primary), var(--primary-light));
    color: white;
    padding: 8px 0;
    overflow: hidden;
    font-size: 13px;
}

.marquee-content {
    display: flex;
    animation: marquee 30s linear infinite;
    white-space: nowrap;
}

@keyframes marquee {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

/* Header */
.header {
    background: linear-gradient(180deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    padding: 12px 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.header-content {
    display: flex;
    align-items: center;
    gap: 24px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: white;
    flex-shrink: 0;
}

.logo-icon {
    width: 40px;
    height: 40px;
    background: white;
    color: var(--primary);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 22px;
}

.logo-text {
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.search-bar {
    flex: 1;
    display: flex;
    max-width: 600px;
    background: white;
    border-radius: 4px;
    overflow: hidden;
}

.search-bar input {
    flex: 1;
    padding: 10px 16px;
    border: none;
    outline: none;
    font-size: 14px;
}

.search-btn {
    padding: 10px 20px;
    background: var(--primary);
    border: none;
    color: white;
    cursor: pointer;
}

.search-btn:hover {
    background: var(--primary-dark);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.cart-btn {
    position: relative;
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    padding: 8px;
}

.cart-count {
    position: absolute;
    top: 0;
    right: 0;
    background: white;
    color: var(--primary);
    font-size: 11px;
    font-weight: 600;
    min-width: 18px;
    height: 18px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.admin-link {
    color: white;
    text-decoration: none;
    font-size: 14px;
    padding: 8px 16px;
    border: 1px solid rgba(255,255,255,0.5);
    border-radius: 4px;
}

.admin-link:hover {
    background: rgba(255,255,255,0.1);
}

/* Main Content */
.main-content {
    padding: 20px 0 100px;
}

.product-layout {
    display: grid;
    grid-template-columns: 480px 1fr;
    gap: 20px;
}

@media (max-width: 992px) {
    .product-layout {
        grid-template-columns: 1fr;
    }
}

/* Product Gallery */
.product-gallery {
    background: white;
    border-radius: 8px;
    padding: 16px;
    box-shadow: var(--shadow);
}

.main-image-container {
    position: relative;
    width: 100%;
    aspect-ratio: 1;
    overflow: hidden;
    border-radius: 8px;
    margin-bottom: 12px;
    background: #fafafa;
}

.main-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.discount-tag {
    position: absolute;
    top: 12px;
    left: 12px;
    background: var(--primary);
    color: white;
    padding: 4px 12px;
    border-radius: 2px;
    font-size: 13px;
    font-weight: 600;
}

.thumbnail-list {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 4px;
}

.thumbnail {
    width: 72px;
    height: 72px;
    border-radius: 4px;
    overflow: hidden;
    cursor: pointer;
    border: 2px solid transparent;
    flex-shrink: 0;
    transition: border-color 0.2s;
}

.thumbnail.active {
    border-color: var(--primary);
}

.thumbnail:hover {
    border-color: var(--primary-light);
}

.thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Product Info Section */
.product-info-section {
    background: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: var(--shadow);
}

.preferred-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: var(--primary);
    color: white;
    padding: 4px 10px;
    border-radius: 2px;
    font-size: 12px;
    font-weight: 500;
    margin-bottom: 12px;
}

.badge-icon {
    font-size: 10px;
}

.product-title {
    font-size: 18px;
    font-weight: 500;
    line-height: 1.5;
    margin-bottom: 12px;
    color: var(--text-primary);
}

.product-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.rating {
    display: flex;
    align-items: center;
    gap: 6px;
}

.stars {
    color: var(--warning);
    font-size: 14px;
}

.rating-value {
    color: var(--primary);
    font-weight: 500;
}

.divider {
    color: var(--border);
}

.reviews-count, .sold-count {
    color: var(--text-secondary);
}

/* Price Section */
.price-section {
    background: #fef6f5;
    padding: 16px;
    border-radius: 4px;
    margin-bottom: 20px;
}

.price-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
}

.current-price {
    font-size: 28px;
    font-weight: 600;
    color: var(--primary);
}

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

.discount-badge {
    background: var(--primary);
    color: white;
    padding: 3px 8px;
    border-radius: 2px;
    font-size: 12px;
    font-weight: 600;
}

.flash-sale-tag {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--primary);
    font-size: 13px;
    font-weight: 500;
    flex-wrap: wrap;
    margin-top: 8px;
}

.flash-icon {
    font-size: 16px;
    animation: flashPulse 1.5s infinite;
}

@keyframes flashPulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.7; transform: scale(1.1); }
}

.flash-text {
    font-size: 13px;
    color: var(--primary);
    font-weight: 500;
}

/* Countdown Timer */
.countdown-timer {
    display: flex;
    align-items: center;
    gap: 4px;
}

.time-box {
    background: linear-gradient(135deg, #ee4d2d 0%, #ff6b4a 100%);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    text-align: center;
    min-width: 36px;
    box-shadow: 0 2px 4px rgba(238, 77, 45, 0.3);
}

.time-box span:first-child {
    font-size: 16px;
    font-weight: 700;
    display: block;
    line-height: 1.2;
}

.time-box .time-label {
    font-size: 9px;
    opacity: 0.9;
    display: block;
    margin-top: 1px;
}

.time-sep {
    color: #ee4d2d;
    font-weight: 700;
    font-size: 16px;
}

/* Countdown animation pulse */
@keyframes countdownPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.time-box.pulse {
    animation: countdownPulse 0.3s ease-in-out;
}

/* Countdown urgent state (last 10 minutes) */
.countdown-timer.urgent .time-box {
    background: linear-gradient(135deg, #dc2626 0%, #ef4444 100%);
    animation: urgentPulse 0.5s infinite;
}

@keyframes urgentPulse {
    0%, 100% { box-shadow: 0 2px 4px rgba(220, 38, 38, 0.3); }
    50% { box-shadow: 0 2px 12px rgba(220, 38, 38, 0.6); }
}

/* Info Rows */
.info-row {
    display: flex;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
}

.info-label {
    width: 100px;
    color: var(--text-muted);
    font-size: 14px;
    flex-shrink: 0;
}

.info-content {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.free-shipping {
    color: var(--success);
    font-size: 14px;
    font-weight: 500;
}

.shipping-detail {
    color: var(--text-secondary);
    font-size: 13px;
}

/* Variant Section */
.variant-section {
    padding: 16px 0;
    border-bottom: 1px solid var(--border);
}

.variant-label {
    display: block;
    color: var(--text-muted);
    font-size: 14px;
    margin-bottom: 12px;
}

.variant-options {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.variant-btn {
    padding: 8px 16px;
    border: 1px solid var(--border);
    background: white;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
}

.variant-btn:hover:not(.disabled) {
    border-color: var(--primary);
}

.variant-btn.active {
    border-color: var(--primary);
    color: var(--primary);
    background: #fff5f3;
}

.variant-btn.disabled {
    background: #f5f5f5;
    color: var(--text-muted);
    cursor: not-allowed;
}

/* Quantity Section */
.quantity-section {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 0;
    border-bottom: 1px solid var(--border);
}

.quantity-label {
    color: var(--text-muted);
    font-size: 14px;
}

.quantity-controls {
    display: flex;
    align-items: center;
    border: 1px solid var(--border);
    border-radius: 4px;
}

.quantity-controls button {
    width: 36px;
    height: 36px;
    border: none;
    background: transparent;
    font-size: 18px;
    cursor: pointer;
    color: var(--text-secondary);
}

.quantity-controls button:hover {
    background: var(--background);
}

.quantity-controls input {
    width: 50px;
    height: 36px;
    border: none;
    border-left: 1px solid var(--border);
    border-right: 1px solid var(--border);
    text-align: center;
    font-size: 16px;
    outline: none;
}

.stock-info {
    color: var(--text-muted);
    font-size: 14px;
}

/* Action Buttons */
.action-buttons {
    display: flex;
    gap: 12px;
    padding: 20px 0;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}

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

.btn-primary:hover {
    background: var(--primary-dark);
}

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

.btn-outline:hover {
    background: #fff5f3;
}

.btn-lg {
    padding: 14px 40px;
    font-size: 16px;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 13px;
}

.btn-full {
    width: 100%;
}

.action-buttons .btn {
    flex: 1;
}

/* Seller Info */
.seller-info {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background: var(--background);
    border-radius: 8px;
    margin-top: 8px;
}

.seller-avatar {
    width: 48px;
    height: 48px;
    background: var(--primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 18px;
}

.seller-details {
    flex: 1;
}

.seller-name {
    font-weight: 500;
    margin-bottom: 4px;
}

.seller-stats {
    font-size: 13px;
    color: var(--text-muted);
    display: flex;
    gap: 8px;
}

/* Product Tabs */
.product-tabs {
    background: white;
    border-radius: 8px;
    margin-top: 20px;
    box-shadow: var(--shadow);
    overflow: hidden;
}

.tabs-header {
    display: flex;
    border-bottom: 1px solid var(--border);
}

.tab-btn {
    padding: 16px 24px;
    background: none;
    border: none;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    position: relative;
}

.tab-btn.active {
    color: var(--primary);
}

.tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--primary);
}

.tabs-content {
    padding: 24px;
}

.tab-panel {
    display: none;
}

.tab-panel.active {
    display: block;
}

.tab-panel h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 16px;
}

.tab-panel h4 {
    font-size: 15px;
    font-weight: 500;
    margin: 20px 0 12px;
}

.description-content {
    color: var(--text-secondary);
    line-height: 1.7;
    white-space: pre-line;
}

.features-list {
    list-style: none;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 8px;
}

.features-list li {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-secondary);
    font-size: 14px;
}

.features-list li::before {
    content: '✓';
    color: var(--success);
    font-weight: 600;
}

/* Specs Table */
.specs-table {
    width: 100%;
    border-collapse: collapse;
}

.specs-table tr:nth-child(even) {
    background: var(--background);
}

.specs-table td {
    padding: 12px 16px;
    font-size: 14px;
    border-bottom: 1px solid var(--border);
}

.specs-table td:first-child {
    color: var(--text-muted);
    width: 180px;
}

/* Reviews */
.reviews-summary {
    text-align: center;
    padding: 24px;
    background: var(--background);
    border-radius: 8px;
    margin-bottom: 24px;
}

.rating-big {
    display: flex;
    align-items: baseline;
    justify-content: center;
    margin-bottom: 8px;
}

.rating-number {
    font-size: 48px;
    font-weight: 600;
    color: var(--primary);
}

.rating-max {
    font-size: 24px;
    color: var(--text-muted);
}

.stars-big {
    font-size: 24px;
    color: var(--warning);
    margin-bottom: 8px;
}

.total-reviews {
    color: var(--text-muted);
    font-size: 14px;
}

.reviews-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.review-item {
    padding: 16px;
    background: var(--background);
    border-radius: 8px;
}

.review-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.reviewer-avatar {
    width: 40px;
    height: 40px;
    background: var(--primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 500;
}

.reviewer-info {
    flex: 1;
}

.reviewer-name {
    font-weight: 500;
    margin-bottom: 2px;
}

.review-stars {
    color: var(--warning);
    font-size: 13px;
}

.review-date {
    color: var(--text-muted);
    font-size: 13px;
}

.review-variant {
    color: var(--text-muted);
    font-size: 13px;
    margin-bottom: 8px;
}

.review-content {
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.6;
}

/* Sticky Bottom Bar */
.sticky-bottom-bar {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    padding: 12px 16px;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
    z-index: 99;
}

@media (max-width: 768px) {
    .sticky-bottom-bar {
        display: flex;
        gap: 8px;
    }
    
    .action-buttons {
        display: none;
    }
    
    .whatsapp-fab {
        bottom: 80px !important;
    }
}

.bottom-btn {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 8px;
    background: none;
    border: 1px solid var(--border);
    border-radius: 4px;
    font-size: 12px;
    color: var(--text-secondary);
    cursor: pointer;
}

.bottom-btn-primary {
    flex: 2;
    padding: 12px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
}

.bottom-btn-primary:hover {
    background: var(--primary-dark);
}

/* WhatsApp FAB */
.whatsapp-fab {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 56px;
    height: 56px;
    background: #25D366;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    z-index: 98;
    transition: transform 0.2s;
}

.whatsapp-fab:hover {
    transform: scale(1.1);
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: 12px;
    padding: 24px;
    max-width: 480px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
}

.modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 32px;
    height: 32px;
    background: var(--background);
    border: none;
    border-radius: 50%;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content h2 {
    margin-bottom: 20px;
    font-size: 20px;
}

/* Form */
.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-size: 14px;
    font-weight: 500;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 4px;
    font-size: 14px;
    font-family: inherit;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
}

.order-summary {
    background: var(--background);
    padding: 16px;
    border-radius: 8px;
    margin-bottom: 16px;
}

/* Badge Styles for Admin Panel */
.badge {
    display: inline-block;
    padding: 4px 10px;
    font-size: 12px;
    font-weight: 500;
    border-radius: 4px;
    text-transform: capitalize;
}

.badge-success {
    background: #dcfce7;
    color: #166534;
}

.badge-warning {
    background: #fef3c7;
    color: #92400e;
}

.badge-secondary {
    background: #f3f4f6;
    color: #4b5563;
}

.badge-danger {
    background: #fee2e2;
    color: #dc2626;
}

/* Permission Checkbox Styling */
.perm-checkbox {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    background: #f9fafb;
    border: 1px solid var(--border);
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s;
}

.perm-checkbox:hover {
    background: #f3f4f6;
    border-color: var(--primary-light);
}

.perm-checkbox input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--primary);
    cursor: pointer;
}

.perm-checkbox input[type="checkbox"]:checked + span {
    color: var(--primary);
    font-weight: 500;
}

/* Role Card Styling */
.role-card {
    transition: box-shadow 0.2s;
}

.role-card:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Danger Button */
.btn-danger {
    background: #dc2626;
    color: white;
    border: none;
}

.btn-danger:hover {
    background: #b91c1c;
}

/* Responsive */
@media (max-width: 768px) {
    .search-bar {
        display: none;
    }
    
    .logo-text {
        font-size: 18px;
    }
    
    .product-title {
        font-size: 16px;
    }
    
    .current-price {
        font-size: 24px;
    }
    
    .tabs-header {
        overflow-x: auto;
    }
    
    .tab-btn {
        white-space: nowrap;
        padding: 12px 16px;
    }
}
