/* 
 * ONPhI Shop - Modern Design
 * Version 2.0 - 2025
 */

:root {
    --shop-primary: #f56a6a;
    --shop-secondary: #3d4449;
    --shop-bg: #f8f9fa;
    --shop-card-bg: #ffffff;
    --shop-border: #dee2e6;
    --shop-shadow: 0 2px 8px rgba(0,0,0,0.1);
    --shop-shadow-hover: 0 4px 16px rgba(0,0,0,0.15);
    --transition-speed: 0.3s;
}

/* ==================== GRID MODERNE ==================== */
.shop-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
}

.shop-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

@media (max-width: 768px) {
    .shop-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .shop-container {
        padding: 1rem;
    }
}

/* ==================== CARTE PRODUIT MODERNE ==================== */
.product-card {
    background: var(--shop-card-bg);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shop-shadow);
    transition: all var(--transition-speed) ease;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.product-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shop-shadow-hover);
}

.product-image-wrapper {
    position: relative;
    width: 100%;
    padding-top: 75%; /* Ratio 4:3 */
    overflow: hidden;
    background: var(--shop-bg);
}

.product-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition-speed) ease;
}

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

.product-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    background: var(--shop-primary);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    z-index: 2;
}

.product-content {
    padding: 1.5rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.product-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--shop-secondary);
    margin-bottom: 0.75rem;
    line-height: 1.3;
}

.product-description {
    color: #6c757d;
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 1rem;
    flex: 1;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 1rem;
    border-top: 1px solid var(--shop-border);
}

.product-price {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--shop-primary);
}

.product-price-currency {
    font-size: 1.25rem;
    margin-left: 0.25rem;
}

/* ==================== QUANTITÉ MODERNE ==================== */
.quantity-selector {
    display: inline-flex;
    align-items: center;
    border: 2px solid var(--shop-border);
    border-radius: 8px;
    overflow: hidden;
    margin: 1rem 0;
}

.quantity-btn {
    background: var(--shop-bg);
    border: none;
    padding: 0.5rem 1rem;
    cursor: pointer;
    font-size: 1.25rem;
    color: var(--shop-secondary);
    transition: all 0.2s ease;
    min-width: 40px;
}

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

.quantity-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.quantity-input {
    border: none;
    text-align: center;
    width: 60px;
    font-size: 1.1rem;
    font-weight: 600;
    padding: 0.5rem;
    background: white;
}

.quantity-input:focus {
    outline: none;
}

/* ==================== BOUTON AJOUT PANIER ==================== */
.add-to-cart-btn {
    background: var(--shop-primary);
    color: white;
    border: none;
    padding: 0.875rem 2rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.add-to-cart-btn:hover {
    background: #f45c5c;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(245, 106, 106, 0.3);
}

.add-to-cart-btn:active {
    transform: translateY(0);
}

.add-to-cart-btn.loading {
    pointer-events: none;
    opacity: 0.7;
}

.add-to-cart-btn.success {
    background: #28a745;
    pointer-events: none;
}

.add-to-cart-btn i {
    font-size: 1.2rem;
}

/* ==================== INDICATEUR PANIER FLOTTANT ==================== */
.cart-indicator {
    position: fixed;
    top: 120px;
    right: 30px;
    background: white;
    border-radius: 50%;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 16px rgba(0,0,0,0.2);
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 1000;
}

.cart-indicator:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(0,0,0,0.3);
}

.cart-indicator i {
    font-size: 1.5rem;
    color: var(--shop-primary);
}

.cart-count {
    position: absolute;
    top: -5px;
    right: -5px;
    background: var(--shop-primary);
    color: white;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
    border: 2px solid white;
}

/* ==================== ANIMATION AJOUT PANIER ==================== */
@keyframes flyToCart {
    0% {
        transform: scale(1) translate(0, 0);
        opacity: 1;
    }
    50% {
        transform: scale(0.5) translate(50%, -50%);
        opacity: 0.8;
    }
    100% {
        transform: scale(0.1) translate(100%, -100%);
        opacity: 0;
    }
}

.flying-item {
    position: fixed;
    z-index: 9999;
    pointer-events: none;
    animation: flyToCart 0.8s ease-in-out forwards;
}

/* ==================== NOTIFICATION TOAST ==================== */
.toast-notification {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: white;
    padding: 1.25rem 1.5rem;
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.2);
    display: flex;
    align-items: center;
    gap: 1rem;
    z-index: 10000;
    animation: slideIn 0.3s ease-out;
    max-width: 400px;
}

@keyframes slideIn {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.toast-icon {
    font-size: 1.5rem;
    color: var(--shop-primary);
}

.toast-content {
    flex: 1;
}

.toast-title {
    font-weight: 600;
    margin-bottom: 0.25rem;
    color: var(--shop-secondary);
}

.toast-message {
    font-size: 0.9rem;
    color: #6c757d;
}

.toast-close {
    cursor: pointer;
    font-size: 1.25rem;
    color: #6c757d;
    background: none;
    border: none;
    padding: 0;
}

/* ==================== PANIER SIDEBAR ==================== */
.cart-sidebar {
    position: fixed;
    top: 0;
    right: -450px;
    width: 450px;
    height: 100vh;
    background: white;
    box-shadow: -4px 0 16px rgba(0,0,0,0.2);
    transition: right 0.3s ease;
    z-index: 10001;
    display: flex;
    flex-direction: column;
}

.cart-sidebar.open {
    right: 0;
}

.cart-sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 10000;
    display: none;
}

.cart-sidebar-overlay.active {
    display: block;
}

.cart-header {
    padding: 2rem;
    border-bottom: 2px solid var(--shop-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.cart-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--shop-secondary);
}

.cart-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--shop-secondary);
    padding: 0;
}

.cart-items {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
}

.cart-item {
    display: flex;
    gap: 1rem;
    padding: 1rem;
    border: 1px solid var(--shop-border);
    border-radius: 8px;
    margin-bottom: 1rem;
    transition: all 0.2s ease;
}

.cart-item:hover {
    box-shadow: var(--shop-shadow);
}

.cart-item-image {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 4px;
}

.cart-item-details {
    flex: 1;
}

.cart-item-name {
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--shop-secondary);
}

.cart-item-price {
    color: var(--shop-primary);
    font-weight: 700;
}

.cart-item-remove {
    background: none;
    border: none;
    color: #dc3545;
    cursor: pointer;
    font-size: 1.25rem;
    padding: 0.25rem;
}

.cart-footer {
    padding: 2rem;
    border-top: 2px solid var(--shop-border);
}

.cart-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
    font-weight: 700;
}

.cart-total-label {
    color: var(--shop-secondary);
}

.cart-total-amount {
    color: var(--shop-primary);
}

.cart-checkout-btn {
    width: 100%;
    padding: 1rem;
    background: var(--shop-primary);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.cart-checkout-btn:hover {
    background: #f45c5c;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(245, 106, 106, 0.3);
}

/* ==================== EMPTY CART ==================== */
.cart-empty {
    text-align: center;
    padding: 3rem 2rem;
}

.cart-empty-icon {
    font-size: 4rem;
    color: var(--shop-border);
    margin-bottom: 1rem;
}

.cart-empty-message {
    font-size: 1.25rem;
    color: #6c757d;
    margin-bottom: 2rem;
}

.cart-empty-btn {
    display: inline-block;
    padding: 0.875rem 2rem;
    background: var(--shop-primary);
    color: white;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
}

.cart-empty-btn:hover {
    background: #f45c5c;
    transform: translateY(-2px);
}

/* ==================== RESPONSIVE ==================== */
@media (max-width: 768px) {
    .cart-sidebar {
        width: 100%;
        right: -100%;
    }
    
    .cart-indicator {
        width: 50px;
        height: 50px;
        right: 20px;
        top: 100px;
    }
    
    .cart-indicator i {
        font-size: 1.25rem;
    }
    
    .toast-notification {
        right: 20px;
        bottom: 20px;
        max-width: calc(100% - 40px);
    }
}

/* ==================== LOADER ==================== */
.cart-loader {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255,255,255,0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ==================== PAGE TITRE ==================== */
.shop-header {
    text-align: center;
    padding: 3rem 0;
    border-bottom: 3px solid var(--shop-primary);
    margin-bottom: 2rem;
}

.shop-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--shop-secondary);
    margin-bottom: 0.5rem;
}

.shop-subtitle {
    font-size: 1.25rem;
    color: #6c757d;
}

/* ==================== FILTRES ==================== */
.shop-filters {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 0.75rem 1.5rem;
    border: 2px solid var(--shop-border);
    background: white;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
}

.filter-btn:hover,
.filter-btn.active {
    border-color: var(--shop-primary);
    background: var(--shop-primary);
    color: white;
}

