/**
 * WooCommerce My Account Page Styles
 * Flexbox layout with responsive tables and mobile support
 */

/* ==========================================================================
   Account Page Layout - Flexbox
   ========================================================================== */

.woocommerce-account {
    width: 100%;
}

.woocommerce-account .woocommerce {
    display: flex;
    flex-wrap: wrap;
    gap: 30px;
}

/* Account Navigation */
.woocommerce-account .woocommerce-MyAccount-navigation {
    flex: 0 0 280px;
    background: #f8f8f8;
    padding: 20px;
    border-radius: 4px;
}

.woocommerce-account .woocommerce-MyAccount-navigation ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.woocommerce-account .woocommerce-MyAccount-navigation ul li {
    margin: 0 0 10px 0;
    padding: 0;
}

.woocommerce-account .woocommerce-MyAccount-navigation ul li a {
    display: block;
    padding: 12px 15px;
    text-decoration: none;
    color: #333;
    font-size: 16px;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.woocommerce-account .woocommerce-MyAccount-navigation ul li a:hover {
    background: #e0e0e0;
}

.woocommerce-account .woocommerce-MyAccount-navigation ul li.is-active a {
    background: #000;
    color: #fff;
}

/* Account Content */
.woocommerce-account .woocommerce-MyAccount-content {
    flex: 1;
    min-width: 0; /* Prevents flex overflow */
}

/* Page Title */
.woocommerce-account .entry-header {
    margin-bottom: 30px;
}

.woocommerce-account .entry-title {
    font-size: 32px;
    font-weight: 700;
    margin: 0 0 20px 0;
}

/* ==========================================================================
   Orders Table - Desktop
   ========================================================================== */

.woocommerce-orders-table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    background: #fff;
}

.woocommerce-orders-table thead {
    background: #f8f8f8;
}

.woocommerce-orders-table th {
    padding: 15px;
    text-align: left;
    font-weight: 600;
    font-size: 14px;
    text-transform: uppercase;
    color: #333;
    border-bottom: 2px solid #e0e0e0;
}

.woocommerce-orders-table td {
    padding: 15px;
    border-bottom: 1px solid #e0e0e0;
    color: #666;
}

.woocommerce-orders-table tr:hover {
    background: #fafafa;
}

/* Order Number */
.woocommerce-orders-table .woocommerce-orders-table__cell-order-number a {
    font-weight: 600;
    color: #000;
    text-decoration: none;
}

.woocommerce-orders-table .woocommerce-orders-table__cell-order-number a:hover {
    text-decoration: underline;
}

/* Order Status */
.woocommerce-orders-table .woocommerce-orders-table__cell-order-status {
    font-weight: 500;
}

/* Order Actions */
.woocommerce-orders-table .woocommerce-orders-table__cell-order-actions a {
    display: inline-block;
    padding: 8px 16px;
    background: #000;
    color: #fff;
    text-decoration: none;
    border-radius: 4px;
    font-size: 14px;
    transition: background 0.3s ease;
    margin-right: 5px;
}

.woocommerce-orders-table .woocommerce-orders-table__cell-order-actions a:hover {
    background: #333;
}

/* ==========================================================================
   Responsive Tables - Tablet and Mobile
   ========================================================================== */

/* Tablet - 768px and below */
@media (max-width: 768px) {
    .woocommerce-account .woocommerce {
        flex-direction: column;
        gap: 20px;
    }

    .woocommerce-account .woocommerce-MyAccount-navigation {
        flex: 0 0 auto;
        width: 100%;
    }

    .woocommerce-account .woocommerce-MyAccount-content {
        flex: 0 0 auto;
        width: 100%;
    }

    /* Table Horizontal Scroll */
    .woocommerce-orders-table-wrapper {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .woocommerce-orders-table {
        min-width: 600px;
    }

    .woocommerce-orders-table th,
    .woocommerce-orders-table td {
        padding: 12px 10px;
        font-size: 13px;
    }
}

/* Mobile - 576px and below - Card Style Tables */
@media (max-width: 576px) {
    .woocommerce-account .entry-title {
        font-size: 24px;
    }

    /* Navigation - Accordion Style */
    .woocommerce-account .woocommerce-MyAccount-navigation {
        padding: 15px;
    }

    .woocommerce-account .woocommerce-MyAccount-navigation ul li a {
        padding: 10px 12px;
        font-size: 14px;
    }

    /* Convert Table to Cards */
    .woocommerce-orders-table {
        min-width: 100%;
        border: 0;
    }

    .woocommerce-orders-table thead {
        display: none; /* Hide table headers */
    }

    .woocommerce-orders-table tbody,
    .woocommerce-orders-table tr,
    .woocommerce-orders-table td {
        display: block;
        width: 100%;
    }

    .woocommerce-orders-table tr {
        margin-bottom: 20px;
        border: 1px solid #e0e0e0;
        border-radius: 4px;
        background: #fff;
        padding: 15px;
    }

    .woocommerce-orders-table td {
        padding: 10px 0;
        border: 0;
        position: relative;
        padding-left: 50%;
        text-align: right;
    }

    .woocommerce-orders-table td::before {
        content: attr(data-title);
        position: absolute;
        left: 0;
        width: 45%;
        padding-right: 10px;
        font-weight: 600;
        text-align: left;
        color: #333;
    }

    .woocommerce-orders-table td:last-child {
        padding-bottom: 0;
    }

    /* Order Actions - Full Width Buttons */
    .woocommerce-orders-table .woocommerce-orders-table__cell-order-actions {
        padding-left: 0;
        text-align: left;
    }

    .woocommerce-orders-table .woocommerce-orders-table__cell-order-actions::before {
        display: none;
    }

    .woocommerce-orders-table .woocommerce-orders-table__cell-order-actions a {
        display: block;
        width: 100%;
        text-align: center;
        margin: 5px 0;
    }
}

/* ==========================================================================
   Account Dashboard
   ========================================================================== */

.woocommerce-MyAccount-content > p {
    line-height: 1.6;
    margin-bottom: 15px;
}

.woocommerce-MyAccount-content .woocommerce-Message {
    padding: 15px;
    background: #f0f8ff;
    border-left: 4px solid #0066cc;
    margin-bottom: 20px;
}

/* ==========================================================================
   Forms - Edit Account, Addresses
   ========================================================================== */

.woocommerce-EditAccountForm,
.woocommerce-address-fields {
    max-width: 600px;
}

.woocommerce-EditAccountForm .form-row,
.woocommerce-address-fields .form-row {
    margin-bottom: 20px;
}

.woocommerce-EditAccountForm label,
.woocommerce-address-fields label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
}

.woocommerce-EditAccountForm input[type="text"],
.woocommerce-EditAccountForm input[type="email"],
.woocommerce-EditAccountForm input[type="password"],
.woocommerce-address-fields input[type="text"],
.woocommerce-address-fields input[type="email"],
.woocommerce-address-fields select {
    width: 100%;
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.woocommerce-EditAccountForm button[type="submit"],
.woocommerce-address-fields button[type="submit"] {
    padding: 12px 30px;
    background: #000;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    transition: background 0.3s ease;
}

.woocommerce-EditAccountForm button[type="submit"]:hover,
.woocommerce-address-fields button[type="submit"]:hover {
    background: #333;
}

/* ==========================================================================
   Addresses Page
   ========================================================================== */

.woocommerce-Addresses {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
    margin: 20px 0;
}

.woocommerce-Address {
    background: #f8f8f8;
    padding: 20px;
    border-radius: 4px;
}

.woocommerce-Address-title h3 {
    margin: 0 0 15px 0;
    font-size: 18px;
}

.woocommerce-Address address {
    font-style: normal;
    line-height: 1.6;
    margin-bottom: 15px;
}

.woocommerce-Address .edit {
    display: inline-block;
    padding: 8px 16px;
    background: #000;
    color: #fff;
    text-decoration: none;
    border-radius: 4px;
    font-size: 14px;
}

.woocommerce-Address .edit:hover {
    background: #333;
}

@media (max-width: 576px) {
    .woocommerce-Addresses {
        grid-template-columns: 1fr;
        gap: 20px;
    }
}

/* ==========================================================================
   Order Details Page
   ========================================================================== */

.woocommerce-order-details {
    margin: 20px 0;
}

.woocommerce-order-details__title {
    font-size: 24px;
    margin-bottom: 20px;
}

.woocommerce-table--order-details {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
}

.woocommerce-table--order-details th,
.woocommerce-table--order-details td {
    padding: 15px;
    text-align: left;
    border-bottom: 1px solid #e0e0e0;
}

.woocommerce-table--order-details thead th {
    background: #f8f8f8;
    font-weight: 600;
}

.woocommerce-table--order-details tfoot th {
    font-weight: 600;
}

@media (max-width: 576px) {
    .woocommerce-table--order-details thead {
        display: none;
    }

    .woocommerce-table--order-details,
    .woocommerce-table--order-details tbody,
    .woocommerce-table--order-details tr,
    .woocommerce-table--order-details td {
        display: block;
        width: 100%;
    }

    .woocommerce-table--order-details tr {
        margin-bottom: 20px;
        border: 1px solid #e0e0e0;
        padding: 15px;
    }

    .woocommerce-table--order-details td {
        padding: 10px 0;
        position: relative;
        padding-left: 50%;
    }

    .woocommerce-table--order-details td::before {
        content: attr(data-title);
        position: absolute;
        left: 0;
        width: 45%;
        font-weight: 600;
    }
}

/* ==========================================================================
   Downloads
   ========================================================================== */

.woocommerce-MyAccount-downloads {
    overflow-x: auto;
}

/* ==========================================================================
   Payment Methods
   ========================================================================== */

.woocommerce-PaymentMethods {
    list-style: none;
    padding: 0;
    margin: 0;
}

.woocommerce-PaymentMethod {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background: #f8f8f8;
    margin-bottom: 10px;
    border-radius: 4px;
}

@media (max-width: 576px) {
    .woocommerce-PaymentMethod {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
}

/* ==========================================================================
   Utilities
   ========================================================================== */

.woocommerce-MyAccount-content .woocommerce-button {
    padding: 10px 20px;
    background: #000;
    color: #fff;
    text-decoration: none;
    border-radius: 4px;
    display: inline-block;
    border: none;
    cursor: pointer;
    transition: background 0.3s ease;
}

.woocommerce-MyAccount-content .woocommerce-button:hover {
    background: #333;
}

.woocommerce-MyAccount-content .woocommerce-button--secondary {
    background: #fff;
    color: #000;
    border: 1px solid #000;
}

.woocommerce-MyAccount-content .woocommerce-button--secondary:hover {
    background: #f8f8f8;
}

