/* ========================================= */
/* --- My Account - Navigation Menu CSS ---  */
/* ========================================= */

/* General styling for the navigation container */
.woocommerce-MyAccount-navigation {
    background-color: #f8f8f8;
    border-radius: 8px;
    margin-bottom: 30px;
    padding: 10px;
}

/* Remove default list styling */
.woocommerce-MyAccount-navigation ul {
    list-style-type: none;
    margin: 0;
    padding: 0;
}

/* Style for each menu item */
.woocommerce-MyAccount-navigation-link {
    margin-bottom: 5px;
}

/* Style for the links within the menu */
.woocommerce-MyAccount-navigation-link a {
    display: block;
    padding: 12px 15px;
    background-color: #f8f8f8;
    color: #333;
    text-decoration: none;
    font-weight: 600;
    border-radius: 4px;
    transition: background-color 0.2s ease, color 0.2s ease;
}

/* Hover and focus states */
.woocommerce-MyAccount-navigation-link a:hover,
.woocommerce-MyAccount-navigation-link a:focus {
    background-color: #ebebeb;
    color: #00669c;
}

/* Style for the active menu item */
.woocommerce-MyAccount-navigation-link.is-active a {
    background-color: #fff;
    color: #00669c;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
}

/* ========================================= */
/* --- Mobile Responsive Navigation ---      */
/* ========================================= */

@media (max-width: 768px) {
    /* Allow menu items to wrap and remove overflow scroll */
    .woocommerce-MyAccount-navigation {
        padding: 10px;
        margin-bottom: 20px;
        overflow-x: unset; /* Remove horizontal scroll */
        -webkit-overflow-scrolling: unset;
    }

    .woocommerce-MyAccount-navigation ul {
        display: flex;
        flex-wrap: wrap; /* Allow items to wrap to a new line */
        justify-content: flex-start;
        align-items: flex-start;
    }

    .woocommerce-MyAccount-navigation-link {
        flex-shrink: 0;
        margin: 0 5px 5px 0; /* Adjust margins to create space between buttons */
    }

    .woocommerce-MyAccount-navigation-link a {
        padding: 8px 12px;
        font-size: 14px;
        font-weight: 500;
        white-space: normal; /* Allow text to wrap if necessary */
    }

    /* Style for the active mobile tab */
    .woocommerce-MyAccount-navigation-link.is-active a {
        box-shadow: none; /* Remove the shadow for a cleaner look */
    }
}

/* ========================================= */
/* --- My Account - Downloads Table CSS ---  */
/* ========================================= */

/* General styling for My Account content */
.woocommerce-MyAccount-content {
    /* Assuming "Adelle" is already enqueued by your theme or another plugin */
    font-family: "Adelle", serif;
}

/* General table styling */
.woocommerce-MyAccount-content table.shop_table {
    border: none !important; /* Overwrites any default borders */
    border-collapse: collapse;
    width: 100%;
}

/* Table header styling */
.woocommerce-MyAccount-content table.shop_table th {
    font-weight: 600;
    text-align: left;
    padding: 12px 15px;
    background-color: #f8f8f8;
    border-bottom: none; /* Removed the header border */
    font-size: 14px; /* Standardized header font size */
    color: #333;
}

/* Table body styling */
.woocommerce-MyAccount-content table.shop_table td {
    padding: 12px 15px;
    /* Removed individual cell borders to apply a single row border */
    border: none;
    vertical-align: middle;
}

/* Add a 2px horizontal border to each row */
.woocommerce-MyAccount-content table.shop_table tr {
    border-bottom: 2px solid #ddd;
}

/* Capa (Thumbnail) column specific styling */
.woocommerce-MyAccount-content table.shop_table .download_thumbnail {
    width: 1%; /* Shrink to fit content */
    white-space: nowrap;
}

/* --- Thumbnail image styling --- */
.woocommerce-MyAccount-content table.shop_table .download_thumbnail img {
    max-width: 90px;
    height: auto;
    display: block;
    
    /* New styles for a more realistic paper effect */
    border-radius: 8px; /* More rounded corners */
    border: 2px solid #ffffff; /* 2px white border */
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.07),
                0 2px 4px rgba(0, 0, 0, 0.07),
                0 4px 8px rgba(0, 0, 0, 0.07),
                0 8px 16px rgba(0, 0, 0, 0.07),
                0 16px 32px rgba(0, 0, 0, 0.07),
                0 32px 64px rgba(0, 0, 0, 0.07);
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}

/* Optional: Add a subtle hover effect for the thumbnail */
.woocommerce-MyAccount-content table.shop_table .download_thumbnail img:hover {
    transform: translateY(-2px); /* Lift slightly */
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1),
                0 2px 4px rgba(0, 0, 0, 0.1),
                0 4px 8px rgba(0, 0, 0, 0.1),
                0 8px 16px rgba(0, 0, 0, 0.1),
                0 16px 32px rgba(0, 0, 0, 0.1),
                0 32px 64px rgba(0, 0, 0, 0.1);
}

/* Edição (Product Name) styling */
.woocommerce-MyAccount-content table.shop_table .download-product a {
    color: #00669c; /* Set the new color */
    font-weight: bold;
    font-size: 18px;
    text-decoration: none; /* Remove underline from the link */
}

/* Style for the 'Ver Edição' link */
.woocommerce-MyAccount-downloads-file {
    display: inline-block;
    padding: 8px 16px;
    background-color: #333333; /* Set the new background color */
    color: #fff;
    text-align: center;
    text-decoration: none;
    border-radius: 4px;
    font-weight: 600;
    font-size: 14px;
    transition: background-color 0.3s ease;
}

.woocommerce-MyAccount-downloads-file:hover {
    background-color: #1a1a1a; /* A darker shade for hover effect */
}

/* ========================================= */
/* --- Mobile Specific Stacked Layout ---  */
/* ========================================= */

@media (max-width: 768px) {
    /* Hide the table headers on small screens */
    .woocommerce-MyAccount-content table.shop_table thead {
        display: none;
    }

    /* Add max-width and center the table on mobile */
    .woocommerce-MyAccount-content table.shop_table {
        max-width: 320px;
        margin: 0 auto 20px auto;
    }

    /* Make table rows and cells block-level */
    .woocommerce-MyAccount-content table.shop_table tr {
        display: block;
        margin-bottom: 20px;
        border: 1px solid #ddd;
        border-radius: 8px;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    }
    
    .woocommerce-MyAccount-content table.shop_table td {
        display: block;
        text-align: right;
        padding: 10px 15px;
        border-bottom: 1px solid #eee;
        position: relative;
    }
    
    /* Remove borders from the row on mobile */
    .woocommerce-MyAccount-content table.shop_table tr {
        border-bottom: none;
    }
    
    .woocommerce-MyAccount-content table.shop_table td:last-child {
        border-bottom: none;
    }
    
    /* Display data titles as a label */
    .woocommerce-MyAccount-content table.shop_table td::before {
        content: attr(data-title) ": ";
        font-weight: 600;
        text-transform: uppercase;
        font-size: 12px;
        color: #666;
        position: absolute;
        left: 15px;
        white-space: nowrap;
    }
    
    /* Center thumbnail and its container on mobile */
    .woocommerce-MyAccount-content table.shop_table .download_thumbnail {
        text-align: center;
        padding: 5px 0; /* 5px padding top and bottom */
        width: auto; /* Remove the 1% width for mobile */
    }

    /* Hide the label for the thumbnail */
    .woocommerce-MyAccount-content table.shop_table .download_thumbnail::before {
        content: none;
    }

    .woocommerce-MyAccount-content table.shop_table .download_link {
        text-align: center;
    }
}
