/* Warwick Promo Frontend Styles */

.warwick-promo-form-wrapper {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    border: 1px solid #e9ecef;
}

.warwick-promo-form-wrapper h3 {
    margin: 0 0 15px 0;
    font-size: 16px;
    color: #333;
}

.warwick-promo-input-wrapper {
    display: flex;
    gap: 10px;
}

.warwick-promo-input-wrapper input {
    flex: 1;
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    text-transform: uppercase;
}

.warwick-promo-input-wrapper input:focus {
    outline: none;
    border-color: #2271b1;
    box-shadow: 0 0 0 1px #2271b1;
}

.warwick-promo-input-wrapper button,
.warwick-promo-applied button {
    padding: 10px 20px;
    background: #2271b1;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: background 0.2s;
}

.warwick-promo-input-wrapper button:hover {
    background: #135e96;
}

.warwick-promo-applied {
    display: flex;
    align-items: center;
    gap: 15px;
}

.promo-code-badge {
    display: inline-block;
    padding: 8px 15px;
    background: #d4edda;
    color: #155724;
    border-radius: 20px;
    font-weight: 600;
    font-size: 14px;
    letter-spacing: 0.5px;
}

.warwick-promo-applied button {
    background: #dc3545;
    padding: 8px 15px;
}

.warwick-promo-applied button:hover {
    background: #c82333;
}

.warwick-promo-message {
    margin-top: 10px;
    padding: 10px 15px;
    border-radius: 4px;
    font-size: 14px;
}

.warwick-promo-message.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.warwick-promo-message.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Ligne de réduction dans le panier */
.cart-discount .woocommerce-Price-amount,
.order-total .woocommerce-Price-amount {
    font-weight: 600;
}

/* Ligne promo Warwick personnalisée */
.warwick-promo-row th {
    vertical-align: top;
    padding-top: 12px;
    padding-bottom: 12px;
}

.warwick-promo-row td {
    vertical-align: top;
    padding-top: 12px;
}

.warwick-promo-label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-weight: 600;
    color: #155724;
}

.warwick-promo-subtitle {
    display: block;
    margin-top: 4px;
    font-weight: normal;
    font-size: 12px;
    color: #666;
    font-style: italic;
}

/* Icône info avec tooltip */
.warwick-info-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    font-size: 14px;
    color: #2271b1;
    cursor: help;
    position: relative;
    font-style: normal;
}

.warwick-info-icon:hover {
    color: #135e96;
}

/* Tooltip */
.warwick-info-icon::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: #333;
    color: #fff;
    padding: 10px 14px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: normal;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s, visibility 0.2s;
    z-index: 1000;
    margin-bottom: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.warwick-info-icon::before {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: #333;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s, visibility 0.2s;
    z-index: 1001;
    margin-bottom: -4px;
}

.warwick-info-icon:hover::after,
.warwick-info-icon:hover::before {
    opacity: 1;
    visibility: visible;
}

/* Couleur de la réduction */
.warwick-promo-row td .woocommerce-Price-amount {
    color: #155724;
    font-weight: 600;
}

/* Lien voir détails */
.warwick-details-link {
    color: #2271b1;
    text-decoration: underline;
    cursor: pointer;
    font-weight: 500;
}

.warwick-details-link:hover {
    color: #135e96;
    text-decoration: none;
}

/* Responsive */
@media (max-width: 480px) {
    .warwick-promo-input-wrapper {
        flex-direction: column;
    }

    .warwick-promo-input-wrapper button {
        width: 100%;
    }

    .warwick-promo-applied {
        flex-direction: column;
        align-items: flex-start;
    }
}
