/**
 * ProLearners WooCommerce Styles
 *
 * Override default WooCommerce styles to match the theme.
 */

/* ===== Shop Page — Product Grid ===== */
.woocommerce ul.products {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
    list-style: none !important;
    padding: 0 !important;
    margin: 0 !important;
}

@media (min-width: 640px) {
    .woocommerce ul.products { gap: 1.5rem; }
}
@media (min-width: 1024px) {
    .woocommerce ul.products { grid-template-columns: repeat(3, 1fr); }
}
@media (min-width: 1280px) {
    .woocommerce ul.products { grid-template-columns: repeat(4, 1fr); }
}

.woocommerce ul.products li.product {
    float: none !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    list-style: none !important;
}

/* ── Result Count & Ordering ──────── */
.woocommerce .woocommerce-result-count {
    font-size: 0.875rem;
    color: #6b7280;
    margin: 0 0 1rem;
}

.woocommerce .woocommerce-ordering {
    margin: 0 0 1.5rem;
}

.woocommerce .woocommerce-ordering select {
    padding: 0.5rem 2rem 0.5rem 0.75rem;
    border: 1px solid #e5e7eb;
    border-radius: 0.75rem;
    font-size: 0.875rem;
    color: #374151;
    background-color: white;
    outline: none;
    cursor: pointer;
}

.woocommerce .woocommerce-ordering select:focus {
    border-color: #818cf8;
    box-shadow: 0 0 0 3px rgba(129, 140, 248, 0.1);
}

/* ===== Product Image ===== */
.woocommerce ul.products li.product img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.woocommerce ul.products li.product:hover img {
    transform: scale(1.05);
}

/* ===== Price ===== */
.woocommerce .price del { color: #9ca3af; font-size: 0.875rem; }
.woocommerce .price ins { text-decoration: none; font-weight: 700; }
.woocommerce .price .amount { color: #111827; font-weight: 700; }

/* ===== Single Product ===== */
.woocommerce div.product {
    max-width: 100%;
    margin: 0 auto;
}

.woocommerce div.product div.images {
    border-radius: 1rem;
    overflow: hidden;
    background-color: #f9fafb;
}

.woocommerce div.product div.images img {
    width: 100%;
    height: auto;
    object-fit: contain;
}

.woocommerce div.product div.images .flex-control-thumbs {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.75rem;
    list-style: none !important;
    padding: 0 !important;
}

.woocommerce div.product div.images .flex-control-thumbs li {
    width: 80px;
    height: 60px;
    border-radius: 0.5rem;
    overflow: hidden;
    border: 2px solid transparent;
    cursor: pointer;
    transition: border-color 0.2s;
    list-style: none !important;
}

.woocommerce div.product div.images .flex-control-thumbs li img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.woocommerce div.product div.images .flex-control-thumbs li:has(img.flex-active),
.woocommerce div.product div.images .flex-control-thumbs li:hover {
    border-color: #4f46e5;
}

.woocommerce div.product div.summary { margin-bottom: 2rem; }

.woocommerce div.product .product_title {
    font-size: 1.75rem;
    font-weight: 700;
    color: #111827;
    margin-bottom: 0.5rem;
    line-height: 1.3;
}

.woocommerce div.product p.price {
    color: #111827;
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.woocommerce div.product p.price del { color: #9ca3af; font-size: 1.125rem; }
.woocommerce div.product p.price ins { text-decoration: none; }

.woocommerce div.product .product_meta {
    font-size: 0.875rem;
    color: #6b7280;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #f3f4f6;
}

.woocommerce div.product .product_meta > span { display: block; margin-bottom: 0.25rem; }
.woocommerce div.product .product_meta a { color: #4f46e5; font-weight: 500; }
.woocommerce div.product .product_meta a:hover { color: #4338ca; }

/* ── Add to Cart Button ──────── */
.woocommerce div.product form.cart {
    margin-top: 1.5rem;
    margin-bottom: 2rem;
}

.woocommerce div.product form.cart .button {
    background-color: #4f46e5 !important;
    color: white !important;
    border-radius: 0.75rem !important;
    padding: 0.75rem 2rem !important;
    font-weight: 600 !important;
    font-size: 0.875rem !important;
    border: none !important;
    box-shadow: 0 10px 15px -3px rgba(79, 70, 229, 0.25) !important;
    transition: background-color 0.2s !important;
}

.woocommerce div.product form.cart .button:hover {
    background-color: #4338ca !important;
}

/* ── Tabs ──────── */
.woocommerce div.product .woocommerce-tabs { margin-top: 2rem; }

.woocommerce div.product .woocommerce-tabs ul.tabs {
    list-style: none;
    display: flex;
    gap: 0;
    padding: 0;
    margin: 0 0 1.5rem;
    border-bottom: 2px solid #f3f4f6;
}

.woocommerce div.product .woocommerce-tabs ul.tabs li { margin: 0; padding: 0; }

.woocommerce div.product .woocommerce-tabs ul.tabs li a {
    display: block;
    padding: 0.75rem 1.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: #6b7280;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: all 0.2s;
}

.woocommerce div.product .woocommerce-tabs ul.tabs li a:hover { color: #4f46e5; }

.woocommerce div.product .woocommerce-tabs ul.tabs li.active a {
    color: #4f46e5;
    border-bottom-color: #4f46e5;
    font-weight: 600;
}

/* ===== Cart ===== */
.woocommerce table.shop_table {
    border: 1px solid #f3f4f6;
    border-radius: 1rem;
    overflow: hidden;
    margin-bottom: 2rem;
}

.woocommerce table.shop_table th {
    background-color: #f9fafb;
    font-weight: 600;
    font-size: 0.875rem;
    color: #374151;
    padding: 1rem;
    border-bottom: 1px solid #f3f4f6;
}

.woocommerce table.shop_table td {
    padding: 1rem;
    border-bottom: 1px solid #f3f4f6;
    font-size: 0.875rem;
    color: #374151;
    vertical-align: middle;
}

.woocommerce .cart-collaterals .cart_totals {
    border: 1px solid #f3f4f6;
    border-radius: 1rem;
    padding: 1.5rem;
    background-color: #f9fafb;
}

/* ===== Checkout ===== */
.woocommerce form.checkout {
    max-width: 900px;
    margin: 0 auto;
}

.woocommerce form .form-row label {
    font-size: 0.875rem;
    font-weight: 500;
    color: #374151;
    margin-bottom: 0.25rem;
}

.woocommerce form .form-row input.input-text,
.woocommerce form .form-row textarea,
.woocommerce form .form-row select,
.woocommerce-page form .form-row input.input-text,
.woocommerce-page form .form-row textarea,
.woocommerce-page form .form-row select {
    width: 100%;
    padding: 0.625rem 0.875rem;
    border: 1px solid #e5e7eb;
    border-radius: 0.75rem;
    font-size: 0.875rem;
    outline: none;
    transition: border-color 0.2s;
}

.woocommerce form .form-row input.input-text:focus,
.woocommerce form .form-row textarea:focus,
.woocommerce form .form-row select:focus {
    border-color: #818cf8;
    box-shadow: 0 0 0 3px rgba(129, 140, 248, 0.1);
}

.woocommerce #order_review {
    background-color: #f9fafb;
    border: 1px solid #f3f4f6;
    border-radius: 1rem;
    padding: 1.5rem;
}

.woocommerce #place_order {
    background-color: #4f46e5 !important;
    color: white !important;
    border-radius: 0.75rem !important;
    padding: 0.875rem 2rem !important;
    font-weight: 600 !important;
    font-size: 1rem !important;
    width: 100% !important;
    border: none !important;
    box-shadow: 0 10px 15px -3px rgba(79, 70, 229, 0.25) !important;
    transition: background-color 0.2s !important;
}

.woocommerce #place_order:hover {
    background-color: #4338ca !important;
}

/* ===== Notices ===== */
.woocommerce .woocommerce-message,
.woocommerce .woocommerce-info,
.woocommerce .woocommerce-error {
    border-radius: 0.75rem;
    padding: 1rem 1.5rem;
    margin-bottom: 1.5rem;
    font-size: 0.875rem;
}

.woocommerce .woocommerce-message {
    background-color: #ecfdf5;
    border-left: 4px solid #10b981;
    color: #065f46;
}

.woocommerce .woocommerce-info {
    background-color: #eff6ff;
    border-left: 4px solid #3b82f6;
    color: #1e40af;
}

.woocommerce .woocommerce-error {
    background-color: #fef2f2;
    border-left: 4px solid #ef4444;
    color: #991b1b;
}

.woocommerce .woocommerce-message a.button,
.woocommerce .woocommerce-info a.button {
    background-color: #4f46e5;
    color: white;
    border-radius: 0.5rem;
    padding: 0.375rem 1rem;
    font-size: 0.8125rem;
    font-weight: 600;
    border: none;
    float: right;
}

/* ===== My Account ===== */
.woocommerce-account .woocommerce-MyAccount-navigation { margin-bottom: 2rem; }

.woocommerce-account .woocommerce-MyAccount-navigation ul {
    list-style: none;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    border-bottom: 2px solid #f3f4f6;
    padding-bottom: 0.5rem;
}

.woocommerce-account .woocommerce-MyAccount-navigation ul li a {
    display: block;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: #6b7280;
    border-radius: 0.5rem;
    transition: all 0.2s;
}

.woocommerce-account .woocommerce-MyAccount-navigation ul li a:hover {
    color: #4f46e5;
    background-color: #eef2ff;
}

.woocommerce-account .woocommerce-MyAccount-navigation ul li.is-active a {
    color: #4f46e5;
    background-color: #eef2ff;
    font-weight: 600;
}

/* ===== Global WC Buttons ===== */
.woocommerce a.button,
.woocommerce button.button,
.woocommerce input.button,
.woocommerce #respond input#submit,
.woocommerce a.button.alt,
.woocommerce button.button.alt,
.woocommerce input.button.alt,
.woocommerce #payment #place_order {
    background-color: #4f46e5 !important;
    color: #fff !important;
    border: none !important;
    border-radius: 0.75rem !important;
    padding: 0.75rem 1.5rem !important;
    font-size: 0.875rem !important;
    font-weight: 600 !important;
    cursor: pointer;
    transition: background-color 0.2s !important;
    box-shadow: 0 10px 15px -3px rgba(79, 70, 229, 0.25) !important;
    text-decoration: none;
    display: inline-block;
    line-height: 1.5;
}

.woocommerce a.button:hover,
.woocommerce button.button:hover,
.woocommerce input.button:hover,
.woocommerce a.button.alt:hover,
.woocommerce button.button.alt:hover,
.woocommerce input.button.alt:hover {
    background-color: #4338ca !important;
}

.woocommerce a.button.cancel,
.woocommerce button.button.cancel {
    background-color: #fff !important;
    color: #374151 !important;
    border: 1px solid #e5e7eb !important;
    box-shadow: none !important;
}

.woocommerce a.button.cancel:hover,
.woocommerce button.button.cancel:hover {
    background-color: #f9fafb !important;
    border-color: #d1d5db !important;
}

/* ===== Order Pay / Order Received ===== */
.woocommerce-order-pay .woocommerce,
.woocommerce-order-received .woocommerce {
    max-width: 640px;
    margin: 0 auto;
}

.woocommerce-order-pay .woocommerce ul,
.woocommerce-order-received .woocommerce ul {
    list-style: none;
    padding: 0;
    margin: 0 0 1.5rem 0;
}

.woocommerce-order-pay .woocommerce ul li,
.woocommerce-order-received .woocommerce ul li {
    padding: 0.625rem 0;
    border-bottom: 1px solid #f3f4f6;
    font-size: 0.875rem;
    color: #374151;
}

.woocommerce-order-pay .woocommerce h2,
.woocommerce-order-received .woocommerce h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #111827;
    margin-bottom: 1rem;
}

/* ===== WC Tables ===== */
.woocommerce table.woocommerce-table--order-details,
.woocommerce table.woocommerce-orders-table {
    border: 1px solid #f3f4f6;
    border-radius: 1rem;
    overflow: hidden;
    width: 100%;
    border-collapse: collapse;
}

.woocommerce table.woocommerce-table--order-details th,
.woocommerce table.woocommerce-orders-table th {
    background-color: #f9fafb;
    font-weight: 600;
    font-size: 0.875rem;
    color: #374151;
    padding: 0.75rem 1rem;
    text-align: left;
}

.woocommerce table.woocommerce-table--order-details td,
.woocommerce table.woocommerce-orders-table td {
    padding: 0.75rem 1rem;
    border-top: 1px solid #f3f4f6;
    font-size: 0.875rem;
    color: #374151;
}

/* ===== Razorpay ===== */
.woocommerce #razorpay-payment-button,
.woocommerce .razorpay-payment-btn {
    background-color: #4f46e5 !important;
    color: #fff !important;
    border: none !important;
    border-radius: 0.75rem !important;
    padding: 0.875rem 2rem !important;
    font-weight: 600 !important;
    font-size: 1rem !important;
    cursor: pointer;
    width: 100% !important;
    box-shadow: 0 10px 15px -3px rgba(79, 70, 229, 0.25) !important;
    transition: background-color 0.2s !important;
}

.woocommerce #razorpay-payment-button:hover,
.woocommerce .razorpay-payment-btn:hover {
    background-color: #4338ca !important;
}

/* ===== Star Rating & Badges ===== */
.woocommerce .star-rating { color: #f59e0b; }
.woocommerce span.onsale { display: none; /* custom badge used */ }

/* ===== Quantity Input ===== */
.woocommerce .quantity .qty {
    width: 4rem;
    padding: 0.5rem;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    text-align: center;
    font-size: 0.875rem;
}

/* ===== Breadcrumbs ===== */
.woocommerce .woocommerce-breadcrumb {
    font-size: 0.875rem;
    color: #6b7280;
    margin-bottom: 1.5rem;
}

.woocommerce .woocommerce-breadcrumb a {
    color: #4f46e5;
    font-weight: 500;
    transition: color 0.2s;
}

.woocommerce .woocommerce-breadcrumb a:hover { color: #4338ca; }

/* ===== Related Products ===== */
.woocommerce div.product .related.products {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid #f3f4f6;
}

.woocommerce div.product .related.products > h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #111827;
    margin-bottom: 1.5rem;
}

/* ===== WC Pagination ===== */
.woocommerce nav.woocommerce-pagination { margin-top: 2rem; text-align: center; }

.woocommerce nav.woocommerce-pagination ul {
    display: inline-flex;
    gap: 0.25rem;
    border: none;
    list-style: none !important;
    padding: 0 !important;
}

.woocommerce nav.woocommerce-pagination ul li {
    border: none;
    list-style: none !important;
}

.woocommerce nav.woocommerce-pagination ul li a,
.woocommerce nav.woocommerce-pagination ul li span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.5rem;
    height: 2.5rem;
    padding: 0 0.75rem;
    border-radius: 0.75rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: #4b5563;
    background-color: white;
    border: 1px solid #e5e7eb;
    transition: all 0.2s;
}

.woocommerce nav.woocommerce-pagination ul li a:hover {
    border-color: #818cf8;
    color: #4f46e5;
    background-color: #eef2ff;
}

.woocommerce nav.woocommerce-pagination ul li span.current {
    background-color: #4f46e5;
    color: white;
    border-color: #4f46e5;
}

/* ===== Responsive ===== */
@media (max-width: 767px) {
    .woocommerce table.shop_table_responsive thead { display: none; }

    .woocommerce table.shop_table_responsive tbody td {
        display: block;
        text-align: right;
        padding: 0.75rem 1rem;
    }

    .woocommerce table.shop_table_responsive tbody td::before {
        content: attr(data-title) ": ";
        font-weight: 600;
        float: left;
    }
}
