/* Yacht Provisioning - Shop Styles */

/* Message de bienvenue */
.ypw-welcome-message {
    background: linear-gradient(135deg, #0c4a6e 0%, #0369a1 100%);
    color: white;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 30px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.ypw-welcome-message p {
    margin: 5px 0;
}

.ypw-welcome-message strong {
    font-size: 1.2em;
}

/* Conteneur accordéon */
.ypw-accordion-container {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    margin-bottom: 30px;
}

/* Section catégorie */
.ypw-category-section {
    border-bottom: 1px solid #e5e7eb;
}

.ypw-category-section:last-child {
    border-bottom: none;
}

/* Bouton toggle catégorie */
.ypw-category-toggle {
    width: 100%;
    background: #f8f9fa;
    border: none;
    padding: 18px 20px;
    text-align: left;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: all 0.3s ease;
    font-size: 1.1em;
}

.ypw-category-toggle:hover {
    background: #e9ecef;
}

.ypw-category-toggle.active {
    background: #0c4a6e;
    color: white;
}

.ypw-category-icon {
    font-size: 0.8em;
    transition: transform 0.3s ease;
    display: inline-block;
}

.ypw-category-toggle.active .ypw-category-icon {
    transform: rotate(90deg);
}

.ypw-category-name {
    font-weight: 600;
    flex: 1;
}

.ypw-category-count {
    color: #6b7280;
    font-size: 0.9em;
}

.ypw-category-toggle.active .ypw-category-count {
    color: rgba(255, 255, 255, 0.8);
}

/* Contenu de la catégorie */
.ypw-category-products {
    padding: 0;
    background: white;
}

/* Table des produits dans chaque catégorie */
.ypw-category-products .ypw-products-table {
    margin: 0;
    border-radius: 0;
    box-shadow: none;
}

/* Table des produits */
.ypw-products-table {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    margin-bottom: 30px;
}

.ypw-products-table table {
    width: 100%;
    margin: 0;
}

.ypw-products-table thead {
    background: #0c4a6e;
    color: white;
}

.ypw-products-table th {
    padding: 15px 10px;
    font-weight: 600;
    text-align: left;
    border-bottom: 3px solid #0369a1;
}

.ypw-products-table tbody tr {
    border-bottom: 1px solid #e5e7eb;
    transition: background-color 0.2s ease;
}

.ypw-products-table tbody tr:hover {
    background-color: #f0f9ff;
}

.ypw-products-table td {
    padding: 15px 10px;
    vertical-align: middle;
}

/* Colonnes produit */
.ypw-product-name strong {
    color: #0c4a6e;
    font-size: 1.05em;
    display: block;
    margin-bottom: 5px;
}

.ypw-product-desc {
    color: #6b7280;
    font-size: 0.9em;
    margin-top: 5px;
    line-height: 1.4;
}

.ypw-product-price {
    color: #0369a1;
    font-weight: 600;
    font-size: 1.1em;
}

/* Champs de formulaire dans la table */
.ypw-prep-select,
.ypw-comment-input,
.ypw-variation-select {
    width: 100%;
    padding: 8px;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    font-size: 0.95em;
}

/* Réduire la largeur de la colonne préparation */
.ypw-product-prep {
    width: 110px;
    max-width: 110px;
}

.ypw-prep-select {
    width: 100%;
    max-width: 105px;
    padding: 5px;
    font-size: 0.85em;
}

/* Styles pour les checkboxes de variations - Version compacte */
.ypw-product-size {
    width: 150px;
    max-width: 150px;
}

.ypw-variation-checkboxes {
    display: flex !important;
    flex-direction: column;
    gap: 5px;
    visibility: visible !important;
    opacity: 1 !important;
}

.ypw-variation-checkbox-label {
    display: flex !important;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 3px;
    transition: all 0.2s ease;
    background: #f9fafb;
    border: 1px solid transparent;
    visibility: visible !important;
    opacity: 1 !important;
}

.ypw-variation-checkbox-label:hover {
    background: #f0f9ff;
    border-color: #bae6fd;
}

.ypw-variation-checkbox {
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: #0369a1;
    flex-shrink: 0;
    display: inline-block !important;
    visibility: visible !important;
    opacity: 1 !important;
    position: relative !important;
    left: auto !important;
}

.ypw-variation-checkbox:checked + .ypw-checkbox-text {
    font-weight: 600;
    color: #0c4a6e;
}

.ypw-variation-checkbox-label:has(.ypw-variation-checkbox:checked) {
    background: #e0f2fe;
    border-color: #0369a1;
}

.ypw-checkbox-text {
    font-size: 0.9em;
    color: #374151;
    transition: all 0.2s ease;
    display: inline-block !important;
    visibility: visible !important;
}

.ypw-prep-select:focus,
.ypw-comment-input:focus,
.ypw-variation-select:focus {
    outline: none;
    border-color: #0369a1;
    box-shadow: 0 0 0 3px rgba(3, 105, 161, 0.1);
}

/* Select de variation désactivé jusqu'à sélection */
.ypw-prep-select:disabled {
    background-color: #f3f4f6;
    color: #9ca3af;
    cursor: not-allowed;
}

/* Highlight pour la variation sélectionnée */
.ypw-variation-select option:checked {
    background-color: #0369a1;
    color: white;
}

/* Champ quantité */
.ypw-product-qty input[type="number"],
.ypw-qty-input {
    width: 80px;
    padding: 8px;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    text-align: center;
    font-weight: 600;
}

.ypw-product-qty input[type="number"]:focus,
.ypw-qty-input:focus {
    outline: none;
    border-color: #0369a1;
    box-shadow: 0 0 0 3px rgba(3, 105, 161, 0.1);
}

/* Bouton d'ajout */
.ypw-add-to-cart {
    background: #0369a1;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
}

.ypw-add-to-cart:hover {
    background: #0c4a6e;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

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

/* Feedback visuel lors de l'ajout */
.ypw-add-to-cart.adding {
    background: #10b981;
    pointer-events: none;
}

.ypw-add-to-cart.adding::after {
    content: " ✓";
}

/* Messages de prix cachés */
.price-hidden {
    color: #6b7280;
    font-style: italic;
}

/* Responsive Mobile */
@media (max-width: 768px) {
    /* Conteneur accordéon mobile */
    .ypw-accordion-container {
        margin: 0 -15px;
        border-radius: 0;
    }
    
    /* Bouton toggle catégorie mobile */
    .ypw-category-toggle {
        padding: 15px;
        font-size: 1em;
        flex-wrap: wrap;
    }
    
    .ypw-category-name {
        font-size: 1em;
    }
    
    .ypw-category-count {
        font-size: 0.85em;
    }
    
    /* Table responsive : passage en mode carte */
    .ypw-products-table {
        overflow: visible;
        border-radius: 0;
    }
    
    .ypw-products-table table {
        min-width: auto;
    }
    
    .ypw-products-table thead {
        display: none;
    }
    
    .ypw-products-table tbody tr {
        display: block;
        margin-bottom: 15px;
        border: 1px solid #e5e7eb;
        border-radius: 8px;
        padding: 15px;
        background: white;
    }
    
    .ypw-products-table tbody tr:hover {
        background: #f8fafc;
    }
    
    .ypw-products-table td {
        display: block;
        padding: 8px 0;
        border: none;
        text-align: left !important;
    }
    
    .ypw-products-table td::before {
        content: attr(data-label);
        font-weight: 600;
        color: #0c4a6e;
        display: block;
        margin-bottom: 5px;
        font-size: 0.9em;
    }
    
    /* Colonnes spécifiques mobile */
    .ypw-product-name {
        border-bottom: 2px solid #e5e7eb;
        padding-bottom: 12px !important;
        margin-bottom: 12px;
    }
    
    .ypw-product-name strong {
        font-size: 1.1em;
    }
    
    .ypw-product-price {
        font-size: 1.2em;
        padding-top: 5px !important;
    }
    
    /* Champs de formulaire mobile */
    .ypw-prep-select,
    .ypw-comment-input,
    .ypw-variation-select {
        width: 100%;
        font-size: 16px; /* Évite le zoom sur iOS */
        padding: 10px;
    }
    
    .ypw-prep-select {
        max-width: 100%;
    }
    
    /* Checkboxes de variations en mobile */
    .ypw-variation-checkboxes {
        gap: 10px;
    }
    
    .ypw-variation-checkbox-label {
        padding: 10px 12px;
        font-size: 16px;
    }
    
    .ypw-variation-checkbox {
        width: 20px;
        height: 20px;
    }
    
    .ypw-checkbox-text {
        font-size: 1em;
    }
    
    .ypw-product-qty input[type="number"],
    .ypw-qty-input {
        width: 100%;
        max-width: 150px;
        font-size: 16px;
        padding: 10px;
    }
    
    /* Bouton d'ajout mobile */
    .ypw-add-to-cart {
        width: 100%;
        padding: 12px 20px;
        font-size: 1em;
        margin-top: 5px;
    }
    
    .ypw-product-action {
        padding-top: 10px !important;
    }
    
    /* Message de bienvenue mobile */
    .ypw-welcome-message {
        padding: 15px;
        margin: 0 -15px 20px;
        border-radius: 0;
    }
    
    .ypw-welcome-message strong {
        font-size: 1.1em;
    }
}

/* Très petits écrans */
@media (max-width: 480px) {
    .ypw-category-toggle {
        padding: 12px 10px;
        font-size: 0.95em;
    }
    
    .ypw-products-table tbody tr {
        padding: 12px;
        margin-bottom: 12px;
    }
    
    .ypw-product-name strong {
        font-size: 1em;
    }
    
    .ypw-product-price {
        font-size: 1.1em;
    }
}

/* Styles pour le panier WooCommerce natif */
.woocommerce-cart .ypw-prep-info,
.woocommerce-checkout .ypw-prep-info {
    display: block;
    color: #6b7280;
    font-size: 0.9em;
    margin-top: 5px;
}

/* Page de paiement personnalisée */
.woocommerce-checkout .ypw-checkout-header {
    background: #f0f9ff;
    border-left: 4px solid #0c4a6e;
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 4px;
}

.woocommerce-checkout .ypw-checkout-header h3 {
    margin: 0 0 10px 0;
    color: #0c4a6e;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.ypw-product-row {
    animation: fadeIn 0.3s ease;
}

/* Badges et labels */
.ypw-badge {
    display: inline-block;
    padding: 4px 8px;
    background: #0369a1;
    color: white;
    border-radius: 3px;
    font-size: 0.85em;
    font-weight: 600;
    margin-left: 5px;
}

.ypw-badge.new {
    background: #10b981;
}

.ypw-badge.promo {
    background: #f59e0b;
}

