/*
Theme Name: OTAVN Shop
Theme URI: https://otavn.com
Author: OTAVN
Author URI: https://otavn.com
Description: Giao diện bán Plugin, Module chuyên nghiệp.
Version: 1.0.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: otavnshop
*/

:root {
    --primary-color: #FF0000;
    --secondary-color: #00A0FD;
    --accent-color: #FF914D;
    --white: #ffffff;
    --black: #333333;
    --gray: #f4f4f4;
    --container-width: 1200px; /* Định nghĩa chiều rộng container chuẩn */
}

* {
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: var(--black);
    line-height: 1.6;
    margin: 0;
    padding: 0;
    background-color: var(--gray);
    width: 100%;
    overflow-x: hidden;
}

.container {
    width: 100%;
    max-width: var(--container-width);
    margin: 0 auto;
    padding-left: 15px;
    padding-right: 15px;
}

header {
    background-color: var(--white);
    border-bottom: 2px solid var(--primary-color);
    padding: 15px 0;
    width: 100%;
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    gap: 25px;
}

nav ul li {
    display: inline-block;
}

nav a {
    text-decoration: none;
    color: var(--black);
    font-weight: 600;
    font-size: 15px;
    transition: color 0.3s ease;
    padding: 5px 0;
    position: relative;
}

nav a::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--primary-color);
    transition: width 0.3s ease;
}

nav a:hover::after {
    width: 100%;
}

nav a:hover {
    color: var(--primary-color);
}

.main-content {
    margin-top: 30px;
    margin-bottom: 50px;
    min-height: 60vh;
}

/** WooCommerce Compatibility **/
.woocommerce ul.products li.product .button {
    background-color: var(--secondary-color);
    color: #fff;
    border-radius: 30px;
    padding: 10px 20px;
}

.woocommerce div.product p.price, .woocommerce div.product span.price {
    color: var(--secondary-color);
}

/** Cart Page **/
.woocommerce-cart table.cart {
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid #eee;
    background: #fff;
}

.woocommerce-cart table.cart img {
    border-radius: 8px;
    width: 80px !important;
}

.woocommerce-cart table.cart td.actions .button {
    background-color: var(--secondary-color) !important;
    color: #fff !important;
    border-radius: 30px !important;
    padding: 10px 25px !important;
    text-transform: none;
}

.woocommerce-cart .wc-proceed-to-checkout a.checkout-button {
    background-color: var(--primary-color) !important;
    color: #fff !important;
    font-size: 1.1em;
    font-weight: 700;
    padding: 15px !important;
    border-radius: 30px !important;
    text-align: center;
}

/** Checkout Page **/
.woocommerce-checkout #payment div.place-order button#place_order {
    background-color: var(--primary-color) !important;
    color: #fff !important;
    width: 100%;
    padding: 15px !important;
    font-size: 1.1em;
    font-weight: 700;
    border-radius: 30px !important;
    margin-top: 20px;
}

.woocommerce-checkout .col-1, .woocommerce-checkout .col-2 {
    max-width: 100%;
    flex: 0 0 100%;
}

.woocommerce-checkout h3#order_review_heading {
    border-top: 2px solid var(--accent-color);
    padding-top: 20px;
    margin-top: 30px;
}

.woocommerce-checkout #customer_details, .woocommerce-checkout #order_review {
    background: #fff;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
}

/** Form Fields **/
.woocommerce form .form-row input.input-text, 
.woocommerce form .form-row textarea,
.woocommerce form .form-row select {
    padding: 12px 15px !important;
    border: 1px solid #ddd !important;
    border-radius: 8px !important;
    background: #f9f9f9;
}

.woocommerce form .form-row input.input-text:focus,
.woocommerce form .form-row textarea:focus {
    border-color: var(--secondary-color) !important;
    background: #fff;
    outline: none;
}

/** General Buttons **/
.woocommerce #respond input#submit,
.woocommerce a.button,
.woocommerce button.button,
.woocommerce input.button {
    background-color: var(--secondary-color);
    color: #fff;
    border-radius: 30px;
    padding: 12px 30px;
    font-weight: 600;
    transition: all 0.3s ease;
}

/** Course Item Layout mimicking sample **/
.woocommerce ul.products {
    display: flex;
    flex-wrap: wrap;
    margin: 0 -15px !important;
    padding: 0;
    list-style: none;
}

.woocommerce ul.products li.product {
    width: calc(25% - 30px) !important;
    margin: 0 15px 30px 15px !important;
    padding: 0 !important;
    background: #fff;
    border: none;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    position: relative;
    float: left;
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    overflow: hidden;
}

.woocommerce ul.products li.product:hover {
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    transform: translateY(-5px);
}

/* Course Thumbnail Wrapper */
.woocommerce ul.products li.product .woocommerce-loop-product__link {
    display: block;
    position: relative;
    overflow: hidden;
    margin-bottom: 0;
    border-radius: 12px 12px 0 0;
}

.woocommerce ul.products li.product img {
    width: 100%;
    height: auto;
    aspect-ratio: 400 / 300;
    object-fit: cover;
    margin: 0 !important;
    display: block;
    transition: transform 0.6s ease;
}

.woocommerce ul.products li.product:hover img {
    transform: scale(1.08);
}

/* Button "Đăng ký" like overlay - Change to Blue */
.woocommerce ul.products li.product .button {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: var(--secondary-color) !important;
    color: #fff !important;
    padding: 10px 25px !important;
    border-radius: 30px !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 5;
    text-transform: none !important;
    box-shadow: 0 4px 10px rgba(0, 160, 253, 0.3);
}

.woocommerce ul.products li.product .button:hover {
    background: var(--primary-color) !important;
    box-shadow: 0 4px 10px rgba(255, 0, 0, 0.3);
}

.woocommerce ul.products li.product:hover .button {
    opacity: 1;
    visibility: visible;
}

/* Content Area - Fix spacing and padding */
.woocommerce ul.products li.product .woocommerce-loop-product__title {
    font-size: 16px;
    font-weight: 700;
    color: #333;
    margin: 12px 12px 5px 12px !important; /* Thêm padding trái phải và giảm margin dọc */
    line-height: 1.3;
    height: 42px;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

/* Meta mimicking Course sample - Fix spacing and padding */
.course-author-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 5px 12px !important; /* Giảm giãn dòng và thêm padding trái */
}

.course-author-meta img {
    width: 28px !important;
    height: 28px !important;
    border-radius: 50% !important;
    margin: 0 !important;
}

.course-author-meta .author-name {
    font-size: 13px;
    color: #666;
    font-weight: 500;
}

/* Price styling - Fix spacing and padding */
.woocommerce ul.products li.product .price {
    display: flex;
    flex-direction: row-reverse;
    justify-content: flex-end;
    align-items: center;
    gap: 8px;
    font-size: 16px;
    font-weight: 700;
    color: var(--secondary-color);
    margin: 5px 12px 15px 12px !important; /* Giảm giãn dòng, thêm padding trái và margin bottom */
}

.woocommerce ul.products li.product .price del {
    font-size: 14px;
    color: var(--primary-color) !important;
    font-weight: 400;
    opacity: 0.7;
}

.woocommerce ul.products li.product .price ins {
    text-decoration: none;
    color: var(--secondary-color) !important;
}

/* Responsive */
@media (max-width: 992px) {
    .woocommerce ul.products li.product {
        width: calc(50% - 30px) !important;
    }
}

@media (max-width: 576px) {
    .woocommerce ul.products li.product {
        width: calc(100% - 30px) !important;
    }
}

/** Single Product Page Styling **/
.woocommerce div.product {
    background: #fff;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.05);
}

.woocommerce div.product div.images img {
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.woocommerce div.product .product_title {
    color: #333;
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 15px;
}

.woocommerce div.product p.price,
.woocommerce div.product span.price {
    color: var(--secondary-color) !important;
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 20px;
}

.woocommerce div.product p.price del,
.woocommerce div.product span.price del {
    color: var(--primary-color) !important;
    font-size: 0.7em;
    font-weight: 400;
    opacity: 0.7;
}

.woocommerce div.product p.price ins,
.woocommerce div.product span.price ins {
    color: var(--secondary-color) !important;
    text-decoration: none;
}

.woocommerce div.product .woocommerce-product-details__short-description {
    margin-bottom: 25px;
    color: #666;
    line-height: 1.8;
}

.woocommerce div.product form.cart {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-top: 25px;
}

.woocommerce div.product form.cart .quantity .qty {
    width: 60px !important;
    height: 50px !important;
    padding: 0 10px !important;
    border: 1px solid #ddd !important;
    border-radius: 30px !important;
    font-size: 16px !important;
    font-weight: 600 !important;
    text-align: center;
    background: #f9f9f9;
    color: #333;
    outline: none;
}

.woocommerce div.product form.cart .button {
    background-color: var(--secondary-color) !important;
    color: #fff !important;
    height: 50px !important;
    padding: 0 40px !important;
    font-size: 16px !important;
    font-weight: 600 !important;
    border-radius: 30px !important;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.woocommerce div.product form.cart .button:hover {
    background-color: var(--primary-color) !important;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 0, 0, 0.2);
}

/* Tabs styling */
.woocommerce div.product .woocommerce-tabs ul.tabs li.active a {
    color: var(--primary-color);
}

/* Badge for sale - Styled to match Course Grid */
.woocommerce span.onsale,
.woocommerce ul.products li.product span.onsale,
.woocommerce div.product span.onsale {
    top: 15px !important;
    left: 15px !important;
    right: auto !important;
    margin: 0 !important;
    background-color: var(--primary-color) !important;
    color: #fff !important;
    padding: 6px 15px !important;
    min-height: auto !important;
    line-height: 1 !important;
    border-radius: 4px !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    z-index: 10;
    box-shadow: 0 2px 8px rgba(255, 0, 0, 0.3);
}
