/* ==========================================================================
   CUSTOM THEME STYLES & BRAND COLORS
   Product Theme - Custom CSS
   ========================================================================== */

/* ==========================================================================
   BRAND COLOR VARIABLES
   🎨 CHANGE YOUR BRAND COLOR HERE! 👇
   ========================================================================== */

:root {
    --primary-color: #3498db;        /* 👈 CHANGE THIS to your brand color */
    --primary-hover: #2980b9;        /* Slightly darker version */
    --secondary-color: #2c3e50;      /* Dark accent */
    --success-color: #27ae60;        /* Green for success messages */
    --warning-color: #f39c12;        /* Orange for warnings */
    --danger-color: #e74c3c;         /* Red for errors */
    --light-bg: #f8f9fa;             /* Light background */
    --border-color: #e0e0e0;         /* Border color */
}

/* Apply primary color to key elements */
a {
    color: var(--primary-color);
}

a:hover {
    color: var(--primary-hover);
}

.button,
button,
input[type="submit"],
.btn {
    background-color: var(--primary-color);
}

.button:hover,
button:hover,
input[type="submit"]:hover,
.btn:hover {
    background-color: var(--primary-hover);
}

/* ==========================================================================
   WOOCOMMERCE PRODUCT GRID - MOBILE FIRST
   ========================================================================== */

/* Full-width layout for WooCommerce pages (no sidebar) */
.site-main.full-width {
    width: 100%;
    max-width: 100%;
}

.woocommerce-products-grid {
    display: grid;
    grid-template-columns: 1fr;           /* 1 column on mobile */
    gap: 1.5rem;
    margin-bottom: 2rem;
}

/* ==========================================================================
   PRODUCT CARD STYLES
   ========================================================================== */

.product-card {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
}

.product-image-wrapper {
    position: relative;
    width: 100%;
    padding-top: 100%;                    /* Square aspect ratio */
    overflow: hidden;
    background: var(--light-bg);
}

.product-image-wrapper img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.product-card:hover .product-image-wrapper img {
    transform: scale(1.05);
}

/* Product badge (e.g., "Sale", "New") */
.product-badge {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: var(--danger-color);
    color: #fff;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
}

.product-badge.new {
    background: var(--success-color);
}

.product-info {
    padding: 1.25rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.product-category {
    font-size: 0.75rem;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.5rem;
}

.product-title {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    line-height: 1.4;
    color: var(--secondary-color);
}

.product-title a {
    color: inherit;
}

.product-title a:hover {
    color: var(--primary-color);
}

.product-description {
    font-size: 0.875rem;
    color: #666;
    margin-bottom: 1rem;
    line-height: 1.6;
    flex-grow: 1;
}

.product-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
}

.product-price {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
}

.product-price del {
    font-size: 1rem;
    color: #999;
    margin-right: 0.5rem;
}

.add-to-cart-btn {
    padding: 0.5rem 1rem;
    background: var(--primary-color);
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.add-to-cart-btn:hover {
    background: var(--primary-hover);
}

/* ==========================================================================
   WOOCOMMERCE STANDARD ELEMENTS
   ========================================================================== */

/* WooCommerce Messages */
.woocommerce-message,
.woocommerce-info,
.woocommerce-error {
    padding: 1rem;
    margin-bottom: 1rem;
    border-radius: 6px;
    border-left: 4px solid;
}

.woocommerce-message {
    background: #d4edda;
    border-color: var(--success-color);
    color: #155724;
}

.woocommerce-info {
    background: #d1ecf1;
    border-color: var(--primary-color);
    color: #0c5460;
}

.woocommerce-error {
    background: #f8d7da;
    border-color: var(--danger-color);
    color: #721c24;
}

/* Shop Toolbar */
.woocommerce-result-count,
.woocommerce-ordering {
    margin-bottom: 1rem;
}

.woocommerce-ordering select {
    padding: 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
}

/* Pagination */
.woocommerce-pagination {
    margin-top: 2rem;
    text-align: center;
}

.woocommerce-pagination ul {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    list-style: none;
    padding: 0;
}

.woocommerce-pagination li {
    display: inline-block;
}

.woocommerce-pagination a,
.woocommerce-pagination span {
    display: block;
    padding: 0.5rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    color: var(--secondary-color);
}

.woocommerce-pagination a:hover,
.woocommerce-pagination .current {
    background: var(--primary-color);
    color: #fff;
    border-color: var(--primary-color);
}

/* ==========================================================================
   SINGLE PRODUCT PAGE
   ========================================================================== */

.single-product-wrapper {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    margin-bottom: 3rem;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
}

.product-images {
    width: 100%;
}

.product-main-image {
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 1rem;
    background: #fff;
    border: 1px solid var(--border-color);
}

.product-main-image img {
    width: 100%;
    height: auto;
}

.product-thumbnails {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.5rem;
}

.product-thumbnail {
    border-radius: 6px;
    overflow: hidden;
    cursor: pointer;
    border: 2px solid transparent;
    transition: border-color 0.3s ease;
}

.product-thumbnail:hover {
    border-color: var(--primary-color);
}

.product-details {
    width: 100%;
}

.product-meta {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: 1.5rem 0;
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
    margin: 1.5rem 0;
}

.product-meta-item {
    display: flex;
    gap: 0.5rem;
}

.meta-label {
    font-weight: 600;
    color: var(--secondary-color);
}

.meta-value {
    color: #666;
}

/* Quantity Selector */
.quantity {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.quantity input {
    width: 60px;
    text-align: center;
}

/* Add to Cart Button */
.single_add_to_cart_button {
    width: 100%;
    padding: 1rem;
    font-size: 1.125rem;
    margin-top: 1rem;
}

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

.woocommerce-tabs ul.tabs {
    display: flex;
    border-bottom: 2px solid var(--border-color);
    list-style: none;
    padding: 0;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.woocommerce-tabs ul.tabs li {
    margin-right: 1rem;
}

.woocommerce-tabs ul.tabs li a {
    display: block;
    padding: 1rem;
    color: #666;
    font-weight: 500;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
}

.woocommerce-tabs ul.tabs li.active a {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

/* ==========================================================================
   CART PAGE
   ========================================================================== */

.cart-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 2rem;
}

.cart-table th,
.cart-table td {
    padding: 1rem;
    border: 1px solid var(--border-color);
}

.cart-table th {
    background: var(--light-bg);
    font-weight: 600;
    text-align: left;
}

.cart-totals {
    background: var(--light-bg);
    padding: 1.5rem;
    border-radius: 8px;
    margin-bottom: 1rem;
}

.cart-totals h2 {
    margin-bottom: 1rem;
}

.cart-totals table {
    width: 100%;
}

.cart-totals th,
.cart-totals td {
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border-color);
}

.order-total {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
}

/* ==========================================================================
   CHECKOUT PAGE
   ========================================================================== */

.checkout-form {
    display: grid;
    gap: 2rem;
}

.form-row {
    margin-bottom: 1rem;
}

.form-row label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.required {
    color: var(--danger-color);
}

.order-review {
    background: var(--light-bg);
    padding: 1.5rem;
    border-radius: 8px;
}

/* ==========================================================================
   RESPONSIVE - TABLET
   ========================================================================== */

@media (min-width: 768px) {
    /* 2 columns on tablet */
    .woocommerce-products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 2rem;
    }
    
    /* Single product layout - side by side */
    .single-product-wrapper {
        flex-direction: row;
        align-items: flex-start;
    }
    
    .product-images {
        width: 45%;
        flex-shrink: 0;
    }
    
    .product-details {
        width: 55%;
        flex-grow: 1;
    }
    
    .checkout-form {
        grid-template-columns: 1fr 1fr;
    }
}

/* ==========================================================================
   RESPONSIVE - DESKTOP
   ========================================================================== */

@media (min-width: 1024px) {
    /* 3 columns on desktop */
    .woocommerce-products-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 2.5rem;
    }
    
    /* Single product - better proportions on desktop */
    .single-product-wrapper {
        gap: 3rem;
        max-width: 1400px;
    }
    
    .product-images {
        width: 50%;
    }
    
    .product-details {
        width: 50%;
    }
    
    /* 4 columns on very wide screens */
    @media (min-width: 1400px) {
        .woocommerce-products-grid {
            grid-template-columns: repeat(4, 1fr);
            gap: 3rem;
        }
    }
}

/* ==========================================================================
   PRODUCT FILTERS & WIDGETS
   ========================================================================== */

.product-filters {
    background: var(--light-bg);
    padding: 1.5rem;
    border-radius: 8px;
    margin-bottom: 2rem;
}

.filter-group {
    margin-bottom: 1.5rem;
}

.filter-group:last-child {
    margin-bottom: 0;
}

.filter-title {
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: var(--secondary-color);
}

.filter-options {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.filter-checkbox {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.filter-checkbox input {
    margin: 0;
}

.filter-checkbox label {
    margin: 0;
    cursor: pointer;
}

/* Price Slider */
.price-slider {
    margin: 1rem 0;
}

/* ==========================================================================
   ANIMATIONS & TRANSITIONS
   ========================================================================== */

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

.product-card {
    animation: fadeIn 0.5s ease-out;
}

/* ==========================================================================
   UTILITY CLASSES
   ========================================================================== */

.sale-badge {
    background: var(--danger-color);
}

.out-of-stock {
    opacity: 0.6;
}

.out-of-stock::after {
    content: "Out of Stock";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0,0,0,0.8);
    color: white;
    padding: 1rem 2rem;
    border-radius: 4px;
    font-weight: 600;
}
