/* Product Page Optimized Styles */
/* Save to: public/assets/css/product-page.css */

:root {
    --product-primary: var(--primary, #d43533);
    --product-primary-hover: var(--hov-primary, #9d1b1a);
    --product-secondary: var(--secondary-base, #ffc519);
    --product-success: #28a745;
    --product-danger: #dc3545;
    --product-gray: #6c757d;
    --product-light: #f8f9fa;
    --product-border: #e9ecef;
    --product-shadow: 0 2px 15px rgba(0,0,0,0.08);
    --product-radius: 12px;
    --product-transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ========== Product Page Wrapper ========== */
.product-page-wrapper {
    background: #f5f5f7;
    min-height: 100vh;
}

.product-content-wrapper {
    position: relative;
    z-index: 10;
    background: #fff;
}

/* ========== Product Info Card ========== */
.product-info-card {
    padding: 20px;
    background: #fff;
}

.product-breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: var(--product-gray);
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.product-breadcrumb a {
    color: var(--product-gray);
    text-decoration: none;
    transition: var(--product-transition);
}

.product-breadcrumb a:hover {
    color: var(--product-primary);
}

.product-breadcrumb i.fa-chevron-right {
    font-size: 8px;
    opacity: 0.5;
}

.product-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1a1a2e;
    line-height: 1.3;
    margin-bottom: 15px;
}

/* Quick Stats */
.quick-stats {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 12px 0;
    border-top: 1px solid var(--product-border);
    border-bottom: 1px solid var(--product-border);
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--product-gray);
}

.stat-item i {
    font-size: 14px;
}

.stat-divider {
    width: 1px;
    height: 16px;
    background: var(--product-border);
}

/* Pricing Section */
.pricing-section {
    background: linear-gradient(135deg, #fff9f0 0%, #fff 100%);
    padding: 20px;
    border-radius: var(--product-radius);
    margin-bottom: 20px;
    border: 1px solid #ffe5cc;
}

.price-row {
    display: flex;
    align-items: baseline;
    gap: 12px;
    flex-wrap: wrap;
}

.current-price {
    font-size: 2rem;
    font-weight: 800;
    color: var(--product-primary);
    line-height: 1;
}

.original-price {
    font-size: 1.1rem;
    color: #999;
    text-decoration: line-through;
}

.discount-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: linear-gradient(135deg, #ff6b35 0%, #f7c94b 100%);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 20px;
    animation: pulse 2s infinite;
}

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

.unit-label {
    font-size: 14px;
    color: var(--product-gray);
    margin-left: 5px;
}

.club-points {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    font-size: 12px;
    padding: 6px 12px;
    border-radius: 20px;
    margin-top: 12px;
}

.club-points i {
    font-size: 14px;
}

/* Info Cards Row */
.info-cards-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
    margin-bottom: 20px;
}

.info-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 15px;
    background: var(--product-light);
    border-radius: 10px;
    border: 1px solid var(--product-border);
    transition: var(--product-transition);
}

.info-card:hover {
    border-color: var(--product-primary);
    box-shadow: 0 4px 12px rgba(212,53,51,0.1);
}

.info-card i {
    font-size: 20px;
    color: var(--product-primary);
    width: 24px;
    text-align: center;
}

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

.info-label {
    font-size: 11px;
    color: var(--product-gray);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.info-value {
    font-size: 14px;
    font-weight: 600;
    color: #333;
}

.info-value.link {
    color: var(--product-primary);
    text-decoration: none;
}

.free-shipping {
    color: var(--product-success);
    font-weight: 700;
}

/* Brand Row */
.brand-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 20px;
    font-size: 14px;
}

.brand-row .label {
    color: var(--product-gray);
}

.brand-link {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: var(--product-primary);
    font-weight: 600;
    text-decoration: none;
    transition: var(--product-transition);
}

.brand-link:hover {
    text-decoration: underline;
}

.brand-link i {
    font-size: 10px;
}

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

/* Image pulse animation for variant change */
@keyframes imagePulse {
    0% { 
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(212, 53, 51, 0.7);
    }
    50% {
        transform: scale(1.03);
        box-shadow: 0 0 20px 10px rgba(212, 53, 51, 0);
    }
    100% { 
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(212, 53, 51, 0);
    }
}

.variant-form {
    margin-bottom: 20px;
}

.variant-group {
    margin-bottom: 20px;
}

.variant-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 600;
    color: #333;
    margin-bottom: 10px;
}

.variant-label i {
    color: var(--product-primary);
    font-size: 14px;
}

/* Color Options */
.color-options {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.color-option {
    position: relative;
    cursor: pointer;
}

.color-option input {
    position: absolute;
    opacity: 0;
}

.color-swatch {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 3px solid transparent;
    transition: var(--product-transition);
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.color-swatch i {
    color: #fff;
    font-size: 14px;
    opacity: 0;
    text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

.color-option input:checked + .color-swatch {
    border-color: var(--product-primary);
    transform: scale(1.1);
    box-shadow: 0 4px 15px rgba(212,53,51,0.4);
    animation: colorSelect 0.3s ease;
}

.color-option input:checked + .color-swatch i {
    opacity: 1;
}

@keyframes colorSelect {
    0% { transform: scale(1); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1.1); }
}

/* Hover effect for color swatches */
.color-option:hover .color-swatch {
    transform: scale(1.05);
    box-shadow: 0 3px 10px rgba(0,0,0,0.2);
}

/* Choice Options (Size, etc) */
.choice-options {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.choice-option {
    cursor: pointer;
}

.choice-option input {
    position: absolute;
    opacity: 0;
}

.choice-btn {
    display: inline-block;
    padding: 10px 20px;
    background: #fff;
    border: 2px solid var(--product-border);
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    color: #333;
    transition: var(--product-transition);
    min-width: 50px;
    text-align: center;
}

.choice-option input:checked + .choice-btn,
.choice-btn:hover {
    border-color: var(--product-primary);
    color: var(--product-primary);
    background: rgba(212,53,51,0.05);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(212,53,51,0.2);
}

/* Loading state for variant selection */
.variant-form.loading {
    opacity: 0.6;
    pointer-events: none;
}

.variant-form.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid var(--product-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.size-guide-link {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 13px;
    color: var(--product-primary);
    text-decoration: none;
    margin-top: -10px;
    margin-bottom: 15px;
}

.size-guide-link:hover {
    text-decoration: underline;
}

/* Quantity Selector */
.quantity-wrapper {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.quantity-selector {
    display: inline-flex;
    align-items: center;
    background: var(--product-light);
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid var(--product-border);
}

.qty-btn {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    cursor: pointer;
    transition: var(--product-transition);
    color: #333;
}

.qty-btn:hover {
    background: var(--product-primary);
    color: #fff;
}

.qty-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.qty-input {
    width: 60px;
    height: 44px;
    border: none;
    text-align: center;
    font-size: 16px;
    font-weight: 600;
    background: transparent;
    -moz-appearance: textfield;
}

.qty-input::-webkit-outer-spin-button,
.qty-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.stock-info {
    font-size: 13px;
    color: var(--product-gray);
}

.stock-info i {
    margin-right: 4px;
}

/* Total Price */
.total-price-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 15px 20px;
    background: linear-gradient(135deg, #e8f5e9 0%, #fff 100%);
    border-radius: 10px;
    margin-bottom: 20px;
    border: 1px solid #c8e6c9;
}

.total-price-row .label {
    font-size: 14px;
    color: var(--product-gray);
}

.total-price {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--product-success);
}

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

.btn-action {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 16px 24px;
    font-size: 15px;
    font-weight: 600;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: var(--product-transition);
    text-decoration: none;
}

.btn-action.add-cart {
    background: #fff;
    color: var(--product-primary);
    border: 2px solid var(--product-primary);
}

.btn-action.add-cart:hover {
    background: var(--product-primary);
    color: #fff;
}

.btn-action.buy-now {
    background: linear-gradient(135deg, var(--product-primary) 0%, var(--product-primary-hover) 100%);
    color: #fff;
    box-shadow: 0 4px 15px rgba(212,53,51,0.4);
}

.btn-action.buy-now:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(212,53,51,0.5);
}

.btn-action.out-of-stock {
    background: #eee;
    color: #999;
    cursor: not-allowed;
}

.btn-action.external {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
}

/* Seller Guarantee */
.seller-guarantee {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: var(--product-light);
    border-radius: 8px;
    font-size: 13px;
    margin-top: 15px;
}

/* ========== Mobile Bottom Bar ========== */
.mobile-bottom-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #fff;
    padding: 12px 15px;
    box-shadow: 0 -4px 20px rgba(0,0,0,0.1);
    z-index: 1000;
    display: none;
}

.mobile-bottom-bar .bottom-actions {
    display: flex;
    gap: 10px;
}

.mobile-bottom-bar .btn-mobile {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 14px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: var(--product-transition);
}

.mobile-bottom-bar .btn-cart {
    background: #fff;
    color: var(--product-primary);
    border: 2px solid var(--product-primary);
}

.mobile-bottom-bar .btn-buy {
    background: var(--product-primary);
    color: #fff;
}

.mobile-bottom-bar .quick-icons {
    display: flex;
    align-items: center;
    gap: 5px;
}

.mobile-bottom-bar .icon-btn {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--product-light);
    border-radius: 10px;
    border: none;
    cursor: pointer;
    position: relative;
}

.mobile-bottom-bar .icon-btn .badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: var(--product-primary);
    color: #fff;
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 10px;
}

/* ========== Floating Actions ========== */
.floating-actions {
    position: fixed;
    right: 15px;
    bottom: 100px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 999;
}

.floating-btn {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: none;
    background: #fff;
    box-shadow: 0 4px 15px rgba(0,0,0,0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--product-transition);
    position: relative;
}

.floating-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(0,0,0,0.2);
}

.floating-btn i {
    font-size: 20px;
    color: #333;
}

.floating-btn.wishlist i.fas {
    color: #e74c3c;
}

.floating-btn .tooltip-text {
    position: absolute;
    right: 60px;
    background: #333;
    color: #fff;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: var(--product-transition);
}

.floating-btn:hover .tooltip-text {
    opacity: 1;
}

/* ========== Responsive ========== */
@media (max-width: 991.98px) {
    .mobile-bottom-bar {
        display: block;
    }
    
    .product-info-card {
        padding-bottom: 100px;
    }
    
    .product-title {
        font-size: 1.25rem;
    }
    
    .current-price {
        font-size: 1.5rem;
    }
    
    .floating-actions {
        bottom: 80px;
    }
}

@media (max-width: 575.98px) {
    .info-cards-row {
        grid-template-columns: 1fr;
    }
    
    .quick-stats {
        justify-content: space-between;
    }
    
    .stat-divider {
        display: none;
    }
}