/**
 * WooCommerce Custom Styles
 *
 * @package NCSONO
 */

/* ====================
   Page Produit
   ==================== */

/* Galerie d'images */
.woocommerce-product-gallery {
    position: relative;
}

.woocommerce-product-gallery__image img {
    display: block;
    width: 100%;
    height: auto;
}

/* Masquer l'icône de zoom WooCommerce par défaut */
.woocommerce-product-gallery__trigger,
.woocommerce-product-gallery__image a::before,
.woocommerce-product-gallery__image a::after {
    display: none !important;
}

.woocommerce-product-gallery__wrapper {
    position: relative;
}

/* Rating stars */
.woocommerce .star-rating {
    overflow: hidden;
    position: relative;
    height: 1em;
    line-height: 1;
    font-size: 1em;
    width: 5.4em;
    font-family: 'star';
    color: #5D3EF6;
}

.woocommerce .star-rating::before {
    content: "★★★★★";
    color: #ddd;
    float: left;
    top: 0;
    left: 0;
    position: absolute;
}

.woocommerce .star-rating span {
    overflow: hidden;
    float: left;
    top: 0;
    left: 0;
    position: absolute;
    padding-top: 1.5em;
}

.woocommerce .star-rating span::before {
    content: "★★★★★";
    top: 0;
    position: absolute;
    left: 0;
    color: #5D3EF6;
}

/* Product attributes / variations */
.woocommerce div.product form.cart .variations select {
    width: 100%;
}

/* Quantity input */
.woocommerce div.product form.cart div.quantity {
    margin: 0;
}

.woocommerce .quantity .qty {
    width: 5em;
    text-align: center;
}

/* Tabs */
.woocommerce div.product .woocommerce-tabs {
    margin-top: 0;
}

.woocommerce div.product .woocommerce-tabs ul.tabs {
    padding: 0;
    margin: 0 0 1.5em;
    list-style: none;
}

.woocommerce div.product .woocommerce-tabs ul.tabs li {
    border: 0;
    background-color: transparent;
    margin: 0;
    padding: 0;
}

.woocommerce div.product .woocommerce-tabs ul.tabs li a {
    text-decoration: none;
}

.woocommerce div.product .woocommerce-tabs .panel {
    margin: 0;
    padding: 0;
}

/* Reviews */
.woocommerce #reviews #comments ol.commentlist {
    list-style: none;
    margin: 0;
    padding: 0;
}

.woocommerce #reviews #comments ol.commentlist li {
    padding: 1.5em;
    margin-bottom: 1.5em;
    background-color: #f9fafb;
    border-radius: 10px;
    border: 1px solid #e5e7eb;
}

.woocommerce #reviews #comments ol.commentlist li:last-child {
    margin-bottom: 0;
}

.woocommerce #reviews #comments ol.commentlist li .comment-text {
    margin: 0 0 0 80px;
}

.woocommerce #reviews #comments ol.commentlist li img.avatar {
    float: left;
    width: 60px;
    height: auto;
    border-radius: 50%;
    border: 2px solid #e5e7eb;
}

.woocommerce #reviews #comments ol.commentlist li .meta {
    font-weight: 600;
    color: #000;
    margin-bottom: 0.5rem;
}

.woocommerce #reviews #comments ol.commentlist li .meta time {
    color: #737373;
    font-weight: normal;
    font-size: 0.9em;
}

.woocommerce #reviews #comments ol.commentlist li .description {
    color: #4b5563;
    line-height: 1.6;
}

.woocommerce #reviews h2 {
    font-size: 1.5rem;
    font-weight: bold;
    color: #000;
    margin-bottom: 1.5rem;
}

/* Review form */
.woocommerce #review_form #respond {
    margin: 2em 0;
    background-color: #f9fafb;
    padding: 2rem;
    border-radius: 10px;
    border: 1px solid #e5e7eb;
}

.woocommerce #review_form #respond p {
    margin-bottom: 1rem;
}

.woocommerce #review_form #respond label {
    display: block;
    font-weight: 600;
    color: #000;
    margin-bottom: 0.5rem;
}

.woocommerce #review_form #respond input[type="text"],
.woocommerce #review_form #respond input[type="email"],
.woocommerce #review_form #respond textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid #d1d5db;
    border-radius: 10px;
    background-color: #fff;
    color: #000;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.woocommerce #review_form #respond input[type="text"]:focus,
.woocommerce #review_form #respond input[type="email"]:focus,
.woocommerce #review_form #respond textarea:focus {
    outline: none;
    border-color: #5D3EF6;
}

.woocommerce #review_form #respond textarea {
    min-height: 150px;
    resize: vertical;
}

.woocommerce #review_form #respond .comment-form-rating {
    margin-bottom: 1rem;
}

.woocommerce #review_form #respond .comment-form-rating label {
    display: inline-block;
    margin-right: 1rem;
}

.woocommerce #review_form #respond .stars {
    display: inline-block;
}

.woocommerce #review_form #respond .stars a {
    color: #ddd;
    text-decoration: none;
    font-size: 1.5em;
    transition: color 0.2s;
}

.woocommerce #review_form #respond .stars a:hover,
.woocommerce #review_form #respond .stars a.active {
    color: #5D3EF6;
}

.woocommerce #review_form #respond .form-submit {
    margin-top: 1.5rem;
}

.woocommerce #review_form #respond .form-submit input {
    background-color: #5D3EF6;
    color: white;
    padding: 1rem 2rem;
    border-radius: 10px;
    border: none;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 6px rgba(93, 62, 246, 0.2);
}

.woocommerce #review_form #respond .form-submit input:hover {
    background-color: #4a2fce;
    box-shadow: 0 6px 8px rgba(93, 62, 246, 0.3);
    transform: translateY(-2px);
}

/* Product attributes table */
.woocommerce table.shop_attributes {
    border: 0;
    width: 100%;
}

.woocommerce table.shop_attributes th,
.woocommerce table.shop_attributes td {
    padding: 0.75rem;
    border-bottom: 1px solid #e5e5e5;
}

.woocommerce table.shop_attributes th {
    font-weight: 600;
    width: 150px;
}

/* Messages */
.woocommerce-message,
.woocommerce-info,
.woocommerce-error {
    padding: 1rem;
    margin-bottom: 1rem;
    border-radius: 10px;
}

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

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

/* Price */
.woocommerce div.product p.price,
.woocommerce div.product span.price {
    color: #000;
    font-weight: bold;
}

.woocommerce div.product p.price del,
.woocommerce div.product span.price del {
    color: #737373;
    opacity: 0.7;
}

.woocommerce div.product p.price ins,
.woocommerce div.product span.price ins {
    text-decoration: none;
    color: #5D3EF6;
}

/* Stock */
.woocommerce div.product .stock {
    color: #5D3EF6;
    font-weight: 600;
}

.woocommerce div.product .out-of-stock {
    color: #e2401c;
}

/* ====================
   Pagination
   ==================== */

/* Pagination container */
.woocommerce-pagination {
    margin: 2rem 0;
}

.woocommerce-pagination ul {
    display: flex;
    gap: 1rem;
    list-style: none;
    margin: 0;
    padding: 0;
    align-items: center;
    flex-wrap: wrap;
    justify-content: center;
}

.woocommerce-pagination ul li {
    margin: 0;
    padding: 0;
}

.woocommerce-pagination ul li a,
.woocommerce-pagination ul li span {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 2.5rem;
    height: 2.5rem;
    padding: 0.5rem;
    border-radius: 0.625rem; /* rounded-[10px] */
    font-weight: 600;
    transition: all 0.3s ease;
    text-decoration: none;
    font-size: 0.95rem;
}

/* Liens normaux */
.woocommerce-pagination ul li a {
    background-color: white;
    color: #1a1a1a; /* dark-500 */
    border: 2px solid #e5e7eb; /* gray-200 */
}

.woocommerce-pagination ul li a:hover {
    background-color: #5D3EF6; /* primary-500 */
    color: white;
    border-color: #5D3EF6;
    transform: translateY(-2px);
    box-shadow: 0 4px 6px -1px rgba(93, 62, 246, 0.2);
}

/* Page courante */
.woocommerce-pagination ul li span.current {
    background-color: #5D3EF6; /* primary-500 */
    color: white;
    border: 2px solid #5D3EF6;
    cursor: default;
    box-shadow: 0 4px 6px -1px rgba(93, 62, 246, 0.3);
}

/* Points de suspension */
.woocommerce-pagination ul li span.dots {
    background-color: transparent;
    color: #6b7280; /* gray-500 */
    border: none;
    cursor: default;
    min-width: auto;
}

/* Boutons précédent/suivant */
.woocommerce-pagination ul li a.prev,
.woocommerce-pagination ul li a.next {
    background-color: #1a1a1a; /* dark-500 */
    color: white;
    border-color: #1a1a1a;
}

.woocommerce-pagination ul li a.prev:hover,
.woocommerce-pagination ul li a.next:hover {
    background-color: #2d2d2d; /* dark-400 */
    border-color: #2d2d2d;
    transform: translateY(-2px);
}

/* SVG icons in pagination */
.woocommerce-pagination ul li a svg {
    width: 1.25rem;
    height: 1.25rem;
}

/* Responsive */
@media (max-width: 640px) {
    .woocommerce-pagination ul li a,
    .woocommerce-pagination ul li span {
        min-width: 2rem;
        height: 2rem;
        font-size: 0.875rem;
    }

    .woocommerce-pagination ul li a svg {
        width: 1rem;
        height: 1rem;
    }

    /* Espacement réduit sur mobile */
    .woocommerce-pagination ul {
        gap: 0.5rem;
    }
}

/* ====================
   Page Checkout
   ==================== */

/* Bouton Commander */
#place_order,
.woocommerce-checkout #place_order,
.wc-block-components-checkout-place-order-button,
.wc-block-checkout__actions_row .wc-block-components-button {
    background-color: #5D3EF6 !important; /* primary-500 */
    color: white !important;
    padding: 1rem 2rem !important;
    border-radius: 10px !important;
    border: 2px solid #DDDBEB !important; /* light-500 */
    font-weight: bold !important;
    font-size: 1rem !important;
    cursor: pointer;
    transition: all 0.3s ease !important;
    box-shadow: 0 4px 6px rgba(93, 62, 246, 0.3);
    width: 100%;
    text-transform: none !important;
    letter-spacing: normal !important;
}

#place_order:hover,
.woocommerce-checkout #place_order:hover,
.wc-block-components-checkout-place-order-button:hover,
.wc-block-checkout__actions_row .wc-block-components-button:hover {
    background-color: #4a2fce !important;
    color: white !important;
    border-color: #A8A8A8 !important; /* secondary-500 */
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(93, 62, 246, 0.4);
}

#place_order:focus,
.woocommerce-checkout #place_order:focus,
.wc-block-components-checkout-place-order-button:focus {
    outline: none !important;
    box-shadow: 0 0 0 3px rgba(93, 62, 246, 0.3) !important;
}

#place_order:disabled,
.woocommerce-checkout #place_order:disabled,
.wc-block-components-checkout-place-order-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Inputs et champs du checkout */
.woocommerce-checkout .form-row input.input-text,
.woocommerce-checkout .form-row select,
.woocommerce-checkout .form-row textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid #d1d5db;
    border-radius: 10px;
    background-color: #fff;
    color: #242428;
    font-size: 1rem;
    transition: border-color 0.3s, box-shadow 0.3s;
}

.woocommerce-checkout .form-row input.input-text:focus,
.woocommerce-checkout .form-row select:focus,
.woocommerce-checkout .form-row textarea:focus {
    outline: none;
    border-color: #5D3EF6;
    box-shadow: 0 0 0 3px rgba(93, 62, 246, 0.1);
}

/* Labels */
.woocommerce-checkout .form-row label {
    font-weight: 600;
    color: #242428;
    margin-bottom: 0.5rem;
    display: block;
}

/* Section titres */
.woocommerce-checkout h3 {
    font-size: 1.5rem;
    font-weight: bold;
    color: #242428;
    margin-bottom: 1.5rem;
}

/* Order review */
.woocommerce-checkout-review-order-table {
    width: 100%;
    border-collapse: collapse;
}

.woocommerce-checkout-review-order-table th,
.woocommerce-checkout-review-order-table td {
    padding: 0.75rem;
    border-bottom: 1px solid #e5e7eb;
    text-align: left;
}

.woocommerce-checkout-review-order-table .order-total th,
.woocommerce-checkout-review-order-table .order-total td {
    font-weight: bold;
    font-size: 1.1rem;
    color: #242428;
    border-bottom: none;
    padding-top: 1rem;
}

/* Payment methods */
.woocommerce-checkout #payment {
    background-color: #f9fafb;
    border-radius: 10px;
    padding: 1.5rem;
    margin-top: 1.5rem;
}

.woocommerce-checkout #payment ul.payment_methods {
    list-style: none;
    padding: 0;
    margin: 0 0 1.5rem 0;
}

.woocommerce-checkout #payment ul.payment_methods li {
    padding: 1rem;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    margin-bottom: 0.75rem;
    background-color: white;
    transition: border-color 0.3s;
}

.woocommerce-checkout #payment ul.payment_methods li:hover {
    border-color: #5D3EF6;
}

.woocommerce-checkout #payment ul.payment_methods li input[type="radio"] {
    margin-right: 0.75rem;
}

.woocommerce-checkout #payment ul.payment_methods li label {
    font-weight: 600;
    color: #242428;
    cursor: pointer;
}

.woocommerce-checkout #payment div.payment_box {
    padding: 1rem;
    background-color: #EEEDF8;
    border-radius: 8px;
    margin-top: 0.75rem;
    color: #242428;
    font-size: 0.9rem;
}

/* Privacy policy */
.woocommerce-checkout .woocommerce-privacy-policy-text {
    font-size: 0.85rem;
    color: #737373;
    margin-bottom: 1rem;
}

.woocommerce-checkout .woocommerce-privacy-policy-text a {
    color: #5D3EF6;
    text-decoration: underline;
}

.woocommerce-checkout .woocommerce-privacy-policy-text a:hover {
    color: #4a2fce;
}

/* ====================
   WooCommerce Blocks Checkout - Fix texte vertical
   ==================== */

/* Empêcher la compression de la sidebar */
.wp-block-woocommerce-checkout-order-summary-block,
.wc-block-components-sidebar {
    min-width: 280px !important;
    flex-shrink: 0 !important;
}

/* Fix pour les noms de produits qui s'affichent verticalement */
.wc-block-components-product-name {
    word-break: normal !important;
    overflow-wrap: anywhere !important;
    hyphens: auto !important;
}
