/*
 * WooCommerce Custom Styles for Recambios Gandia
 * Matches the visual style of the Netlify site
 */

/* ===== PRODUCT ARCHIVE (SHOP) ===== */
.woocommerce .products {
    display: grid !important;
    grid-template-columns: repeat(4, 1fr);
    gap: 2rem;
}

@media (max-width: 1024px) {
    .woocommerce .products {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .woocommerce .products {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .woocommerce .products {
        grid-template-columns: 1fr;
    }
}

.woocommerce ul.products li.product {
    background: #fff;
    border: 1px solid #f1f5f9;
    border-radius: 1rem;
    overflow: hidden;
    transition: all 0.3s ease;
    padding: 0 !important;
    margin: 0 !important;
    width: 100% !important;
    float: none !important;
}

.woocommerce ul.products li.product:hover {
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    transform: translateY(-4px);
}

.woocommerce ul.products li.product a img {
    border-radius: 0 !important;
    margin: 0 !important;
    width: 100%;
    height: auto;
    aspect-ratio: 4/3;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.woocommerce ul.products li.product:hover a img {
    transform: scale(1.05);
}

.woocommerce ul.products li.product .woocommerce-loop-product__title {
    font-size: 1rem !important;
    font-weight: 500;
    color: #0f172a;
    padding: 0.75rem 1.25rem 0 !important;
    line-height: 1.4;
}

.woocommerce ul.products li.product .price {
    color: #0f172a !important;
    font-weight: 700;
    font-size: 1.25rem !important;
    padding: 0.5rem 1.25rem !important;
}

.woocommerce ul.products li.product .price del {
    opacity: 0.5;
    font-size: 0.875rem;
}

.woocommerce ul.products li.product .price ins {
    text-decoration: none;
    color: #dc2626;
}

/* Stock badge */
.woocommerce ul.products li.product .stock-badge {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 500;
    color: #059669;
    background: #ecfdf5;
    padding: 0.25rem 0.5rem;
    border-radius: 0.375rem;
    margin: 0 1.25rem 0.75rem;
}

/* Add to cart button in shop */
.woocommerce ul.products li.product .button {
    display: block !important;
    background-color: #dc2626 !important;
    color: white !important;
    border-radius: 9999px !important;
    font-weight: 700 !important;
    padding: 0.75rem 1.5rem !important;
    border: none !important;
    transition: all 0.3s ease !important;
    text-transform: none !important;
    font-size: 0.875rem !important;
    text-align: center;
    margin: 0.75rem 1.25rem 1.25rem !important;
    width: calc(100% - 2.5rem) !important;
}

.woocommerce ul.products li.product .button:hover {
    background-color: #ef4444 !important;
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.4) !important;
}

/* ===== SALE BADGE ===== */
.woocommerce span.onsale {
    background-color: #dc2626 !important;
    border-radius: 9999px !important;
    font-weight: 700;
    min-height: auto !important;
    min-width: auto !important;
    padding: 0.5rem 1rem !important;
    line-height: 1.5;
    font-size: 0.75rem;
    z-index: 10;
}

/* ===== SINGLE PRODUCT ===== */
.woocommerce div.product {
    max-width: 1280px;
    margin: 0 auto;
}

.woocommerce div.product div.images {
    width: 55% !important;
}

.woocommerce div.product div.images img {
    border-radius: 1.5rem !important;
}

.woocommerce div.product div.summary {
    width: 40% !important;
}

@media (max-width: 768px) {
    .woocommerce div.product div.images,
    .woocommerce div.product div.summary {
        width: 100% !important;
    }
}

.woocommerce div.product .product_title {
    font-size: 2rem;
    font-weight: 900;
    color: #0f172a;
    letter-spacing: -0.025em;
    line-height: 1.2;
}

.woocommerce div.product .price {
    font-size: 1.75rem !important;
    font-weight: 700;
    color: #0f172a;
}

.woocommerce div.product .woocommerce-product-details__short-description {
    color: #475569;
    font-size: 1rem;
    line-height: 1.75;
}

/* Single product add to cart */
.woocommerce div.product form.cart .button {
    background-color: #dc2626 !important;
    color: white !important;
    border-radius: 9999px !important;
    font-weight: 700 !important;
    padding: 1rem 2rem !important;
    border: none !important;
    transition: all 0.3s ease !important;
    text-transform: none !important;
    font-size: 1rem !important;
}

.woocommerce div.product form.cart .button:hover {
    background-color: #ef4444 !important;
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.4) !important;
    transform: translateY(-2px);
}

.woocommerce div.product form.cart .quantity .qty {
    border-radius: 0.75rem !important;
    border: 2px solid #e2e8f0 !important;
    padding: 0.75rem !important;
    width: 5rem;
    text-align: center;
    font-weight: 600;
}

/* Product tabs */
.woocommerce div.product .woocommerce-tabs {
    margin-top: 3rem;
}

.woocommerce div.product .woocommerce-tabs ul.tabs {
    border-bottom: 2px solid #f1f5f9 !important;
    padding: 0 !important;
    margin-bottom: 2rem !important;
}

.woocommerce div.product .woocommerce-tabs ul.tabs li {
    border: none !important;
    background: none !important;
    border-radius: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
}

.woocommerce div.product .woocommerce-tabs ul.tabs li a {
    font-weight: 600;
    color: #64748b;
    padding: 1rem 1.5rem !important;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: all 0.3s;
}

.woocommerce div.product .woocommerce-tabs ul.tabs li.active a {
    color: #dc2626;
    border-bottom-color: #dc2626;
}

.woocommerce div.product .woocommerce-tabs ul.tabs li a:hover {
    color: #0f172a;
}

/* Related products */
.woocommerce div.product .related.products h2 {
    font-size: 1.75rem;
    font-weight: 900;
    color: #0f172a;
    margin-bottom: 1.5rem;
}

/* ===== CART ===== */
.woocommerce-cart table.cart {
    border-radius: 1.5rem !important;
    overflow: hidden;
    border: 1px solid #f1f5f9 !important;
}

.woocommerce table.shop_table {
    border: 1px solid #f1f5f9 !important;
    border-radius: 1.5rem !important;
    overflow: hidden;
}

.woocommerce table.shop_table th {
    background: #f8fafc !important;
    font-weight: 700;
    color: #0f172a;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
    padding: 1rem 1.5rem !important;
}

.woocommerce table.shop_table td {
    border-top: 1px solid #f1f5f9 !important;
    padding: 1rem 1.5rem !important;
    vertical-align: middle;
}

.woocommerce table.shop_table td.product-name a {
    color: #0f172a;
    font-weight: 600;
    text-decoration: none;
}

.woocommerce table.shop_table td.product-name a:hover {
    color: #dc2626;
}

.woocommerce .cart-collaterals .cart_totals {
    border-radius: 1.5rem;
    overflow: hidden;
    border: 1px solid #f1f5f9;
}

.woocommerce .wc-proceed-to-checkout a.checkout-button {
    background-color: #dc2626 !important;
    color: white !important;
    border-radius: 9999px !important;
    font-weight: 700 !important;
    padding: 1rem 2rem !important;
    font-size: 1rem !important;
    transition: all 0.3s ease !important;
}

.woocommerce .wc-proceed-to-checkout a.checkout-button:hover {
    background-color: #ef4444 !important;
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.4) !important;
}

/* ===== CHECKOUT ===== */
.woocommerce-checkout #payment {
    background: #f8fafc !important;
    border-radius: 1.5rem !important;
    border: 1px solid #f1f5f9 !important;
    padding: 2rem !important;
}

.woocommerce form .form-row label {
    font-weight: 600;
    color: #0f172a;
    font-size: 0.875rem;
}

.woocommerce form .form-row input.input-text,
.woocommerce form .form-row textarea,
.woocommerce form .form-row select {
    border: 2px solid #e2e8f0 !important;
    border-radius: 0.75rem !important;
    padding: 0.75rem 1rem !important;
    font-size: 0.875rem;
    transition: border-color 0.3s ease;
}

.woocommerce form .form-row input.input-text:focus,
.woocommerce form .form-row textarea:focus,
.woocommerce form .form-row select:focus {
    border-color: #dc2626 !important;
    outline: none;
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1);
}

.woocommerce #place_order {
    background-color: #dc2626 !important;
    color: white !important;
    border-radius: 9999px !important;
    font-weight: 700 !important;
    padding: 1rem 2rem !important;
    font-size: 1.125rem !important;
    transition: all 0.3s ease !important;
    width: 100%;
}

.woocommerce #place_order:hover {
    background-color: #ef4444 !important;
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.4) !important;
}

/* ===== MY ACCOUNT ===== */
.woocommerce-account .woocommerce-MyAccount-navigation {
    background: #f8fafc;
    border-radius: 1.5rem;
    padding: 1.5rem;
    border: 1px solid #f1f5f9;
}

.woocommerce-account .woocommerce-MyAccount-navigation ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.woocommerce-account .woocommerce-MyAccount-navigation ul li a {
    display: block;
    padding: 0.75rem 1rem;
    color: #475569;
    font-weight: 500;
    border-radius: 0.75rem;
    transition: all 0.2s;
    text-decoration: none;
}

.woocommerce-account .woocommerce-MyAccount-navigation ul li a:hover,
.woocommerce-account .woocommerce-MyAccount-navigation ul li.is-active a {
    background: #dc2626;
    color: white;
}

/* ===== MESSAGES ===== */
.woocommerce-message,
.woocommerce-info {
    border-top-color: #dc2626 !important;
    background: #fef2f2 !important;
    border-radius: 1rem !important;
    padding: 1rem 1.5rem !important;
}

.woocommerce-message::before,
.woocommerce-info::before {
    color: #dc2626 !important;
}

.woocommerce-error {
    border-top-color: #dc2626 !important;
    border-radius: 1rem !important;
}

/* ===== BREADCRUMBS ===== */
.woocommerce .woocommerce-breadcrumb {
    color: #64748b;
    font-size: 0.875rem;
    margin-bottom: 2rem;
    padding: 0.75rem 0;
}

.woocommerce .woocommerce-breadcrumb a {
    color: #dc2626;
    text-decoration: none;
    font-weight: 500;
}

.woocommerce .woocommerce-breadcrumb a:hover {
    text-decoration: underline;
}

/* ===== STAR RATING ===== */
.woocommerce .star-rating span::before {
    color: #ef4444 !important;
}

/* ===== PAGINATION ===== */
.woocommerce nav.woocommerce-pagination ul {
    border: none !important;
}

.woocommerce nav.woocommerce-pagination ul li {
    border: none !important;
}

.woocommerce nav.woocommerce-pagination ul li a,
.woocommerce nav.woocommerce-pagination ul li span {
    border: none !important;
    border-radius: 9999px !important;
    padding: 0.5rem 1rem !important;
    font-weight: 600;
    color: #475569;
    transition: all 0.2s;
}

.woocommerce nav.woocommerce-pagination ul li a:hover {
    background: #fef2f2 !important;
    color: #dc2626 !important;
}

.woocommerce nav.woocommerce-pagination ul li span.current {
    background: #dc2626 !important;
    color: white !important;
}

/* ===== WIDGETS ===== */
.woocommerce .widget_price_filter .price_slider_wrapper .ui-widget-content {
    background: #e2e8f0;
    border-radius: 9999px;
}

.woocommerce .widget_price_filter .ui-slider .ui-slider-handle {
    background: #dc2626 !important;
    border: 2px solid white !important;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.woocommerce .widget_price_filter .ui-slider .ui-slider-range {
    background: #dc2626 !important;
}

/* ===== RESULTS COUNT & ORDERING ===== */
.woocommerce .woocommerce-result-count {
    color: #64748b;
    font-size: 0.875rem;
}

.woocommerce .woocommerce-ordering select {
    border: 2px solid #e2e8f0;
    border-radius: 0.75rem;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    color: #0f172a;
    background: white;
}

/* ===== MINI CART WIDGET ===== */
.widget_shopping_cart .total {
    border-top: 2px solid #f1f5f9;
    padding-top: 1rem;
    margin-top: 1rem;
}

.widget_shopping_cart .total strong {
    color: #0f172a;
}

.widget_shopping_cart .buttons a {
    border-radius: 9999px !important;
    font-weight: 700 !important;
}

/* ===== EMPTY CART ===== */
.woocommerce-cart .cart-empty {
    text-align: center;
    font-size: 1.125rem;
    color: #64748b;
    padding: 3rem 0;
}

.woocommerce-cart .return-to-shop a {
    background-color: #dc2626 !important;
    color: white !important;
    border-radius: 9999px !important;
    font-weight: 700 !important;
    padding: 1rem 2rem !important;
}
