/**
 * Starter Theme - WooCommerce Styles
 *
 * @package Starter_Theme
 */

/* ==========================================================================
   General WooCommerce
   ========================================================================== */
.woocommerce-content-area {
    padding: var(--starter-spacing-2xl) 0;
}

.woocommerce-page .site-content {
    min-height: calc(100vh - var(--starter-header-height) - 300px);
}

/* ==========================================================================
   Products Grid
   ========================================================================== */
.woocommerce ul.products {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: var(--starter-spacing-lg);
    list-style: none;
    padding: 0;
    margin: 0;
}

.woocommerce ul.products li.product {
    background: var(--starter-card-bg);
    border: 1px solid var(--starter-border);
    border-radius: var(--starter-radius-lg);
    overflow: hidden;
    transition: var(--starter-transition);
    margin: 0;
    padding: 0;
    float: none;
    width: auto;
}

.woocommerce ul.products li.product:hover {
    transform: translateY(-5px);
    box-shadow: var(--starter-shadow-xl);
    border-color: var(--starter-primary);
}

/* Product Image */
.woocommerce ul.products li.product .woocommerce-loop-product__link {
    display: block;
    text-decoration: none;
}

.woocommerce ul.products li.product img {
    width: 100%;
    height: auto;
    aspect-ratio: 1;
    object-fit: cover;
    margin: 0;
}

/* Product Title */
.woocommerce ul.products li.product .woocommerce-loop-product__title {
    font-size: var(--starter-font-size-lg);
    font-weight: 600;
    color: var(--starter-text);
    padding: var(--starter-spacing-sm);
    padding-bottom: 0;
    margin: 0;
}

/* Product Price */
.woocommerce ul.products li.product .price {
    padding: var(--starter-spacing-xs) var(--starter-spacing-sm);
    font-size: var(--starter-font-size-xl);
    font-weight: 700;
    color: var(--starter-primary);
}

.woocommerce ul.products li.product .price del {
    color: rgba(255, 255, 255, 0.5);
    font-size: var(--starter-font-size-sm);
    font-weight: 400;
}

.woocommerce ul.products li.product .price ins {
    text-decoration: none;
}

/* Sale Badge */
.woocommerce span.onsale,
.sale-badge {
    position: absolute;
    top: var(--starter-spacing-sm);
    left: var(--starter-spacing-sm);
    background: var(--starter-accent);
    color: #fff;
    font-size: var(--starter-font-size-sm);
    font-weight: 700;
    padding: 0.25rem 0.75rem;
    border-radius: var(--starter-radius-full);
    z-index: 2;
}

/* Add to Cart Button */
.woocommerce ul.products li.product .button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--starter-spacing-xs);
    width: calc(100% - var(--starter-spacing-sm) * 2);
    margin: var(--starter-spacing-sm);
    margin-top: 0;
    padding: 0.75rem;
    background: linear-gradient(135deg, var(--starter-primary), var(--starter-secondary));
    color: #fff;
    border: none;
    border-radius: var(--starter-radius);
    font-weight: 600;
    cursor: pointer;
    transition: var(--starter-transition);
}

.woocommerce ul.products li.product .button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 102, 204, 0.4);
}

.woocommerce ul.products li.product .added_to_cart {
    display: none;
}

/* ==========================================================================
   Single Product
   ========================================================================== */
.woocommerce div.product {
    background: var(--starter-card-bg);
    border: 1px solid var(--starter-border);
    border-radius: var(--starter-radius-lg);
    padding: var(--starter-spacing-xl);
}

.woocommerce div.product div.images {
    width: 50%;
    float: left;
}

.woocommerce div.product div.summary {
    width: 45%;
    float: right;
}

.woocommerce div.product .product_title {
    font-size: var(--starter-font-size-3xl);
    color: var(--starter-text);
    margin-bottom: var(--starter-spacing-md);
}

.woocommerce div.product p.price {
    font-size: var(--starter-font-size-2xl);
    color: var(--starter-primary);
    font-weight: 700;
}

.woocommerce div.product .woocommerce-product-details__short-description {
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: var(--starter-spacing-lg);
}

/* Add to Cart Form */
.woocommerce div.product form.cart {
    margin-bottom: var(--starter-spacing-lg);
}

.woocommerce div.product form.cart .quantity {
    margin-right: var(--starter-spacing-sm);
}

.woocommerce .quantity .qty {
    width: 80px;
    padding: 0.75rem;
    text-align: center;
}

.woocommerce div.product form.cart .button {
    padding: 0.75rem 2rem;
    background: linear-gradient(135deg, var(--starter-primary), var(--starter-secondary));
    color: #fff;
    border: none;
    border-radius: var(--starter-radius);
    font-weight: 600;
    cursor: pointer;
    transition: var(--starter-transition);
}

.woocommerce div.product form.cart .button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 102, 204, 0.4);
}

/* Tabs */
.woocommerce div.product .woocommerce-tabs {
    clear: both;
    padding-top: var(--starter-spacing-xl);
}

.woocommerce div.product .woocommerce-tabs ul.tabs {
    list-style: none;
    display: flex;
    gap: var(--starter-spacing-xs);
    padding: 0;
    margin: 0 0 var(--starter-spacing-lg);
    border-bottom: 1px solid var(--starter-border);
}

.woocommerce div.product .woocommerce-tabs ul.tabs li {
    margin: 0;
    padding: 0;
    background: none;
    border: none;
}

.woocommerce div.product .woocommerce-tabs ul.tabs li a {
    display: block;
    padding: var(--starter-spacing-sm) var(--starter-spacing-md);
    color: rgba(255, 255, 255, 0.7);
    font-weight: 500;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
}

.woocommerce div.product .woocommerce-tabs ul.tabs li.active a {
    color: var(--starter-text);
    border-bottom-color: var(--starter-primary);
}

/* ==========================================================================
   Cart
   ========================================================================== */
.woocommerce-cart-form {
    background: var(--starter-card-bg);
    border: 1px solid var(--starter-border);
    border-radius: var(--starter-radius-lg);
    overflow: hidden;
}

.woocommerce table.shop_table {
    border: none;
    margin: 0;
}

.woocommerce table.shop_table th,
.woocommerce table.shop_table td {
    padding: var(--starter-spacing-md);
    border-color: var(--starter-border);
}

.woocommerce table.shop_table thead th {
    background: rgba(255, 255, 255, 0.03);
    color: var(--starter-text);
    font-weight: 600;
}

.woocommerce table.shop_table td {
    color: var(--starter-text);
}

.woocommerce table.shop_table td.product-name a {
    color: var(--starter-text);
    font-weight: 500;
}

.woocommerce table.shop_table td.product-remove a {
    color: var(--starter-accent) !important;
}

/* Cart Totals */
.woocommerce .cart-collaterals {
    margin-top: var(--starter-spacing-xl);
}

.woocommerce .cart_totals {
    background: var(--starter-card-bg);
    border: 1px solid var(--starter-border);
    border-radius: var(--starter-radius-lg);
    padding: var(--starter-spacing-xl);
}

.woocommerce .cart_totals h2 {
    color: var(--starter-text);
    margin-bottom: var(--starter-spacing-md);
}

.woocommerce .cart_totals .wc-proceed-to-checkout a.checkout-button {
    display: block;
    width: 100%;
    padding: 1rem;
    background: linear-gradient(135deg, var(--starter-primary), var(--starter-secondary));
    color: #fff;
    border-radius: var(--starter-radius);
    font-weight: 600;
    text-align: center;
}

/* ==========================================================================
   Checkout (apenas quando NÃO usa tuh-checkout plugin)
   ========================================================================== */
body:not(.tuh-checkout-page) .woocommerce-checkout {
    background: var(--starter-background);
}

body:not(.tuh-checkout-page) .woocommerce form.checkout {
    display: grid;
    grid-template-columns: 1fr 400px;
    gap: var(--starter-spacing-xl);
}

@media (max-width: 992px) {
    body:not(.tuh-checkout-page) .woocommerce form.checkout {
        grid-template-columns: 1fr;
    }
}

body:not(.tuh-checkout-page) .woocommerce-billing-fields,
body:not(.tuh-checkout-page) .woocommerce-shipping-fields {
    background: var(--starter-card-bg);
    border: 1px solid var(--starter-border);
    border-radius: var(--starter-radius-lg);
    padding: var(--starter-spacing-xl);
}

body:not(.tuh-checkout-page) .woocommerce-billing-fields h3,
body:not(.tuh-checkout-page) .woocommerce-shipping-fields h3 {
    color: var(--starter-text);
    margin-bottom: var(--starter-spacing-md);
}

body:not(.tuh-checkout-page) .woocommerce form .form-row label {
    color: var(--starter-text);
    font-weight: 500;
    margin-bottom: 0.5rem;
    display: block;
}

body:not(.tuh-checkout-page) .woocommerce form .form-row input.input-text,
body:not(.tuh-checkout-page) .woocommerce form .form-row textarea,
body:not(.tuh-checkout-page) .woocommerce form .form-row select {
    width: 100%;
    padding: 0.75rem 1rem;
    background: var(--starter-background);
    border: 1px solid var(--starter-border);
    border-radius: var(--starter-radius-sm);
    color: var(--starter-text);
}

body:not(.tuh-checkout-page) .woocommerce form .form-row input.input-text:focus,
body:not(.tuh-checkout-page) .woocommerce form .form-row textarea:focus {
    border-color: var(--starter-primary);
    outline: none;
}

/* Order Review (apenas quando NÃO usa tuh-checkout plugin) */
body:not(.tuh-checkout-page) #order_review_heading {
    display: none;
}

body:not(.tuh-checkout-page) .woocommerce-checkout-review-order {
    background: var(--starter-card-bg);
    border: 1px solid var(--starter-border);
    border-radius: var(--starter-radius-lg);
    padding: var(--starter-spacing-xl);
    position: sticky;
    top: calc(var(--starter-header-height) + 20px);
}

body:not(.tuh-checkout-page) .woocommerce-checkout-review-order-table {
    margin-bottom: var(--starter-spacing-lg);
}

body:not(.tuh-checkout-page) #place_order {
    width: 100%;
    padding: 1rem;
    background: linear-gradient(135deg, var(--starter-primary), var(--starter-secondary));
    color: #fff;
    border: none;
    border-radius: var(--starter-radius);
    font-size: var(--starter-font-size-lg);
    font-weight: 600;
    cursor: pointer;
    transition: var(--starter-transition);
}

body:not(.tuh-checkout-page) #place_order:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 102, 204, 0.4);
}

/* ==========================================================================
   Messages
   ========================================================================== */
.woocommerce-message,
.woocommerce-info,
.woocommerce-error {
    padding: var(--starter-spacing-md);
    margin-bottom: var(--starter-spacing-lg);
    border-radius: var(--starter-radius);
    border: none;
    background: var(--starter-card-bg);
}

.woocommerce-message {
    border-left: 4px solid #00a32a;
}

.woocommerce-info {
    border-left: 4px solid var(--starter-primary);
}

.woocommerce-error {
    border-left: 4px solid #d63638;
}

.woocommerce-message::before,
.woocommerce-info::before,
.woocommerce-error li::before {
    color: var(--starter-primary);
}

/* ==========================================================================
   My Account — tuh-account integration (full-width login)
   ========================================================================== */
/* Remove container constraints so tuh-account integrated wrapper can go full-width */
.woocommerce-account .content-area > .container {
    max-width: 100%;
    padding: 0;
}

/* Hide theme's entry-header (duplicate H1 — tuh-account renders its own) */
.woocommerce-account .entry-header {
    display: none;
}

/* ==========================================================================
   My Account (apenas quando NÃO usa tuh-account plugin)
   ========================================================================== */
/* Se tuh-account estiver ativo, ele controla o layout */
.woocommerce-account:not(:has(.tuh-account-wrapper)) .woocommerce-MyAccount-navigation {
    width: 250px;
    float: left;
}

.woocommerce-account:not(:has(.tuh-account-wrapper)) .woocommerce-MyAccount-content {
    width: calc(100% - 280px);
    float: right;
}

.woocommerce-account:not(:has(.tuh-account-wrapper)) .woocommerce-MyAccount-navigation ul {
    list-style: none;
    padding: 0;
    margin: 0;
    background: var(--starter-card-bg);
    border: 1px solid var(--starter-border);
    border-radius: var(--starter-radius-lg);
    overflow: hidden;
}

.woocommerce-account:not(:has(.tuh-account-wrapper)) .woocommerce-MyAccount-navigation ul li {
    margin: 0;
}

.woocommerce-account:not(:has(.tuh-account-wrapper)) .woocommerce-MyAccount-navigation ul li a {
    display: block;
    padding: var(--starter-spacing-sm) var(--starter-spacing-md);
    color: var(--starter-text);
    border-bottom: 1px solid var(--starter-border);
    transition: var(--starter-transition-fast);
}

.woocommerce-account:not(:has(.tuh-account-wrapper)) .woocommerce-MyAccount-navigation ul li:last-child a {
    border-bottom: none;
}

.woocommerce-account:not(:has(.tuh-account-wrapper)) .woocommerce-MyAccount-navigation ul li a:hover,
.woocommerce-account:not(:has(.tuh-account-wrapper)) .woocommerce-MyAccount-navigation ul li.is-active a {
    background: rgba(0, 102, 204, 0.1);
    color: var(--starter-primary);
}

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 768px) {
    .woocommerce div.product div.images,
    .woocommerce div.product div.summary {
        width: 100%;
        float: none;
    }

    .woocommerce div.product div.images {
        margin-bottom: var(--starter-spacing-lg);
    }

    .woocommerce-account:not(:has(.tuh-account-wrapper)) .woocommerce-MyAccount-navigation,
    .woocommerce-account:not(:has(.tuh-account-wrapper)) .woocommerce-MyAccount-content {
        width: 100%;
        float: none;
    }

    .woocommerce-account:not(:has(.tuh-account-wrapper)) .woocommerce-MyAccount-navigation {
        margin-bottom: var(--starter-spacing-lg);
    }
}
