/**
 * WooCommerce Custom Styles
 *
 * @package Creative_Theme
 */

/* Product Loop */
.woocommerce ul.products {
    display: grid;
    grid-template-columns: repeat(1, 1fr);
    gap: 2rem;
}

@media (min-width: 768px) {
    .woocommerce ul.products {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .woocommerce ul.products {
        grid-template-columns: repeat(3, 1fr);
    }
}

.woocommerce ul.products li.product {
    margin: 0;
    padding: 0;
    width: 100%;
    float: none;
}

/* Ordering Dropdown */
.woocommerce-ordering select {
    padding: 0.5rem 2.5rem 0.5rem 1rem;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    background-color: #fff;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 0.5rem center;
    background-repeat: no-repeat;
    background-size: 1.5em 1.5em;
    appearance: none;
    cursor: pointer;
}

.woocommerce-ordering select:focus {
    outline: none;
    border-color: #4f46e5;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

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

.woocommerce-pagination ul li {
    margin: 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 0.75rem;
    border-radius: 9999px;
    border: 1px solid #e5e7eb;
    background: #fff;
    color: #374151;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s;
}

.woocommerce-pagination ul li a:hover {
    border-color: #4f46e5;
    color: #4f46e5;
}

.woocommerce-pagination ul li span.current {
    background: #4f46e5;
    border-color: #4f46e5;
    color: #fff;
}

/* Product Tabs */
.woocommerce-tabs {
    margin-top: 2rem;
}

.woocommerce-tabs ul.tabs {
    display: flex;
    gap: 2rem;
    border-bottom: 1px solid #e5e7eb;
    padding: 0;
    margin: 0 0 2rem 0;
    list-style: none;
}

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

.woocommerce-tabs ul.tabs li a {
    display: block;
    padding: 1rem 0;
    border-bottom: 2px solid transparent;
    color: #6b7280;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s;
}

.woocommerce-tabs ul.tabs li a:hover {
    color: #374151;
}

.woocommerce-tabs ul.tabs li.active a {
    border-bottom-color: #4f46e5;
    color: #4f46e5;
}

.woocommerce-tabs .panel {
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Cart Table */
.woocommerce-cart-form table {
    width: 100%;
    border-collapse: collapse;
}

.woocommerce-cart-form th,
.woocommerce-cart-form td {
    padding: 1rem;
    border-bottom: 1px solid #e5e7eb;
    text-align: left;
}

.woocommerce-cart-form th {
    font-weight: 600;
    color: #111827;
}

.woocommerce-cart-form .product-thumbnail img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 0.5rem;
}

.woocommerce-cart-form .product-name a {
    color: #111827;
    font-weight: 500;
    text-decoration: none;
}

.woocommerce-cart-form .product-name a:hover {
    color: #4f46e5;
}

/* Quantity Input */
.woocommerce .quantity {
    display: inline-flex;
    align-items: center;
}

.woocommerce .quantity input[type="number"] {
    width: 4rem;
    padding: 0.5rem;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    text-align: center;
    -moz-appearance: textfield;
}

.woocommerce .quantity input[type="number"]::-webkit-inner-spin-button,
.woocommerce .quantity input[type="number"]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* Checkout Form */
.woocommerce-checkout .form-row {
    margin-bottom: 1.5rem;
}

.woocommerce-checkout label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #374151;
}

.woocommerce-checkout input[type="text"],
.woocommerce-checkout input[type="email"],
.woocommerce-checkout input[type="tel"],
.woocommerce-checkout input[type="password"],
.woocommerce-checkout select,
.woocommerce-checkout textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    background: #fff;
    transition: all 0.2s;
}

.woocommerce-checkout input:focus,
.woocommerce-checkout select:focus,
.woocommerce-checkout textarea:focus {
    outline: none;
    border-color: #4f46e5;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

/* Place Order Button */
#place_order {
    width: 100%;
    padding: 1rem 2rem;
    background: linear-gradient(to right, #4f46e5, #c026d3);
    color: #fff;
    font-weight: 600;
    border: none;
    border-radius: 9999px;
    cursor: pointer;
    transition: all 0.3s;
}

#place_order:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px -5px rgba(79, 70, 229, 0.4);
}

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

.woocommerce-message {
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
    color: #065f46;
}

.woocommerce-info {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    color: #1e40af;
}

.woocommerce-error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #991b1b;
}

/* Star Rating */
.star-rating {
    display: inline-flex;
    overflow: hidden;
    position: relative;
    height: 1rem;
    font-size: 1rem;
    width: 5em;
    font-family: star;
}

.star-rating::before {
    content: "SSSSS";
    color: #e5e7eb;
    float: left;
    top: 0;
    left: 0;
    position: absolute;
}

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

.star-rating span::before {
    content: "SSSSS";
    color: #fbbf24;
    top: 0;
    position: absolute;
    left: 0;
}

/* Price Display */
.woocommerce .price {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
}

.woocommerce .price del {
    color: #9ca3af;
    font-size: 0.875rem;
}

.woocommerce .price ins {
    text-decoration: none;
    color: #111827;
    font-weight: 700;
}

/* Add to Cart Button */
.woocommerce button.single_add_to_cart_button {
    width: 100%;
    padding: 1rem 2rem;
    background: linear-gradient(to right, #4f46e5, #c026d3);
    color: #fff;
    font-weight: 600;
    border: none;
    border-radius: 9999px;
    cursor: pointer;
    transition: all 0.3s;
}

.woocommerce button.single_add_to_cart_button:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px -5px rgba(79, 70, 229, 0.4);
}

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

#reviews #comments ol.commentlist li.review {
    padding: 1.5rem;
    margin-bottom: 1rem;
    background: #f9fafb;
    border-radius: 1rem;
}

#reviews #comments ol.commentlist li.review .avatar {
    width: 48px;
    height: 48px;
    border-radius: 9999px;
    float: left;
    margin-right: 1rem;
}

#reviews #comments ol.commentlist li.review .comment-text {
    overflow: hidden;
}

#reviews #comments ol.commentlist li.review .meta {
    margin-bottom: 0.5rem;
}

#reviews #comments ol.commentlist li.review .meta strong {
    color: #111827;
}

/* Review Form */
#review_form_wrapper {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid #e5e7eb;
}

#review_form .comment-reply-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: #111827;
    margin-bottom: 1rem;
}

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

#review_form .comment-form-rating label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

#review_form .comment-form-rating select {
    padding: 0.5rem 1rem;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
}

#review_form textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    min-height: 120px;
}

#review_form input[type="submit"] {
    padding: 0.75rem 1.5rem;
    background: #4f46e5;
    color: #fff;
    font-weight: 600;
    border: none;
    border-radius: 9999px;
    cursor: pointer;
    transition: all 0.2s;
}

#review_form input[type="submit"]:hover {
    background: #4338ca;
}
